one router · every AI tool

Keep your tools. Cut the bill.

hibrid slides underneath Claude Code, Gemini CLI, aider and Copilot and quietly sends each call to the cheapest model that can do the job — Opus when it matters, Haiku when it's plenty, a model on your own machine for everything in between. Your tools don't change. Your token bill does.

bash
# one local-first router, OpenAI- and Anthropic-compatible
pip install git+https://github.com/vfalbor/hibrid.git
hibrid serve
curl localhost:8095/v1/node   # what it knows about your machine

Drop it under the tools you already use

hibrid speaks both the OpenAI and the Anthropic dialect. Point a tool's base URL at it and nothing else in your setup moves — it just starts spending less.

Claude Code Anthropic API

export ANTHROPIC_BASE_URL=\
  https://hibrid.tokenstree.eu
claude

aider · Copilot-style OpenAI API

export OPENAI_BASE_URL=\
  https://hibrid.tokenstree.eu/v1
aider

Gemini CLI & others OpenAI mode

any tool with an
OpenAI-compatible mode
points here too

This node, live

The instance serving this page profiled its own hardware and benchmarked its models on boot. Measured numbers, not a brochure.

Machine class
Max local model
Local models
Measured speed
Strong backends

How it decides

Three moves, all automatic. A tool can declare the task type; if it doesn't, hibrid reads it. Every response tells you where it actually ran.

1

It measures your machine

Detects RAM, VRAM and chip, then micro-benchmarks the real tokens/sec of your local models. It doesn't guess from a spec sheet — it times your hardware.

2

It keeps loops local

A refine-and-retest loop is hundreds of cheap calls. hibrid runs them on a local model and spends a strong call only on the one final check that earns it.

3

No API keys

For anything beyond the local model, hibrid delegates to an agent you're already signed into — claude -p, codex, opencode, copilot, a skills service, or your harness session — and uses whichever is fastest. Your subscription, not a pay-per-token key.

4

It guards your data

Spot an email, a key, an ID, and the request is pinned to local — a rule, not a checkbox. Your text never reaches a third party.

See for yourself — and the model behind each call

Real measured runs (15 tasks, blind-judged 0–1). Without hibrid, every task goes to a paid frontier model. hibrid runs the easy ones on a small local model (free) and escalates the hard ones to the paid model — so you keep almost all the quality for a fraction of the bill.

92.9%
of paid-model quality kept
(hibrid routed vs all-paid, blind judge)
86.8%
of paid quality on everyday tasks — for free, on a 3B local model
−11.4%
paid tokens on this one-shot mix (9,487→8,401); far more on loop-heavy agent work
generalList the planets in the solar system in order from the Sun. trivial
local model · free
llama3.2:3b · 0 paid tok · q 1.00

Here are the planets in our solar system listed in order from the Sun: 1. Mercury 2. Venus 3. Earth 4. Mars 5. Jupiter 6. Saturn 7. Uranus 8. Neptune Note: Pluto was previously considered a planet but was reclassified as a dwarf planet in 2006 by the International Astronomical Union (IAU).

frontier model · paid
claude-opus-4-8 · 60 paid tok · q 0.95

Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune. (Pluto was reclassified as a dwarf planet in 2006, so it's no longer counted among the eight planets.)

hibrid routes this to → local — free, on your machine · quality gap local vs paid: -0.05
reasoningA train travels at 60 mph for 2.5 hours. How far does it travel? Show your work. trivial
local model · free
llama3.2:3b · 0 paid tok · q 0.95

To find the distance traveled by the train, we need to multiply the speed of the train (in miles per hour) by the time it traveled. Speed = 60 mph Time = 2.5 hours Distance = Speed x Time = 60 mph x 2.5 hours = 150 miles Therefore, the train travels 150 miles in 2.5 hours.

frontier model · paid
claude-opus-4-8 · 86 paid tok · q 0.98

A train travels at 60 mph for 2.5 hours. **Distance = Speed × Time** - Speed = 60 miles per hour - Time = 2.5 hours Distance = 60 mph × 2.5 hours = **150 miles** The hours unit cancels out (60 miles/hour × 2.5 hours), leaving the answer in miles.

hibrid routes this to → local — free, on your machine · quality gap local vs paid: +0.03
generalWhat is the capital of France? trivial
local model · free
llama3.2:3b · 0 paid tok · q 0.95

The capital of France is Paris.

frontier model · paid
claude-opus-4-8 · 20 paid tok · q 1.00

The capital of France is **Paris**.

hibrid routes this to → local — free, on your machine · quality gap local vs paid: +0.05
reasoningProve that there are infinitely many prime numbers. Present Euclid's proof step by step and explain the logic of each step. hard
local model · free
llama3.2:3b · 0 paid tok · q 0.04

Euclid's proof that there are infinitely many prime numbers is a fundamental result in number theory, first presented in his book "Elements" around 300 BCE. Here's a step-by-step explanation of the proof: **Step 1: Let's assume the contrary** Euclid starts by assuming the opposite of what we want to…

frontier model · paid
claude-opus-4-8 · 1007 paid tok · q 0.98

# There Are Infinitely Many Primes — Euclid's Proof **Theorem.** There is no largest prime; the set of prime numbers is infinite. Euclid's argument (from *Elements*, Book IX, Proposition 20) is a **proof by contradiction**. We assume the opposite of what we want to prove, and show that assumption fo…

hibrid routes this to → the paid model — this one earns it · quality gap local vs paid: +0.94
reasoningDesign a rate-limiting algorithm for a distributed API gateway that handles burst traffic, is fair across users, and needs no central coordinator. Analyze time … hard
local model · free
llama3.2:3b · 0 paid tok · q 0.28

# Rate Limiting Algorithm Design ## Overview To design a rate-limiting algorithm for a distributed API gateway that handles burst traffic without a central coordinator, we can implement a distributed token bucket algorithm. ### Token Bucket Algorithm Basics The token bucket algorithm is a common app…

frontier model · paid
claude-opus-4-8 · 2075 paid tok · q 0.95

Let me design this directly. ## The problem, stated precisely We want each user *u* to be limited to a rate *R_u* (requests/sec) with an allowed burst *B_u*, enforced across *N* gateway nodes, where: - **No central coordinator** — no shared Redis/counter service on the request path (that's a coordin…

hibrid routes this to → the paid model — this one earns it · quality gap local vs paid: +0.67

What that saves you. A small local model already matches the paid model on everyday tasks (87% of its quality, at zero cost); the real gap is on hard reasoning, which hibrid sends to the paid model. On a loop-heavy agent workload — where cheap, repetitive calls dominate — that routing avoids on the order of 432,607 paid tokens/month for an agent doing ~200 calls/day (prior study: up to 87%).

Method & full data: the paper (PDF, LaTeX edition) · markdown · referee reports · published in The PaMaBAI Journal, Vol. 1 Issue 1.

Why nothing else does this

Cloud routers can't see your hardware. Local apps won't reach the cloud on their own. hibrid is the part in the middle.

 Cloud routersLocal appshibrid
Routes by taskyesmanualyes
Knows your hardwarenohintsmeasures it
Local + strong, automaticnoby handyes
Strong tier with no API keynonoyour subscription
Private data stays localnopartialenforced
Sits under your existing toolssomenoyes