docs: ollama nits (#31714)

This commit is contained in:
Mason Daugherty
2025-06-24 13:19:15 -04:00
committed by GitHub
parent 7cdd53390d
commit 8878a7b143
6 changed files with 1315 additions and 704 deletions

View File

@@ -8,8 +8,21 @@ This package contains the LangChain integration with Ollama
pip install -U langchain-ollama
```
You will also need to run the Ollama server locally.
You can download it [here](https://ollama.com/download).
For the package to work, you will need to install and run the Ollama server locally ([download](https://ollama.com/download)).
To run integration tests (`make integration_tests`), you will need the following models installed in your Ollama server:
- `llama3`
- `llama3:latest`
- `lamma3.1`
- `gemma3:4b`
- `deepseek-r1:1.5b`
Install these models by running:
```bash
ollama pull <name-of-model>
```
## Chat Models
@@ -34,6 +47,7 @@ embeddings.embed_query("What is the meaning of life?")
```
## LLMs
`OllamaLLM` class exposes LLMs from Ollama.
```python

View File

@@ -28,7 +28,7 @@ class OllamaLLM(BaseLLM):
from langchain_ollama import OllamaLLM
model = OllamaLLM(model="llama3")
model.invoke("Come up with 10 names for a song about parrots")
print(model.invoke("Come up with 10 names for a song about parrots"))
"""
model: str

File diff suppressed because it is too large Load Diff