Menu

1 / 5

Per-Seat AI Token Caps: Hardening Docker Compose for Small Team Budget Control

DEV Community: docker·James LIN·10 days ago
#RIYquUC6
#devtodocker#devto#dev#redis#proxy
Long article (1070 words) — no AI summary yet.
Reading 0:00
15s threshold

Per-Seat Token Caps for a Small Team Using Docker Compose

At 3:17 AM, the on-call pager vibrates with a Slack alert: "Budget exhausted – monthly tokens depleted." The root cause wasn't model misconfiguration or sloppy prompts. It was a single shared API key with no per-seat ceilings, allowing one rogue process to drain the account while customer source code fragments sat in the provider's 30-day retention window. By the time the dashboard appeared at standup, the damage was irreversible.

This incident drove us to Docker Compose as the control plane for a 12-person remote agency. With only three processes on one host—proxy, Redis, and worker—we gain tight per-seat enforcement without Kubernetes complexity.

What Actually Runs

Engineers call only the proxy. It accepts OpenAI-compatible traffic, reads each seat's remaining daily and monthly token budget from Redis, applies a 1.15x estimate buffer, debits usage, and returns 429 when either cap is exhausted.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.