Provider Integrations#
This page provides an overview of all available provider integrations in the Serapeum framework. Providers implement the core abstractions to work with different LLM backends and services.
Overview#
Serapeum uses a provider-based organization where each provider package contains all features that provider offers (LLM, embeddings, and any provider-specific capabilities). This keeps related code together and makes it easy to install only the providers you need.
Available Providers#
- Ollama - Local LLM inference with Ollama server
- OpenAI - OpenAI API integration (coming soon)
- Azure OpenAI - Azure OpenAI Service integration (in development)
Provider Architecture#
All providers follow the same architectural pattern:
graph TB
subgraph "Core Abstractions"
A[BaseLLM Protocol]
B[BaseEmbedding Protocol]
C[FunctionCallingLLM]
end
subgraph "Provider Package"
D[ProviderLLM]
E[ProviderEmbedding]
F[Shared Client]
G[Provider Errors]
end
C --> A
D --> C
E --> B
D --> F
E --> F
F --> G
Key Components:
- LLM Implementation: Inherits from
FunctionCallingLLMto provide chat, completion, tool calling, and structured outputs - Embedding Implementation: Implements
BaseEmbeddingprotocol for text and query embeddings - Shared Client: HTTP client and configuration shared across LLM and embedding classes
- Provider Errors: Custom exceptions for provider-specific error handling
Provider Comparison#
| Provider | Status | LLM | Embeddings | Tool Calling | Streaming | Async |
|---|---|---|---|---|---|---|
| Ollama | ✅ Available | ✅ | ✅ | ✅ | ✅ | ✅ |
| OpenAI | 🚧 In Development | 🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
| Azure OpenAI | 🚧 In Development | 🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
Installation#
Each provider is distributed as a separate package. Install only the providers you need:
# Ollama provider
pip install serapeum-ollama
# OpenAI provider (when available)
pip install serapeum-openai
# Azure OpenAI provider (when available)
pip install serapeum-azure-openai
# Install multiple providers
pip install serapeum-ollama serapeum-openai
All provider packages depend on serapeum-core, which will be installed automatically.
Quick Comparison#
Ollama#
-
Local Inference
Run models locally on your machine without external API dependencies
-
Privacy First
All data stays on your machine. No internet required after model download
-
Free & Open Source
No API costs. Use any Ollama-compatible model
-
Full Features
Complete support for chat, streaming, tools, structured outputs, and embeddings
OpenAI (Coming Soon)#
-
Cloud-Based
Access powerful models via OpenAI's API
-
State-of-the-Art
GPT-4, GPT-3.5, and latest OpenAI models
-
Scalable
Pay-as-you-go pricing with global infrastructure
-
Fast & Reliable
Optimized inference with high availability
Azure OpenAI (Coming Soon)#
-
Enterprise Ready
OpenAI models on Microsoft Azure infrastructure
-
Compliance
Enterprise-grade security and compliance certifications
-
Private Network
Deploy within your Azure virtual network
-
Azure Integration
Seamless integration with Azure services and authentication
Adding New Providers#
Want to integrate a new LLM provider (OpenAI, Anthropic, Cohere, etc.) into Serapeum?
We've created a comprehensive guide that walks you through every step of implementing a new provider integration, from directory structure to testing and documentation.
📖 Read the Complete Provider Implementation Guide →
What You'll Learn#
- Directory Structure: How to organize your provider package
- LLM Implementation: Step-by-step guide to implementing the LLM class
- Embeddings: How to add embedding support (if applicable)
- Testing: Writing comprehensive tests with proper markers
- Documentation: Creating user-facing documentation
- Best Practices: Common pitfalls and how to avoid them
Quick Overview#
All providers follow the same pattern:
- Inherit from Core Classes:
FunctionCallingLLMfor LLMs,BaseEmbeddingfor embeddings - Implement Required Methods: Chat, completion, streaming (sync & async)
- Add to Workspace: Configure in
pyproject.toml - Write Tests: Unit tests and e2e tests with markers
- Document: README, usage examples, and docs page
Reference Implementation#
The Ollama provider serves as a complete reference showing:
- Full LLM implementation with streaming and async support
- Embedding implementation with batching
- Shared client and error handling
- Comprehensive test suite
- Complete documentation
Development Checklist#
Use this checklist when implementing a new provider:
- [ ] Inherits from
FunctionCallingLLMfor LLM - [ ] Implements
BaseEmbeddingfor embeddings (if applicable) - [ ] Supports sync, async, and streaming operations
- [ ] Includes comprehensive unit tests (≥95% coverage)
- [ ] Includes e2e tests with appropriate markers
- [ ] Has README with examples and configuration
- [ ] Has documentation page in
docs/overview/providers/ - [ ] Exports public API in
__init__.py - [ ] Added to workspace in root
pyproject.toml - [ ] Added to provider comparison table above
- [ ] Follows code style and type annotations
Get Started: Read the Full Implementation Guide →
Support#
For provider-specific issues:
- Ollama: Ollama GitHub
- Serapeum Integration: Serapeum Issues
For general framework questions, see the Contributing Guide.
Next Steps#
-
Complete guide to using the Ollama provider for local LLM inference
-
Detailed API documentation for core abstractions
-
Understand the project structure and architecture
Adding New Providers#
To add a new provider integration, see the Provider Integrations Guide for detailed instructions and the provider architecture pattern.