{"repo":"ollama/ollama-python","free":true,"listed":false,"github":"https://github.com/ollama/ollama-python","clone":"git clone https://github.com/ollama/ollama-python.git","description":"Ollama Python library","language":"Python","stars":10420,"topics":["ollama","python"],"license":"MIT","category":"dev-tools","readme_excerpt":"Ollama Python Library The Ollama Python library provides the easiest way to integrate Python 3.8+ projects with Ollama. Prerequisites - Ollama should be installed and running - Pull a model to use with the library: ollama pull e.g. ollama pull gemma3 - See Ollama.com for more information on the models available. Install Usage See types.py for more information on the response types. Streaming responses Response streaming can be enabled by setting stream=True . Cloud Models Run larger models by offloading to Ollama’s cloud while keeping your local workflow. - Supported models: deepseek-v3.1:671b-cloud , gpt-oss:20b-cloud , gpt-oss:120b-cloud , kimi-k2:1t-cloud , qwen3-coder:480b-cloud , kimi-k2-thinking See Ollama Models - Cloud for more information Run via local Ollama 1) Sign in (one-time): 2) Pull a cloud model: 3) Make a request: Cloud API (ollama.com) Access cloud models directly by pointing the client at https://ollama.com . 1) Create an API key from ollama.com , then set: 2) (Optional) List models available via the API: 3) Generate a response via the cloud API: Custom client A custom client can be created by instantiating Client or AsyncClient from ollama . All extra keyword arguments are passed into the httpx.Client . Async client The AsyncClient class is used to make asynchronous requests. It can be configured with the same fields as the Client class. Setting stream=True modifies functions to return a Python asynchronous generator: API The Ollama Python library's API i","default_branch":null,"files":null,"tree":[],"storefront":"/r/ollama","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ollama/ollama-python/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}