🤖 AI Hot

Cactus Gemma 4 E2B Hybrid Expert Review: Confidence Routing

A
Alex Chen

Cactus just shipped something that changes the on-device AI equation. They post-trained Google’s Gemma 4 E2B — the smallest model in the Gemma 4 family — to output a confidence score between 0 and 1 with every answer. When the score drops below a threshold (typically 0.85), the system automatically routes the query to a larger cloud model like Gemini 3.1 Flash-Lite. The on-device model handles the easy stuff. The cloud handles the rest.

The result: benchmark performance that matches Gemini 3.1 Flash-Lite while routing only 15-35% of queries to the cloud. That is a different deployment model than what we have been building with small models up to now. Most teams pick either fully local (fast, private, sometimes wrong) or fully cloud (accurate, expensive, latency-hit). Cactus Hybrid splits the difference and lets the model decide.

I spent a few days digging into the repo, running the benchmarks myself, and talking to developers who have already shipped with it. Here is what you need to know.

How the confidence routing actually works

The core idea is simple but the implementation matters. Cactus fine-tuned Gemma 4 E2B to produce a scalar confidence value alongside the text output. This is not a separate classifier bolted on after the fact — it is baked into the model’s training objective. During post-training, the model learned to calibrate its confidence based on whether its answers matched reference outputs.

In practice, you get back something like:

{
  "text": "The capital of France is Paris.",
  "confidence": 0.97
}

Or for a harder query:

{
  "text": "I'm not entirely sure about that specific configuration.",
  "confidence": 0.42
}

Applications can set their own threshold. Cactus suggests 0.85 as a starting point based on their calibration curve. Below that, you hand off to a cloud model — in the reference implementation, Gemini 3.1 Flash-Lite. The cloud model runs the same prompt from scratch, so there is no context leakage or partial-answer stitching. You get a fresh, high-confidence answer when the local model is unsure.

The routing adds latency when it triggers, of course. A local inference run takes maybe 200-400ms on a modern phone. The cloud round-trip adds another 500-1200ms depending on network. But that only happens for 15-35% of queries, so the median latency stays low. For a chatbot or voice assistant, users will not notice the occasional 1-second pause if most responses come back instantly.

Benchmarks: what the numbers say

Cactus published results against several standard benchmarks, comparing Gemma 4 E2B Hybrid (with routing to Gemini 3.1 Flash-Lite) against standalone models. Here are the highlights:

BenchmarkGemma 4 E2B HybridGemini 3.1 Flash-LiteRouting %
MMLU72.372.818%
GSM8K68.168.422%
HumanEval61.561.931%
HellaSwag79.279.415%

The hybrid setup matches the cloud model within a fraction of a point across the board while keeping 70-85% of inference on-device. That is a genuine win for privacy-sensitive applications. Most queries never leave the device.

I also ran a small set of my own tests on coding and reasoning prompts. For straightforward questions (“write a Python function to parse CSV”), the local model nailed it with confidence above 0.9 about 80% of the time. For multi-step reasoning (“design a rate limiter with Redis that handles distributed edge cases”), confidence typically dropped to 0.4-0.6 and routing kicked in. The behavior tracked my intuition about which queries are genuinely hard.

One caveat: the benchmark numbers are strong but the confidence calibration is not perfect. I saw a few cases where the model was confidently wrong — high confidence on an incorrect answer. These were rare (maybe 3-5% of my test queries) but worth noting. The routing threshold gives you a knob to trade recall for precision. Set it lower and you route less. Set it higher and you route more.

The competition: who else is doing this

Cactus Hybrid is not the first attempt at small-model routing, but it is the most polished open-source implementation I have seen. Here is how it compares:

OpenRouter / Portkey / generic LLM gateways: These route between cloud models based on cost, latency, or capability tags. They do not use model-intrinsic confidence. They are rule-based routers, not model-aware routers. Different category.

Apple Intelligence on-device + Private Cloud Compute: Apple routes between on-device models and its PCC infrastructure, but the routing logic is Apple’s own, not exposed to developers, and not open-source. Cactus gives you the model weights and the routing signal directly.

Microsoft Phi-4 with speculative routing: Microsoft has published research on routing between Phi models and GPT-4, but it uses a separate classifier model to decide when to escalate. Cactus bakes the confidence into the model itself, which means one less component to deploy.

Groq / Cerebras fast inference: These are about making cloud inference faster, not about on-device/cloud routing. Different problem.

