# ollama/ollama-python

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/ollama-ollama-python).**

9,378 stars · 922 forks · Python · mit

## Links

- GitHub: https://github.com/ollama/ollama-python
- Homepage: https://ollama.com
- awesome-repositories: https://awesome-repositories.com/repository/ollama-ollama-python.md

## Topics

`ollama` `python`

## Description

ollama-python is a Python client for interacting with large language models. It provides an interface for sending prompts to receive text and chat completions, as well as a dedicated client for generating numerical vector embeddings from text.

The project includes a wrapper that emulates the OpenAI API, allowing applications built for that standard to interact with local models. It also provides a non-blocking asynchronous client for executing concurrent requests.

The library covers the full model lifecycle, including the ability to pull, create, list, and delete models within a local environment. It handles remote endpoint connectivity via configurable host addresses and authentication headers.

## Tags

### Artificial Intelligence & ML

- [Local Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/local-model-integrations.md) — Provides a Python client for integrating locally hosted language models to generate text and chat completions.
- [OpenAI-Compatible APIs](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/model-integration-serving/model-integration-interfaces/ai-integration-apis/openai-compatible-apis.md) — Implements OpenAI-compatible API interfaces to allow local models to work with applications built for OpenAI. ([source](https://ollama.com/llms.txt#ollama))
- [Chat Completion Services](https://awesome-repositories.com/f/artificial-intelligence-ml/chat-completion-services.md) — Provides interfaces for sending prompts to receive both structured text responses and conversational chat replies. ([source](https://ollama.com/llms.txt#ollama))
- [Embedding Clients](https://awesome-repositories.com/f/artificial-intelligence-ml/embedding-clients.md) — Provides a dedicated client for generating numerical vector embeddings from text using hosted models.
- [Local Model Lifecycle Managers](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-management/local-model-lifecycle-managers.md) — Automates the lifecycle of local models, including pulling, creating, listing, and deleting instances.
- [Model Lifecycle Managers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-lifecycle-managers.md) — Implements tools for pulling, creating, listing, and deleting language models within a local environment. ([source](https://cdn.jsdelivr.net/gh/ollama/ollama-python@main/README.md))
- [Text Embedding Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/text-embedding-generators.md) — Includes a dedicated client for generating numerical vector embeddings from text for search and similarity tasks. ([source](https://cdn.jsdelivr.net/gh/ollama/ollama-python@main/README.md))
- [Vector Embeddings](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-embeddings.md) — Converts text into numerical vector representations for use in search systems or similarity-based applications.
- [LLM Stream Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-stream-processing.md) — Processes model responses piece by piece using Python generators for real-time text streaming.
- [Unified Model Catalogs](https://awesome-repositories.com/f/artificial-intelligence-ml/unified-model-catalogs.md) — Allows retrieval of a detailed catalog of installed models, including names, sizes, and version digests. ([source](https://ollama.com/api/tags))

### Development Tools & Productivity

- [LLM Clients](https://awesome-repositories.com/f/development-tools-productivity/api-client-libraries/llm-clients.md) — Provides a programmatic interface for sending prompts to large language models and receiving completions.
- [Asynchronous Clients](https://awesome-repositories.com/f/development-tools-productivity/api-client-libraries/llm-clients/asynchronous-clients.md) — Offers a non-blocking interface for executing concurrent requests to a language model server.

### Networking & Communication

- [Cloud API Emulators](https://awesome-repositories.com/f/networking-communication/api-integration-frameworks/api-management-integration/api-compatibility/protocol-compatible-backends/cloud-api-emulators.md) — Maps internal method calls to external API standards to ensure compatibility with third-party provider formats.

### Programming Languages & Runtimes

- [Asynchronous Request Execution](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/asynchronous-processing/asynchronous-request-execution.md) — Provides a non-blocking asynchronous client for executing concurrent requests to language models. ([source](https://cdn.jsdelivr.net/gh/ollama/ollama-python@main/README.md))

### Software Engineering & Architecture

- [Concurrent AI Requesting](https://awesome-repositories.com/f/software-engineering-architecture/object-pooling/task-pools/concurrent-request-pools/concurrent-ai-requesting.md) — Enables non-blocking requests to language models to handle multiple concurrent AI operations.
- [Asyncio Coroutine Execution](https://awesome-repositories.com/f/software-engineering-architecture/task-execution-engines/asyncio-coroutine-execution.md) — Uses Python's asyncio event loop to handle multiple network requests simultaneously without halting the program.

### Web Development

- [REST Clients](https://awesome-repositories.com/f/web-development/rest-clients.md) — Implements an HTTP-based REST client to communicate with the backend Ollama server.
