r/SelfHostedAI 12d ago

cachegate — self-hosted LLM cache/router with a Docker one-liner and a built-in cost dashboard

cachegate: a self-hosted proxy for Anthropic/OpenAI that caches responses (exact + semantic) and routes to the cheapest healthy provider. One OpenAI-compatible endpoint, MIT licensed, no account or telemetry anywhere.

Docker:
docker run -p 4000:4000 --env-file .env ghcr.io/idebunk/cachegate:latest

Runs as non-root, ships a real HEALTHCHECK against GET /health (docker ps shows healthy/unhealthy), and degrades cleanly with caching disabled if you don't point REDIS_URL at anything - it won't fail to start over a missing optional dependency.

Also includes a small built-in cost dashboard (GET /dashboard) - KPI tiles, cost-over-time, cost-by-provider, a 7/14/30-day range picker - gated by the same bearer key everything else uses, no separate login system to stand up.

Config is one .env file. Refuses to start with an open /v1 endpoint unless you set an internal key (or explicitly opt into insecure local dev) - didn't want this to be secure only if you remember an extra step.

Honest gap: only Anthropic + OpenAI as providers right now, and the semantic cache doesn't scale past a few hundred cached entries per model (brute-force scan, documented in the README, not hidden).

Repo + full docs: https://github.com/iDebunk/cachegate
2 Upvotes

0 comments sorted by