├── .github ├── dependabot.yml └── workflows │ ├── publish.yaml │ └── test.yaml ├── .gitignore ├── LICENSE ├── README.md ├── SECURITY.md ├── examples ├── README.md ├── async-chat.py ├── async-generate.py ├── async-structured-outputs.py ├── async-tools.py ├── chat-logprobs.py ├── chat-stream.py ├── chat-with-history.py ├── chat.py ├── create.py ├── embed.py ├── fill-in-middle.py ├── generate-logprobs.py ├── generate-stream.py ├── generate.py ├── gpt-oss-tools-stream.py ├── gpt-oss-tools.py ├── list.py ├── multi-tool.py ├── multimodal-chat.py ├── multimodal-generate.py ├── ps.py ├── pull.py ├── show.py ├── structured-outputs-image.py ├── structured-outputs.py ├── thinking-generate.py ├── thinking-levels.py ├── thinking.py ├── tools.py ├── web-search-gpt-oss.py ├── web-search-mcp.py ├── web-search.py └── web_search_gpt_oss_helper.py ├── ollama ├── __init__.py ├── _client.py ├── _types.py ├── _utils.py └── py.typed ├── pyproject.toml ├── requirements.txt ├── tests ├── test_client.py ├── test_type_serialization.py └── test_utils.py └── uv.lock /.github/dependabot.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/.github/dependabot.yml -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/.github/workflows/publish.yaml -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/.github/workflows/test.yaml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/README.md -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/SECURITY.md -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/README.md -------------------------------------------------------------------------------- /examples/async-chat.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/async-chat.py -------------------------------------------------------------------------------- /examples/async-generate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/async-generate.py -------------------------------------------------------------------------------- /examples/async-structured-outputs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/async-structured-outputs.py -------------------------------------------------------------------------------- /examples/async-tools.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/async-tools.py -------------------------------------------------------------------------------- /examples/chat-logprobs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/chat-logprobs.py -------------------------------------------------------------------------------- /examples/chat-stream.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/chat-stream.py -------------------------------------------------------------------------------- /examples/chat-with-history.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/chat-with-history.py -------------------------------------------------------------------------------- /examples/chat.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/chat.py -------------------------------------------------------------------------------- /examples/create.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/create.py -------------------------------------------------------------------------------- /examples/embed.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/embed.py -------------------------------------------------------------------------------- /examples/fill-in-middle.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/fill-in-middle.py -------------------------------------------------------------------------------- /examples/generate-logprobs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/generate-logprobs.py -------------------------------------------------------------------------------- /examples/generate-stream.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/generate-stream.py -------------------------------------------------------------------------------- /examples/generate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/generate.py -------------------------------------------------------------------------------- /examples/gpt-oss-tools-stream.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/gpt-oss-tools-stream.py -------------------------------------------------------------------------------- /examples/gpt-oss-tools.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/gpt-oss-tools.py -------------------------------------------------------------------------------- /examples/list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/list.py -------------------------------------------------------------------------------- /examples/multi-tool.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/multi-tool.py -------------------------------------------------------------------------------- /examples/multimodal-chat.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/multimodal-chat.py -------------------------------------------------------------------------------- /examples/multimodal-generate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/multimodal-generate.py -------------------------------------------------------------------------------- /examples/ps.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/ps.py -------------------------------------------------------------------------------- /examples/pull.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/pull.py -------------------------------------------------------------------------------- /examples/show.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/show.py -------------------------------------------------------------------------------- /examples/structured-outputs-image.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/structured-outputs-image.py -------------------------------------------------------------------------------- /examples/structured-outputs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/structured-outputs.py -------------------------------------------------------------------------------- /examples/thinking-generate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/thinking-generate.py -------------------------------------------------------------------------------- /examples/thinking-levels.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/thinking-levels.py -------------------------------------------------------------------------------- /examples/thinking.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/thinking.py -------------------------------------------------------------------------------- /examples/tools.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/tools.py -------------------------------------------------------------------------------- /examples/web-search-gpt-oss.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/web-search-gpt-oss.py -------------------------------------------------------------------------------- /examples/web-search-mcp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/web-search-mcp.py -------------------------------------------------------------------------------- /examples/web-search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/web-search.py -------------------------------------------------------------------------------- /examples/web_search_gpt_oss_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/examples/web_search_gpt_oss_helper.py -------------------------------------------------------------------------------- /ollama/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/ollama/__init__.py -------------------------------------------------------------------------------- /ollama/_client.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/ollama/_client.py -------------------------------------------------------------------------------- /ollama/_types.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/ollama/_types.py -------------------------------------------------------------------------------- /ollama/_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/ollama/_utils.py -------------------------------------------------------------------------------- /ollama/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/pyproject.toml -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/requirements.txt -------------------------------------------------------------------------------- /tests/test_client.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/tests/test_client.py -------------------------------------------------------------------------------- /tests/test_type_serialization.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/tests/test_type_serialization.py -------------------------------------------------------------------------------- /tests/test_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/tests/test_utils.py -------------------------------------------------------------------------------- /uv.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ollama/ollama-python/HEAD/uv.lock --------------------------------------------------------------------------------