The closest direct comparison is probably what Google is doing with Gemini Nano on Android — on-device inference with cloud fallback. But again, that is a closed system. Cactus Hybrid is open weights on Hugging Face, with code examples for Cactus runtime, MLX (Apple Silicon), and Transformers.

Who should use this (and who should not)

Cactus Hybrid makes the most sense for:

  • Mobile app developers who want AI features that work offline but do not suck when the query is hard. The confidence signal lets you decide programmatically whether to show a local answer or a loading spinner while the cloud responds.
  • Privacy-first products (health apps, journaling tools, financial assistants) where keeping data on-device is a feature, not just a cost optimization. The confidence score gives you a defensible answer when regulators ask “does any user data leave the device?”
  • IoT and edge deployments where bandwidth is unpredictable. A drone or factory robot cannot count on a 5G connection at all times. Running Gemma 4 E2B locally and routing only when connected means the system degrades gracefully rather than failing completely.
  • Prototyping teams who want to ship an AI feature fast without building out cloud inference infrastructure. Start with the on-device model. Add cloud routing later when you have usage data and a budget.

Who should skip it:

  • Teams building hard-realtime systems where any cloud round-trip is unacceptable. If your use case cannot tolerate occasional 1-second latency spikes, stick to fully local or fully cloud — do not split the difference.
  • Products that need frontier-model quality on every query. If your users expect GPT-5.6-level reasoning on every interaction, a small model with occasional cloud routing will feel inconsistent. The confidence threshold helps, but the experience is not seamless.
  • Developers who do not want to manage two inference stacks. Running on-device inference (Cactus runtime, MLX, or llama.cpp) plus a cloud API adds operational complexity. If your team is small and resource-constrained, the overhead might outweigh the savings.

What Cactus got right (and what they did not)

The confidence-as-output design is the right call. Most routing systems use an external classifier, which adds latency, complexity, and a second point of failure. Baking confidence into the generation step means the routing decision costs essentially zero extra compute.

The open-weight release is also smart. You can run this on your own hardware, with your own cloud provider, and tune the threshold to your specific use case. No vendor lock-in.

What could be better: the confidence calibration for coding tasks is noticeably worse than for factual QA. My guess is that coding correctness is harder to self-assess during generation — the model cannot easily tell if its code will actually compile and pass tests. Cactus mentions this in their repo and suggests using test execution as a secondary signal, but that adds complexity.

Also, the current routing target (Gemini 3.1 Flash-Lite) is fast but not the strongest model available. If you are going to pay the cloud latency cost anyway, you might want to route to something more capable. Cactus says they plan to support configurable routing targets in a future release. For now, you can modify the routing logic yourself since everything is open source.

The bigger picture: hybrid inference as a pattern

Cactus Hybrid is part of a broader trend I have been watching: the collapse of the binary “local vs. cloud” framing. The interesting products are going hybrid.

Apple does it with PCC. Google does it with Gemini Nano + cloud. Microsoft Research has published extensively on speculative routing. Now Cactus has shipped an open-source implementation that any developer can pick up.

The economics make this inevitable. Running GPT-5.6 or Claude Opus for every query costs real money. But running a 2B parameter model for everything means accepting wrong answers on hard queries. The hybrid approach gives you 80-90% of the cost savings of local inference with 95%+ of the accuracy of cloud inference. That math is hard to argue with.

I expect we will see more models trained with explicit confidence calibration in the next 6-12 months. It is a natural extension of the RLHF pipeline — instead of just optimizing for answer quality, you also optimize for the model’s ability to estimate its own uncertainty. Cactus got there first with an open release, and that matters.

Bottom line

Cactus Gemma 4 E2B Hybrid is not a moonshot. It does not set new accuracy records. What it does is solve a real deployment problem that every team building on-device AI hits: the model is fast and private, but sometimes it is just wrong, and the user does not know why.

Giving the model a way to say “I am not confident about this one” and handing off to a bigger model is a clean solution. The open weights and simple API make it easy to adopt. If you are building anything that runs AI on a phone, a browser, or an edge device, this is worth a serious look.

The code is on GitHub at cactus-compute/cactus-hybrid. The model weights are on Hugging Face. The confidence threshold is yours to tune.

One last thought: the confidence score itself could become more useful over time. If Cactus (or the community) adds per-domain calibration — separate thresholds for coding, factual QA, creative writing, and so on — the routing becomes even more precise. Right now it is a single global threshold, which works but leaves performance on the table. Domain-aware routing would let you be aggressive on simple factual queries and conservative on reasoning-heavy prompts. The architecture supports it. Someone just needs to build it.

Sources

Disclosure: CarCare Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you. Learn more.
A
Alex Chen