Skip to main content

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 ollama CLI 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, default 0.2)
    • OLLAMA_SERVE_RETRIES (default 1)
    • OLLAMA_SERVE_RETRY_DELAY (seconds, default 0.2)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ollama_serve-0.0.1.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ollama_serve-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for ollama_serve-0.0.1.tar.gz
Algorithm Hash digest
SHA256 789266e7cc41cef0833e63eb50785d932b6f42579c175e238f01c0f3769bc762
MD5 3522d7debaf06292800a77686c5de754
BLAKE2b-256 caa0311ba21d5fd4fc36f9506702c736c1ad5afe81a034d665b746bbe6740f60

See more details on using hashes here.

Provenance

The following attestation bundles were made for ollama_serve-0.0.1.tar.gz:

Publisher: publish-pypi.yml on d33bs/ollama-serve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ollama_serve-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5411dc11f97dbf0f9e6cf58c33c051c0134e3c89686ccf07866e219b151765b0
MD5 fdabbde4b03f425656c3412375e637a7
BLAKE2b-256 d6cf3adfcba92556f04fe3bb8100a9cbc65e3aaebda0aa7c5fea618f702b02cc

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page