A Python package that ensures the Ollama server is running and ready with the models your project expects.
Project description
ollama-serve
Keep your local Ollama server warm and your favorite models ready. This package offers small, composable helpers to check server health, start it when needed, and pull models on demand.
Install
uv add ollama-serve
Quick start
from ollama_serve import ensure_model_and_server_ready
if ensure_model_and_server_ready("llama3:latest"):
print("Ready to chat.")
Common flows
from ollama_serve import (
is_ollama_running,
run_ollama_server,
is_model_installed,
install_model,
)
is_ollama_running()
run_ollama_server()
is_model_installed("llama3:latest")
install_model("llama3:latest")
Tips
- If Ollama is not on your PATH, install it from https://ollama.com/download.
- Use smaller timeout values for snappier "is it up?" checks in dev loops.
Compatibility
- macOS, Linux, and Windows (where Ollama runs locally).
- Requires the
ollamaCLI on your PATH.
Logging and config
- Uses standard Python logging via
logging.getLogger("ollama_serve"). - Default settings can be overridden with env vars:
OLLAMA_SERVE_TIMEOUT(seconds, default0.2)OLLAMA_SERVE_RETRIES(default1)OLLAMA_SERVE_RETRY_DELAY(seconds, default0.2)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ollama_serve-0.0.1.tar.gz.
File metadata
- Download URL: ollama_serve-0.0.1.tar.gz
- Upload date:
- Size: 88.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
789266e7cc41cef0833e63eb50785d932b6f42579c175e238f01c0f3769bc762
|
|
| MD5 |
3522d7debaf06292800a77686c5de754
|
|
| BLAKE2b-256 |
caa0311ba21d5fd4fc36f9506702c736c1ad5afe81a034d665b746bbe6740f60
|
Provenance
The following attestation bundles were made for ollama_serve-0.0.1.tar.gz:
Publisher:
publish-pypi.yml on d33bs/ollama-serve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ollama_serve-0.0.1.tar.gz -
Subject digest:
789266e7cc41cef0833e63eb50785d932b6f42579c175e238f01c0f3769bc762 - Sigstore transparency entry: 835908277
- Sigstore integration time:
-
Permalink:
d33bs/ollama-serve@75e13386e3347b59e67f9326e8d72b54e90b9682 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/d33bs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@75e13386e3347b59e67f9326e8d72b54e90b9682 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ollama_serve-0.0.1-py3-none-any.whl.
File metadata
- Download URL: ollama_serve-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5411dc11f97dbf0f9e6cf58c33c051c0134e3c89686ccf07866e219b151765b0
|
|
| MD5 |
fdabbde4b03f425656c3412375e637a7
|
|
| BLAKE2b-256 |
d6cf3adfcba92556f04fe3bb8100a9cbc65e3aaebda0aa7c5fea618f702b02cc
|
Provenance
The following attestation bundles were made for ollama_serve-0.0.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on d33bs/ollama-serve
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ollama_serve-0.0.1-py3-none-any.whl -
Subject digest:
5411dc11f97dbf0f9e6cf58c33c051c0134e3c89686ccf07866e219b151765b0 - Sigstore transparency entry: 835908310
- Sigstore integration time:
-
Permalink:
d33bs/ollama-serve@75e13386e3347b59e67f9326e8d72b54e90b9682 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/d33bs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@75e13386e3347b59e67f9326e8d72b54e90b9682 -
Trigger Event:
release
-
Statement type: