Python Library
9.9k 2026-04-30
ollama/ollama-python
A Python library providing the easiest way to integrate Python 3.8+ projects with Ollama for local and cloud LLM interactions.
Core Features
Seamless integration with Ollama for LLM interactions.
Support for both local and cloud-hosted Ollama models.
Asynchronous and streaming API capabilities.
Comprehensive API for model management (pull, push, create, delete) and core LLM functions (chat, generate, embed).
Customizable client for advanced configurations.
Quick Start
pip install ollamaDetailed Introduction
The Ollama Python library offers a straightforward and efficient interface for Python 3.8+ developers to interact with the Ollama platform. It simplifies the process of integrating large language models (LLMs) into applications, supporting both locally run Ollama instances and cloud-based models. With features like response streaming, an asynchronous client, and a full suite of API methods for chat, generation, model management, and embeddings, it empowers developers to build robust and responsive AI-powered solutions.