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 providers
30+free models
10providers pooled
5complexity lanes
$0infra & models

How 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.

๐Ÿ‘ฉโ€๐Ÿ’ป Claude Code ANTHROPIC_BASE_URL ๐Ÿงญ KOMPASS โšก heuristics (0 ms) tinyโ†’FAST ยท hugeโ†’LONGCTX ๐Ÿง  classifier verdict {"lane":"AGENTIC",0.91} ๐Ÿงฎ quota ledger + health skip exhausted ยท cooldowns FAST SIMPLE AGENTIC HARD LONGCTX Google AI Studio gemini-flash-lite ยท 3.6-flash OpenRouter :free laguna-s-2.1 ยท laguna-xs NVIDIA Build glm-5.2 ยท deepseek-v4 ยท minimax โ€ฆany OpenAI-compatible 4 lines of YAML to add

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.

๐Ÿงฉ OpenRouter ๐ŸŸข NVIDIA ๐Ÿ”ท Google โšก Groq ๐ŸŒฌ๏ธ Mistral ๐Ÿ™ GitHub Models โ˜๏ธ Cloudflare AI ๐Ÿง  SambaNova โœจ Cohere ๐Ÿค— Hugging Face
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:

โœ… model that actually answered ๐ŸŽฏ classifier lane + confidence ๐Ÿ“Š tokens in/out per request ๐Ÿ“ˆ live success-rate per model โณ remaining quota + cooldowns โ˜๏ธ Worker/KV/DO free-plan headroom

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.

Deploy to Cloudflare Clones the repo into your GitHub or GitLab account, then creates the KV namespace and Durable Object and deploys โ€” all in the browser. Would rather not connect a git account? Use the CLI path below.
Step 1 โ€” generate your two secrets. Created in this browser with crypto.getRandomValues and never sent anywhere. Cloudflare cannot accept them through the deploy link โ€” a secret in a URL ends up in browser history, referrer headers and server logs โ€” so you paste them into Cloudflare's own prompt in step 2.
Save them somewhere before you deploy. Losing the bearer means redeploying; losing the master key only means re-entering provider keys.

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).

1
Make a directory for your gateway (your config lives here; the gateway itself installs from npm โ€” or git clone https://github.com/vinoth4v/kompass && pnpm install if you'd rather work from source)
mkdir my-kompass && cd my-kompass
2
Create a Cloudflare API token (dash.cloudflare.com โ†’ My Profile โ†’ API Tokens โ†’ "Edit Cloudflare Workers" template, plus KV Storage:Edit)
export CLOUDFLARE_API_TOKEN=your-token-here
3
Run the wizard โ€” asks for your provider keys, provisions KV + your workers.dev URL, deploys, verifies end-to-end, and installs the claude-free command in your shell:
npx kompass-gateway init
4
Code for free
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.

๐Ÿ”’ Everything stays in your browser. This is a static page with no backend โ€” keys are kept in your browser's localStorage only so you can revisit, and are never sent anywhere.
Pick any free name; the wizard (or Cloudflare dashboard) registers it.
The password protecting your Worker.

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.

โŒ˜
Codex CLI โ€” add a provider in ~/.codex/config.toml
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"
โ–ฎ
Cursor โ€” Settings โ†’ Models โ†’ API Keys: paste your bearer as the OpenAI API key, enable "Override OpenAI Base URL", then add kompass as a custom model name
Override OpenAI Base URL:  https://kompass.<you>.workers.dev/v1
OpenAI API Key:            <your bearer token>
Custom model:              kompass
โœฆ
VS Code โ€” VS Code has no built-in AI backend; install a free extension first, then point it at Kompass. Step-by-step for all four options: VS Code setup guide โ†’
  1. Extensions panel (โ‡งโŒ˜X) โ†’ install Cline, Roo Code, or Kilo Code
  2. 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 โ†’

$
Aider โ€” two env vars and go
export OPENAI_API_BASE=https://kompass.<you>.workers.dev/v1
export OPENAI_API_KEY=<your bearer token>
aider --model openai/kompass
{}
Your own code (direct API) โ€” drop-in for the Anthropic or OpenAI SDK; auth via Authorization: Bearer or x-api-key, both accepted. Full SDK + curl examples: Direct API docs โ†’
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" }] });
โ—†
No editor? Use Kompass AI โ€” a hosted chat app for your gateway, no install required. Log in with the same bearer token, then chat (markdown + code rendering, vision), generate images, or run multi-step web research โ€” every reply shows which free model actually served it. Runs entirely client-side against your own Worker; nothing is stored on our servers. Open Kompass AI โ†’
โ€ฆ
Anything else that speaks OpenAI โ€” point the base URL at /v1, use the bearer as the key. The gateway also answers GET /v1/models for client pickers, and streaming + tool calling work in all three dialects. Full per-tool walkthroughs, API and CLI reference: Documentation โ†’

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.