Skip to main content

headroom-ollama

CI

Headroom proxy extension that serves a local Ollama under its own route, so Ollama traffic (including :cloud models) is compressed by Headroom without repointing the proxy's default OpenAI upstream.

Request under /ollama (or /p/<project>/ollama) Handling
POST /v1/chat/completions, POST /v1/responses Headroom's OpenAI handlers (compressed), upstream overridden to Ollama via x-headroom-base-url, tagged x-client: ollama → Ollama row in the dashboard's Agent Usage
everything else (/v1/models, /api/tags, /api/show, /api/pull, …) streamed straight to Ollama, uncompressed
WebSocket refused (close 1008): Headroom's Responses WebSocket ignores the upstream override and would connect to OpenAI

Ollama's native API at the proxy root (/api/*) is streamed to Ollama as well. Headroom has no /api routes, and Ollama-discovery clients probe /api/tags / /api/show on the origin, ignoring the base-URL path.

Install

Into the same environment as Headroom, then opt in (Headroom only runs extensions that are explicitly enabled). Headroom ≥ 0.36.5 refuses client-chosen upstreams on loopback/private addresses unless the operator allowlists them, so the Ollama URL goes into HEADROOM_ALLOWED_BASE_URLS; without it the extension refuses to install rather than let Headroom send Ollama prompts to the default OpenAI upstream.

uv tool install 'headroom-ai[all]>=0.36.5,<0.37' --with headroom-ollama   # or --with-editable <path>
HEADROOM_PROXY_EXTENSIONS=ollama HEADROOM_ALLOWED_BASE_URLS=http://127.0.0.1:11434 headroom proxy

HEADROOM_ALLOWED_BASE_URLS is an exclusive allowlist: once set, Headroom accepts x-headroom-base-url overrides only for the listed hosts/origins, so add any other BYOK upstreams your clients use.

Persistent deployment:

headroom install apply --profile <profile> ... \
  --env HEADROOM_PROXY_EXTENSIONS=ollama \
  --env HEADROOM_ALLOWED_BASE_URLS=http://127.0.0.1:11434

Check the route:

headroom ollama status            # probes Ollama directly and via http://127.0.0.1:8787/ollama

Configuration

Env var (proxy process) Default
HEADROOM_OLLAMA_URL http://127.0.0.1:11434
HEADROOM_OLLAMA_PREFIX /ollama

Client setup

Point the client's OpenAI-compatible Ollama base URL at the proxy route, e.g. Oh My Pi ~/.omp/agent/models.yml (omp calls {baseUrl}/responses, hence the /v1):

providers:
  ollama:
    baseUrl: http://127.0.0.1:8787/p/workspace/ollama/v1   # or http://127.0.0.1:8787/ollama/v1
    api: openai-responses
    auth: none
    discovery:
      type: ollama

Limits

  • Pinned to headroom-ai 0.36.x (≥ 0.36.5): the extension depends on Headroom internals (x-headroom-base-url, x-client classification, upstream_guard) beyond the stable install(app, config) hook. tests/test_headroom_contract.py checks them against the installed Headroom; CI reruns it weekly against the newest allowed patch release.
  • Dashboard USD figures for Ollama models come from Headroom's LiteLLM pricing lookup, which does not know Ollama models; they are not real costs.

Development

uv sync --group dev
uv run pytest

Metadata

Release files for headroom-ollama 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for headroom-ollama 0.1.0
File Size Uploaded Provenance
headroom_ollama-0.1.0.tar.gz 311.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for headroom-ollama 0.1.0
File Interpreter ABI Platform
headroom_ollama-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 319.4 kB

Release files / headroom_ollama-0.1.0.tar.gz

Download URL headroom_ollama-0.1.0.tar.gz
Size 311.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9569408556a665790773f3620053723ea8c62392908e0967a9a83a53811dd03e
BLAKE2b-256 checksum
How to use checksums
f2cba1c0da617935fe021005327b49c7544f61276e1b5c99776b265b6aa73226
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / headroom_ollama-0.1.0-py3-none-any.whl

Download URL headroom_ollama-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2107a7beb5c5978ea91e99c824ff32d9d4cfd801e70604b7bf9a9a57a28acbf5
BLAKE2b-256 checksum
How to use checksums
bedef84c608f8956010785aed65971bd0e4004b7bc690c7c8e55fe71f50e6bbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for headroom-ollama 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for headroom_ollama-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page