I put a small open-weight model next to the model gateway I use. It answered typed decisions at almost no marginal cost, and I benchmarked it as an injection classifier along the way. Soon after, I took it out of service.
Nothing broke. The benchmarks I had written looked good. I paused it because once I measured what it was doing for me, the honest answer was "not enough to justify the memory it holds", and the reason I could not give a better answer was that I had built the thing before I had a way to judge it.
Here is the build log, and why I think the pause is the more useful half.
What I built
My agents reach models through one gateway that meters spend per agent. That is where I noticed a pattern. A lot of agent calls are not really generation. They are small decisions. Did this deploy succeed? Is this ticket a bug or a feature request? Does this log line mean someone should be paged? Sending those to a frontier model felt like hiring a senior engineer to sort the mail.
So I built a decision service. The idea is old and simple: give the model a piece of state, a question, and a short list of labelled options, then read the probability the model assigns to each option's letter in a single forward pass. Nothing is generated. There are no output tokens to pay for and no JSON to repair when the model decides to be creative. You get back a winner and a probability per option, and you always include an "insufficient evidence" option so the model has somewhere honest to go.
That last option matters more than it looks. A classifier with no exit will always pick something, and a confident wrong label is worse than an admitted gap, because the agent downstream acts on it. An abstention is a signal you can route on: escalate, or ask a human.
I served it with Qwen3.5-4B at full fp32 precision on CPU and exposed it through the gateway as a decision endpoint. Any agent allowed to use it could ask for a decision instead of a completion.
The same service had a second job: an injection classifier I benchmarked alongside it, scoring whether a piece of untrusted text was trying to steer the model.
What the numbers said
I wrote a fixed benchmark: 16 agent-style decisions with expected answers, and a 24-case injection set with 12 attacks and 12 benign prompts, including hard negatives such as a legitimate security review and a request that talks about injection without being one.
On the server, the 4B model at fp32 took a few seconds per decision at the median. It agreed with all 16 expected labels. The injection numbers looked respectable too, and that is exactly the problem: 24 cases is too small to trust for anything that calls itself a security control. With 12 attacks, one miss moves the detection rate by more than eight points, and a clean result on 12 benign prompts tells you almost nothing about the false positive rate on thousands of real requests. Attackers also do not draw from your test set. A benchmark you wrote yourself contains the attacks you already thought of, which are the ones least likely to hurt you.
A 4B model at fp32 is also heavy. Four bytes per parameter puts it well past 16 GB of RAM before you count anything else. And it was serial: one decision at a time.
One thing worth knowing before you serve on CPU: on CPUs without native bf16 support, bf16 can be far slower than fp32, and hyperthreads that share floating-point units do not add real throughput for this kind of work. If you are planning to serve on CPU, budget time for this. The default knobs are not the fast ones, and you only find out by measuring.
Through the gateway, latency went up a little more. Then I ran a small proof of concept with two agents and the classifier benchmark sharing one model. Median latency barely moved, but the tail grew to many times the median as calls queued. A serial model behind a shared gateway behaves like a single cashier at lunchtime: fine for one customer, painful for a queue. If you only watch p50, a serial model looks healthy until two agents need it at once.
The laptop problem
For development I ran the same container image on my laptop, where the 4B model does not fit at fp32. So dev ran Qwen3-0.6B instead.
The 0.6B model was fast and wrong. It agreed with 8 of the 16 expected labels, which is a coin flip with extra steps. On the injection set it labelled two out of every three benign prompts as attacks. That is a false positive rate that would make any classifier unusable as a gate.
There was a second trap. Docker on macOS runs in a Linux VM without access to the Apple GPU, so the containerised 0.6B model ran roughly ten times slower than the same model running natively on the laptop's GPU. My dev environment was both less accurate and slower than it needed to be, which meant it could tell me whether the code worked and nothing about whether the model was any good. I wrote that into the dev config as a comment: judge quality on the server, use the laptop for code, config and latency experiments.
Teams I've seen do the same thing: a smaller model for local development, then quality opinions quietly formed from it. The plumbing tests are valid. The quality impressions are not.
Why I paused it
The pause came in two steps.
First, I shelved the decision route. In the proof of concept the 4B model was reliable on crisp yes-or-no evidence (did the deploy fail, does the log contain an error) and weak on judgement calls, like working out who should own a task or how risky a commit was from its subject line. Those judgement calls were the cases I most wanted to offload. Then I looked at what the route was saving, and it was close to nothing.
Second, I took the whole service out of the gateway. A large memory footprint held around the clock, to save very little and to back a classifier I could not yet trust, is a poor trade.
Injection classification is the idea I still believe in, and I separated the idea from this implementation. The benchmark did not prove the model was bad at it. It proved I had not built a test big enough to say either way, and for a security control that is the same as not knowing. A general 4B chat model is the wrong shape for a classifier that has to read every request. Purpose-built guard models in the tens or hundreds of millions of parameters exist, Qwen3Guard-0.6B among them, and they are trained for exactly this job.
For decisions, I set a rule for myself: no new model gets evaluated until I have a labelled set of real decisions from my own agents. While researching alternatives I looked at a small ModernBERT-based classifier that runs in well under a second on CPU. Zero-shot, it scored close to random. It only becomes useful after fine-tuning on labelled examples. Every road I looked at went through the same gate: labelled data from my own workload.
What I got wrong
My mistake was the order of operations. I wrote a 16-case benchmark, which was enough to choose between a 0.6B and a 4B model and enough to tune threads. It was nowhere near enough to answer the question that mattered: on the decisions my agents actually make, is this better, cheaper or faster than what they do today?
Sixteen hand-written cases are cases I already knew the answer to. They skewed toward crisp evidence, because crisp cases are easy to write expected labels for. The 4B model scored 16 out of 16 on them and then struggled with the fuzzy decisions real agents produced. The benchmark was honest. It just measured the wrong population.
The other thing I underweighted was utilization. A model you host costs the same whether it answers one request an hour or one a second. Mine held its full memory footprint around the clock to handle a handful of decisions. Self-hosting pays back when the hardware is busy with work you have proven it does well. Mine was lightly used and unproven on the work I cared about.
There is a fair counterargument here. Sometimes you self-host for reasons that have nothing to do with cost: data that cannot leave your network, a hard latency budget, or independence from a vendor's rate limits. Those are real, but you should be able to write them down before you build, and none applied to me. I built it because it was interesting and because the per-call price looked like zero. The per-call price is not the cost.
Before you self-host
If you are thinking about putting an open-weight model next to your gateway, here is the order I would follow now.
Start by logging the calls you want to replace. Put a tag on every agent request that is really a classification or a decision, and let it collect for a while. That gives you the real distribution, including the ugly judgement calls you would never think to write by hand.
Label a few hundred of those. It is boring work and it is the most valuable artifact in the whole project, because it outlives every model you test against it. A model is a dependency you will swap. The eval set is the thing you own.
Run every candidate against that set, hosted and self-hosted, small and large, before you write a route. Score accuracy on the decisions that matter, tail latency under realistic concurrency, and the true cost of each option, including the memory and CPU you take away from everything else on the same hardware.
Develop on a model that behaves like production, or accept that your dev environment can only test plumbing. Write that limitation down where the next person (or the next agent) will see it.
Run guards in monitor mode first. A monitoring guard checks in the background, adds no latency, and logs a verdict instead of blocking, so you measure it on real traffic without wrongly blocking anything. Decide how it should fail, open or closed, only once you trust its verdicts enough to enforce them.
And give yourself permission to pause. Pausing was the result of measuring. The code and the benchmark stay in the repo, so starting again means redeploying, not rebuilding.
I still believe in small models doing small jobs. I just no longer believe in deploying one before I can prove which jobs it should have.