Chat
Use native Ollama chat for local and cloud models, images, history, knowledge, and tools.
Local examples clear OLLAMA_API_KEY and select the loopback server. The Cloud example uses an API key to select Ollama Cloud.
| Example | Description |
|---|---|
| Ollama Basic | Run a local Llama 3.1 agent on Ollama in sync, async, and streaming modes. |
| DB | Store local Ollama sessions in Postgres and include earlier turns. |
| Ollama Demo DeepSeek R1 | Ask a local DeepSeek-R1 model to write Python for quadratic equations and explain its reasoning. |
| Ollama Demo Gemma | Stream a short story about a local image from Gemma 3 12B running on Ollama. |
| Ollama Demo Phi4 | Run Microsoft Phi-4 locally through Ollama with a one-shot story prompt. |
| Ollama Demo Qwen | Build an NVDA stock report with Qwen3 on Ollama using YFinanceTools. |
| Ollama Image Agent | Describe a local image file with Llama 3.2 Vision running on Ollama. |
| Knowledge | Search a PgVector knowledge base embedded with OllamaEmbedder from a local Llama agent. |
| Memory | Persist user memories and session summaries in Postgres with a local qwen2.5 Ollama agent. |
| Ollama Cloud | Run gpt-oss:120b on Ollama Cloud with OLLAMA_API_KEY instead of a local Ollama server. |
| Retry | Understand the native Ollama retry limitation and configure retries through its compatible endpoint. |
| Set Client | Supply an explicit Ollama Python client to a local agent. |
| Ollama Set Temperature | Set sampling temperature on an Ollama model through the options dict. |
| Ollama Structured Output | Request JSON and validate a MovieScript with Pydantic through the native local Ollama API. |
| Tool Use | Call WebSearchTools from a local Llama 3.2 agent. |