A self-hosted auth gateway for Ollama adds keys, quotas and routing
Regular-Forever5876 · reddit · 2026-07-20
The author built ollama-gateway, a self-hosted gateway in front of one or more Ollama servers to add real authentication and access control.
Key features:
- Per-client API keys with hashing, one-time display, revocation, and IP/CIDR restriction.
- Quotas and limits: monthly token caps, rate limiting, and cost-capped lifetime trials.
- Multi-upstream routing: map each key to a local or remote server, with automatic failover.
- Allowlists for models and APIs across native Ollama, OpenAI-compatible, and Anthropic endpoints.
- Logging and monitoring: per-request logs, usage charts, model breakdowns, and request-content inspection.
- Deployment/security: LAN-only admin panel, Caddy TLS, Dockerized setup, encrypted remote tokens, and a pre-deploy security sweep.
The project is source-available rather than OSI open source, with a 1B-token/month commercial threshold.
Related event: Self-hosted Gateway Adds Auth and Quotas for Ollama(2 posts)→
More from coding & agent
- Two real 'company brains' opened up live: Gorgias' in-house Cortex vs Slite — femke_plantinga · 2026-09-11
- The browser main thread is expensive: a practical guide to JavaScript and CSS animation cost — jh3yy · 2026-09-11
- Inspired by OpenAI's 10,000-agent run, dev open-sources a crowdsourced agent problem-solving platform — Benjaminsen · 2026-09-11
- Lucid: open-source Mac app keeps your laptop awake only while AI agents run — Pitiful_Hedgehog_600 · 2026-09-11
- banteg's snail project crowdsources AI agents to finish matching Snail Mail's 20 remaining functions — banteg · 2026-09-11
- Alex Townsend posts 200 open problems in numerical linear algebra for humans and AI agents — IgorCarron · 2026-09-11