---
layout: default
---

# Usar Ollama con LangChain.js

<div class="text-sm mt-4">

<v-click>

## 📦 Instalación

```bash
# 1. Descargar e instalar Ollama
# https://ollama.com/download

# 2. Descargar un modelo
ollama pull llama3.2

# 3. Instalar paquete LangChain
npm install @langchain/ollama
```

</v-click>

<v-click>

## 💻 Código

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

const model = new ChatOllama({
  model: "llama3.2",
  baseUrl: "http://localhost:11434",
});

const response = await model.invoke("¿Qué es LangChain?");
console.log(response.content);
```

</v-click>

</div>
