Kompass
Stop losing momentum when your AI coding limits hit โ on any tool. One Cloudflare Worker routes Claude Code, Codex, Cursor, Cline & more across free model providers by task complexity โ $0 infra, $0 models, and your API keys never leave your machines.
live on the free tier โ 30+ models, 10 providersHow it works
The 30-millisecond journey of a request
Claude Code speaks its normal Anthropic protocol. Kompass classifies each turn, checks the shared quota ledger, and forwards to the best free model that's healthy โ translating streaming and tool calls both ways so Claude Code never notices.
The roster
30+ free models, picked by what the task needs
Live from config/lanes.yaml โ edit the YAML, kompass config push,
done. No redeploy.
| Lane | Serves | Capability | Top of chain |
|---|---|---|---|
| FAST | quick lookups, renames, one-liners | 7-deep, quality-pinned | gemini-3.5-flash-lite โ llama-3.1-8b-instant (groq) โ mistral-small โ step-3.7-flash (nvidia) |
| SIMPLE | single-file edits, docstrings | 11-deep, spread top 2 | laguna-xs-2.1 โ codestral (mistral) โ nemotron-49b (nvidia) โ mistral-small-4 (nvidia) |
| AGENTIC | multi-step tool work (default) | 10-deep, spread top 2 | laguna-s-2.1 โ minimax-m3 (nvidia) โ laguna-m.1 โ devstral-medium (mistral) |
| HARD | deep debugging, architecture | ๐ง frontier | gpt-4.1 (github) โ deepseek-v4-pro (nvidia) โ deepseek-v3.2 (sambanova) โ minimax-m3 |
| LONGCTX | >60k-token contexts | ๐ 1M ctx | gemini-3.6-flash (1M) โ nemotron-3-ultra-550b (nvidia, 1M) โ minimax-m3 |
๐ vision every lane's chain includes a Google entry, which reads images/PDFs natively โ so image/PDF requests are handled no matter which lane the classifier picks. SIMPLE and HARD additionally carry a second, non-Google vision model as backup, so a Google outage or exhausted quota doesn't stop image requests in those two lanes.
| Beyond chat | Serves | Chain |
|---|---|---|
| IMAGES | image generation | flux-1-schnell (cfai) โ sdxl-lightning (cfai) |
| EMBEDDINGS | vector search / RAG | bge-m3 (cfai) โ gemini-embedding-001 (google) |
"Spread" lanes pick their first attempt by weighted-random among the top candidates
(weighted by live success rate) instead of always #1, so load spreads across comparable
models instead of hammering one RPM ceiling. Every chain is a live fallback: a dead model
gets a 10-minute cooldown and the next one in line answers instead. Paid models are
unreachable unless you explicitly set allow_paid: true (enforced in code) โ see
the full, always-current roster in
config/lanes.yaml.
Why it doesn't fall over
Built for the messy reality of free tiers
One quota ledger, every machine
A Durable Object tracks each provider's RPM/RPD. Your laptop and desktop draw from the same counters โ exhausted providers are skipped up-front with zero 429s.
Survives outages, mid-stream
Ordered fallback on 429/5xx/timeout, 10-minute health cooldowns, and failover before the first byte. A flaky provider costs seconds โ not your session.
Complexity-aware, instantly
Heuristics short-circuit most turns at 0ms; the rest get a strict-JSON verdict from a dedicated classifier with its own budget โ and its own fallback chain (Gemini โ Groq โ Mistral), so routing never goes blind. Trivial tasks never burn heavyweight quota.
Your keys, your Worker
Deploys under your Cloudflare account, gated by your bearer token. Keys live as Worker secrets. A privacy guard keeps secret-looking content away from providers that train on inputs.
Not the only option
Why not just use OpenRouter, LiteLLM, or claude-code-router?
The free-tier-stacking space got crowded fast โ hosted aggregators, self-hosted proxies, static routers, local gateways. Most of them are good at one thing. Kompass is the one that's always on, shared across every machine, and routes by what the task actually needs โ not just whichever key answers first.
| Tool | Good at | Where Kompass differs |
|---|---|---|
| OpenRouter :free / auto | one key, huge model catalog, availability-based switching | pools OpenRouter alongside NVIDIA, Google, Groq, Mistral, GitHub Models & more โ one dead provider doesn't stall your whole day |
| claude-code-router | static rules, fallback chains, custom-router hook | a semantic classifier picks the lane by task complexity, not fixed rules โ and it isn't Claude-Code-only: same routing for Codex, Cursor, Cline, Aider |
| LiteLLM proxy | 100+ provider adapters, budgets, full self-hosted control | nothing to run or patch โ a Cloudflare Worker on the free tier is the server, always on, with free-tier quota pooling built in from day one |
| Local free-stacking proxies (9Router, etc.) | stack many free tiers behind one local endpoint | lives at the edge, not on your laptop โ a Durable Object ledger is shared by every machine you code from, so quota tracking survives closing the lid |
Kompass isn't chasing the biggest catalog or the most config knobs โ it's the thin layer that gets out of the way: deploy once to your own Cloudflare account, point whatever editor you use at it, and keep coding on free capacity no matter which machine or tool you're in.
Full visibility
Know exactly what served every turn
Claude Code always shows "kompass-free-model-1.0" โ that's just the requested alias.
/status.html (or kompass status) shows the truth, live, refreshed
every 15s:
The failed row is the system working: the timeout put that model in a 10-minute cooldown and the next model in the chain served the request โ the session never noticed.
Get started
Deploy it in two clicks
Nothing to install. You need two free accounts โ Cloudflare and GitHub (or GitLab), because Cloudflare's deploy button works by cloning this repo into your own git account. No AI provider signup though: the gateway answers from Workers AI on your own account from the moment it deploys. Add OpenRouter, NVIDIA or Google later, when you actually want more capacity.
Prefer the command line?
Install from source
The CLI path is unchanged and is what contributors use. Prereqs: Node 20+, pnpm, a free Cloudflare account, and at least one free provider key (OpenRouter, NVIDIA Build, Google AI Studio, Groq).
mkdir my-kompass && cd my-kompass
export CLOUDFLARE_API_TOKEN=your-token-here
claude-free command in your shell:
npx kompass-gateway init
source ~/.zshrc
claude-free # Claude Code, now riding free models through your Worker
No wizard? No problem
Setup Builder
Prefer copy-paste, or setting up a second machine? Fill this in and the page generates your personalized files and commands.
secrets/.secrets.json (place in the cloned repo; it's gitignored)
Shell function (โ ~/.zshrc or ~/.bashrc)
Deploy commands (from the repo root, wizard-free path)
Your links
One gateway, every editor
Works with every coding tool you use
Kompass speaks three API dialects from one URL: the Anthropic Messages API (/v1/messages โ Claude Code), the OpenAI Chat Completions API (/v1/chat/completions โ Cursor, Cline, Roo Code, Continue, Aider, and virtually every OpenAI-compatible client), and the OpenAI Responses API (/v1/responses โ Codex CLI). Same lanes, same fallback chains, same quota ledger for all of them. Your bearer token is the API key everywhere. Model name kompass = auto-routing by task complexity; kompass-fast / -simple / -agentic / -hard / -longctx pin a lane.
model = "kompass"
model_provider = "kompass"
[model_providers.kompass]
name = "Kompass"
base_url = "https://kompass.<you>.workers.dev/v1"
env_key = "KOMPASS_API_KEY" # export KOMPASS_API_KEY=<your bearer>
wire_api = "responses"
Override OpenAI Base URL: https://kompass.<you>.workers.dev/v1
OpenAI API Key: <your bearer token>
Custom model: kompass
- Extensions panel (โงโX) โ install Cline, Roo Code, or Kilo Code
- Open its settings โ API Provider: OpenAI Compatible
API Provider: OpenAI Compatible
Base URL: https://kompass.<you>.workers.dev/v1
API Key: <your bearer token>
Model ID: kompass
Prefer Continue instead (VS Code or JetBrains)? Same values, one models: block in ~/.continue/config.yaml โ Continue setup โ
export OPENAI_API_BASE=https://kompass.<you>.workers.dev/v1
export OPENAI_API_KEY=<your bearer token>
aider --model openai/kompass
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://kompass.<you>.workers.dev",
authToken: process.env.KOMPASS_BEARER,
});
await client.messages.create({ model: "kompass", max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }] });
Daily driver
Day to day
kompass status # lanes, remaining quota per provider, last 50 routes
kompass config push # hot-reload config/*.yaml โ models change with NO redeploy
kompass logs # live tail of your Worker
kompass bench # run your own 10-task suite across lanes
https://kompass.<you>.workers.dev/status.html # live dashboard in the browser
Add a brand-new free model the day it drops โ one YAML line, then
kompass config push:
AGENTIC:
- openrouter/poolside/laguna-s-2.1:free
- nvidia/z-ai/glm-5.2 # โ your addition
Questions
FAQ
Is this really $0?
Yes for the infrastructure and the models: Cloudflare Workers/KV/Durable Objects free tier
comfortably fits a heavy coding day, and every default lane model is a free-tier endpoint.
Paid models are blocked in code unless you opt in with allow_paid: true.
Where do my prompts and keys go?
Prompts transit your own Cloudflare Worker (only you hold the bearer token) and go to whichever free provider serves the lane. Keys are Cloudflare Worker secrets under your account. Note: free endpoints may train on inputs โ Kompass flags those providers and its privacy guard keeps requests matching your secret/path patterns away from them. Don't point truly sensitive repos at free endpoints.
Can I use it outside Claude Code โ Cursor, Codex, Cline, Aider?
Yes. The same Worker exposes the Anthropic Messages API for Claude Code, OpenAI Chat Completions for Cursor/Cline/Roo Code/Continue/Aider and any OpenAI-compatible client, and the OpenAI Responses API for Codex CLI. See the "Works with every coding tool" section above for copy-paste setup per tool. All dialects share the same lanes, fallback chains and quota ledger โ so your daily free budget is one pool no matter which editor you're in.
Does streaming and tool-calling really work?
Yes โ the Worker translates the full Anthropic wire protocol both directions (SSE streaming, tool_use/tool_result round-trips, thinking blocks) for both OpenAI-format and Gemini-format providers. It's exercised by 46 tests and a live smoke harness on every release.
What happens when a provider dies mid-session?
Failures before the first byte fall through the chain to the next model; the failing model gets a 10-minute cooldown; your session's context is preserved because Kompass speaks to Claude Code in Anthropic format the whole time.
Does this touch my Claude subscription?
No. Kompass never proxies Anthropic subscription auth (their terms prohibit it). It's a
separate command โ claude-free โ you use when you want to preserve or have
exhausted your Pro/Max quota. Your normal claude stays untouched.
Can I self-host without Cloudflare?
The state layer is a pluggable interface; a self-hosted SQLite target is on the roadmap.
Today the same codebase also runs locally via wrangler dev.
A better version of a model I'm using just came out โ now what?
kompass deprecate old/model --replaced-by new/model --note "why" adds one
declarative entry to lanes.yaml. Every future config push
automatically rewrites every lane and the dispatcher that referenced the old model to the
new one โ so it can never accidentally go live again, even if it's still listed somewhere,
and you never hand-edit multiple lanes to retire something.