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

License

MIT, see LICENSE.

Metadata

Release files for headroom-ollama 0.1.1

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.1
File Size Uploaded Provenance
headroom_ollama-0.1.1.tar.gz 312.7 kB With provenance Details

Built distribution (wheel)

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

Total release size: 321.2 kB

Release files / headroom_ollama-0.1.1.tar.gz

Download URL headroom_ollama-0.1.1.tar.gz
Size 312.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e1e14918f399722cf3c23673e7336db67316844e807035fe2f919c92faafef95
BLAKE2b-256 checksum
How to use checksums
b8b0d9b43b709f4bd05d3bfe746286cf0b2bb2481c8be442da1ba9a8b6bb89c7
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.1-py3-none-any.whl

Download URL headroom_ollama-0.1.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed1cad39b979f01db5826aa86249d9c87cf727ac13389ee65742efaeb2b98a84
BLAKE2b-256 checksum
How to use checksums
90866c84c3c165d2250156c6dcd1e3431ee6c991a11b701f83a3e557b23d3eec
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.1

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.1.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.1 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