← Back to PortfolioInfrastructure

Ollama Rotator

TypeScriptNode.jsOllama CloudProxyPostgreSQLDashboard

QUOTA_GUARD_ACTIVE // MULTI_ACCOUNT_PROXY // OLLAMA_CLOUD

Ollama Rotator is a multi-account rotation proxy for Ollama Cloud. It spreads requests across multiple ollama-... API keys so load and quotas are shared transparently instead of burning a single account.

Each model keeps its own active account. The proxy polls /api/usage every 5 minutes, scores account health on a 0.0–1.0 composite (quota, errors, cooldowns, availability), and rotates when justified — not blindly.

What it brings

  • Per-model routing: each model maintains its own active account independently.
  • Quota-aware rotation: polls usage, rotates on quota drops or request thresholds.
  • Four routing policies: timer-first, tier-first, quota-first, hybrid.
  • Exhaustion prediction: calibrated per-model token budgets predict when quota runs out.
  • Safety features: circuit breakers, daily budgets, protective pause, account flagging.
  • Protocol adapters: native Ollama, OpenAI, Anthropic, and Responses API behind one endpoint.
  • Virtual API keys: rk-... keys with per-key model restrictions (PostgreSQL).
  • Spend logging: per-request audit with tokens, cost, and latency (PostgreSQL).
  • Prompt compression: lite and rtk modes.
  • Minimal dependencies: only 2 runtime deps (pg, tsx).

Difference compared to other rotators

Where the Antigravity rotator fights a technical quota, this one handles subscription-tier gating: free-tier accounts get HTTP 403 "this model requires a subscription" for gated models. The dashboard’s Attention Needed modal surfaces the model-to-tier matrix whenever free-tier accounts are configured, so the operator knows exactly what each key can reach.