# @langchain/ollama

> Ollama integration for LangChain.js

Latest version **1.3.0** (published 2026-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @langchain/ollama
pnpm add @langchain/ollama
yarn add @langchain/ollama
bun add @langchain/ollama
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2026-06-17 |
| First published | 2024-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 265.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 18328 |
| Author | LangChain |
| Maintainers | lc-oss-admin, langchain-security |

## Links

- npm: https://www.npmjs.com/package/@langchain/ollama
- Repository: https://github.com/langchain-ai/langchainjs
- Homepage: https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-ollama/
- Issues: https://github.com/langchain-ai/langchainjs/issues
- npm.io page: https://npm.io/package/@langchain/ollama

## Dependencies (1)

- [ollama](https://npm.io/package/ollama.md) ^0.6.3

## Recent versions

- 1.3.0 (latest) — 2026-06-17
- 1.2.3-dev-1771375941312 (dev) — 2026-02-18
- 0.0.1-rc.0 (next) — 2024-07-18
- 1.2.7 — 2026-04-27
- 1.2.6 — 2026-03-03
- 1.2.5 — 2026-02-26
- 1.2.4 — 2026-02-20
- 1.2.3 — 2026-02-18
- 1.2.3-dev-1771375715237 — 2026-02-18
- 1.2.2 — 2026-01-30
- 1.2.1 — 2026-01-20
- 1.2.0 — 2026-01-13
- 1.1.0 — 2025-12-13
- 1.0.4-dev-1765433794876 — 2025-12-11
- 1.0.4-dev-1765432861398 — 2025-12-11
- … 21 more at https://npm.io/package/@langchain/ollama/versions

## README

# @langchain/ollama

This package contains the LangChain.js integrations for Ollama via the `ollama` TypeScript SDK.

## Installation

```bash npm2yarn
npm install @langchain/ollama @langchain/core
```

## Setup

To use this package, you need to have Ollama running locally:

1. Download and install Ollama from [ollama.com](https://ollama.com/)
2. Pull a model: `ollama pull llama3`
3. Ensure the Ollama server is running (it starts automatically after installation)

By default, the package connects to `http://localhost:11434`. You can customize this by setting the `baseUrl` option when instantiating the model.

## Chat Models

```typescript
import { ChatOllama } from "@langchain/ollama";

const model = new ChatOllama({
  model: "llama3", // Default value.
});

const result = await model.invoke(["human", "Hello, how are you?"]);
```

## Development

To develop the `@langchain/ollama` package, you'll need to follow these instructions:

### Install dependencies

```bash
pnpm install
```

### Build the package

```bash
pnpm build
```

Or from the repo root:

```bash
pnpm build --filter @langchain/ollama
```

### Run tests

Test files should live within a `tests/` file in the `src/` folder. Unit tests should end in `.test.ts` and integration tests should
end in `.int.test.ts`:

```bash
$ pnpm test
$ pnpm test:int
```

### Lint & Format

Run the linter & formatter to ensure your code is up to standard:

```bash
pnpm lint && pnpm format
```

### Adding new entrypoints

If you add a new file to be exported, either import & re-export from `src/index.ts`, or add it to the `exports` field in the `package.json` file and run `pnpm build` to generate the new entrypoint.

---
_Source: https://npm.io/package/@langchain/ollama · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
