Overview
OLLamaLLMService
provides access to locally-run Ollama models through an OpenAI-compatible interface. It inherits from BaseOpenAILLMService
and allows you to run various open-source models locally while maintaining compatibility with OpenAI’s API format for privacy and cost control.
Ollama LLM API Reference
Pipecat’s API methods for Ollama integration
Example Implementation
Browse examples using Ollama models
Ollama Documentation
Official Ollama documentation and model library
Download Ollama
Download and setup instructions for Ollama
Installation
To use Ollama services, you need to install both Ollama and the Pipecat dependency:- Install Ollama on your system from ollama.com/download
- Install Pipecat dependency:
- Pull a model (first time only):
Prerequisites
Ollama Local Setup
Before using Ollama LLM services, you need:- Ollama Installation: Download and install Ollama from ollama.com
- Model Selection: Pull your desired models (llama2, mistral, codellama, etc.)
- Local Service: Ensure Ollama service is running (default port 11434)
- Hardware: Sufficient RAM and storage for your chosen models
Configuration
- No API Keys Required: Ollama runs entirely locally
- Model Management: Use
ollama pull <model>
to download models - Service URL: Default is
http://localhost:11434
(configurable)
Ollama runs as a local service on port 11434. No API key required for complete
privacy!