Ollama Provider
Use local Ollama models with PraisonAI TypeScript
Ollama Provider
Run models locally with Ollama.
Environment Variables
export OLLAMA_BASE_URL=http://localhost:11434Supported Modalities
| Modality | Supported |
|---|---|
| Text/Chat | ✅ |
| Embeddings | ✅ |
| Tools | ✅ |
Prerequisites
- Install Ollama: https://ollama.ai
- Pull a model:
ollama pull llama3.2
Quick Start
- Simple Usage
typescript import { Agent } from 'praisonai'; const agent = new Agent({ name: 'LocalAgent', instructions: 'You are a helpful assistant.', llm: 'ollama/llama3.2' }); const response = await agent.chat('Hello!'); - With Configuration
Adjust provider credentials and model settings for production — see the sections above.
Available Models
| Model | Description |
|---|---|
llama3.2 | Llama 3.2 |
llama3.1 | Llama 3.1 |
mistral | Mistral 7B |
codellama | Code Llama |
phi3 | Phi-3 |