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
- Nitro Modules v1 gets Node.js support: one native module codebase for iOS and macOS — Birchlabs · 2026-10-27
- Google Graph Mining Team Builds Trillion-Edge FarAway with Gemini 4 Argon Agents in 5 Hours — rseroter · 2026-10-27
- Four Gemini agents beat Minecraft autonomously in 27 hours, writing 2,783 programs — rohanpaul_ai · 2026-10-27
- Planning a Master-Agent Architecture: LangGraph vs Microsoft Agent Framework — DonXendon · 2026-10-27
- Vibe-coding a better Matter smart home setup in 10 minutes after iPhone Home app timeouts — blixt · 2026-10-27
- Score centering lands in TRL: default-on for async GRPO, stabilizes RL under mismatch — _lewtun · 2026-10-27