Official Libraries
Official SDKs maintained by the Ollama team provide the best integration experience.Python
ollama-python
Official Python library with async support
- Synchronous and async APIs
- Streaming support
- Type hints and IDE autocompletion
- Complete API coverage (chat, generate, embeddings, etc.)
GitHub
Source code and documentation
PyPI
Package on PyPI
JavaScript
ollama-js
Official JavaScript/TypeScript library for Node and browsers
- Works in Node.js and browsers
- TypeScript support with full type definitions
- Promise-based async API
- Streaming support
- Complete API coverage
GitHub
Source code and documentation
npm
Package on npm
Community Libraries
The Ollama community has built SDKs for many other languages and frameworks..NET / C#
OllamaSharp
.NET SDK for Ollama
LangChain for .NET
.NET LangChain with Ollama support (example)
LlmTornado
Unified C# interface for multiple LLM APIs
Rust
ollama-rs
Rust SDK for Ollama
LangChainRust
Rust LangChain (example)
Ruby
ruby_llm
Ruby library for LLMs including Ollama
Java
Ollama4j
Java SDK for Ollama
LangChain4j
Java LangChain (example)
Agents-Flex
Java agent framework (example)
Go
PHP
LLPhant
PHP AI framework with Ollama support
R
rollama
R SDK for Ollama
Julia
PromptingTools.jl
Julia LLM toolkit (example)
Swift
Ollama for Swift
Swift SDK for Ollama
C++
Ollama-hpp
C++ SDK for Ollama
Dart
LangChainDart
Dart LangChain with Ollama support
Elixir
Elixir LangChain
Elixir LangChain with Ollama support
Frameworks
Popular AI frameworks with Ollama integration.LangChain
LangChain Python
Python LangChain integration
LangChain.js
JavaScript LangChain (example)
LlamaIndex
LlamaIndex Python
Python data framework for LLMs
LlamaIndexTS
TypeScript LlamaIndex
Other Frameworks
Semantic Kernel
Microsoft’s AI orchestration SDK
Spring AI
Spring framework AI support (docs)
LiteLLM
Unified API for 100+ LLM providers
Haystack
AI pipeline framework
Firebase Genkit
Google’s AI framework
Portkey
AI gateway with Ollama support
any-llm
Unified LLM interface by Mozilla
REST API
If there’s no SDK for your language, you can use the REST API directly.Example: Chat Endpoint
Example: Generate Endpoint
Example: Embeddings
OpenAI Compatibility
Ollama provides OpenAI-compatible APIs, so you can use existing OpenAI SDKs:OpenAI API
OpenAI-compatible endpoints
Anthropic API
Anthropic-compatible endpoints
Testing Libraries
Testcontainers
Container-based testing for Ollama
Building Your Own SDK
If you’re building a new Ollama SDK:Study the REST API
Read the API documentation
Check existing SDKs
Review ollama-python and ollama-js for patterns
Submit to community
Open a PR to add your SDK to the Ollama README
Learn More
REST API Reference
Complete API documentation
Python Examples
Official Python examples
JavaScript Examples
Official JavaScript examples
Community Integrations
Full list of community projects