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