Measured on 2026-09-01.
Baseline and change. The baseline is The model server on its own. The same request, key, prompt, machine and model; only whether the request streams, and whether it goes through the gateway, differs.
Each change is set against it.
In Optra Studio. This test has no page in Optra Studio: it measured our model server on a bench, and has no project page.
No outputs to show. The numbers come from timing runs against our own service. The raw timing logs were not kept with our notes. Every row of the tables is copied from the note we wrote that afternoon.
A request that waited for the whole answer ran at half the speed it was entitled to. The service was not slow. A rate limiter started its clock too late and charged the generation time twice.
What did we see?
While benchmarking our AI service, we noticed something odd. Requests that wait for the whole answer ran at about half the speed of requests that stream it.
We tested with the same key, the same prompt and the same machine. Only the way the answer was returned differed. We count speed in tokens, which are small pieces of words, a second.
| Path | Tokens a second |
|---|---|
| The model server on its own | 60.2 |
| Our service, streaming | 59.6 |
| Our service, waiting for the whole answer | 29.8 |
Is the service slow?
No. The free tier has a speed cap of 60 tokens a second. The streaming path hits it exactly, so the cap works as intended. The other path was held to half of it.
What was the cause?
The rate limiter has a clock. It sleeps long enough that the answer never goes out faster than the cap allows.
For a request that waits for the whole answer, the call to the model does not return until the model has finished. The limiter’s clock started only after that. So it slept for the full time again. The generation time was charged twice.
For a streaming request, the call returns at once, so the clock starts at the true beginning. That is why streaming was correct.
Did the arithmetic confirm it?
We predicted each time as the generation time plus the sleep the cap allows. The prediction matched the measurement within the delay of the web layers.
| Tokens | Generation | Cap allowance | Predicted | Measured |
|---|---|---|---|---|
| 64 | 1.6 s | 1.1 s | 2.7 s | 2.8 s |
| 128 | 2.7 s | 2.1 s | 4.8 s | 4.9 s |
| 256 | 4.8 s | 4.3 s | 9.1 s | 9.2 s |
What was the fix?
We moved the creation of the limiter above the call to the model, so its clock covers the whole call. Then it only sleeps to make up a real shortfall. One line moved, and the streaming path did not change.
| Path | Before (tokens/s) | After (tokens/s) |
|---|---|---|
| The model server on its own | 60.2 | not measured |
| Our service, streaming | 59.6 | 59.1 |
| Our service, whole answer | 29.8 | 60.3 |
Tokens a second before the fix
Tokens a second after the fix
To share. Pictures of these numbers, made from the same record and sized for a phone:
What did it change for a customer?
End to end, as a customer sees it, the speed went from 22.2 to 44.8 tokens a second. That is 2.0 times as fast on identical hardware.
The variation also collapsed. After the fix, repeated runs took about 5.7 seconds each.
Before it, they took 11.5, 10.5 and 31 seconds.
How do we stop it coming back?
We wrote a test that fails on the old code. With a half-second allowance and a half-second call, the buggy version took 1 seconds and the fixed one 0.5.
The test checks both directions. A test that only checked for “not too slow” would also pass if the cap were removed altogether.
Had we seen this bug before?
Yes, its mirror image. The limiter’s own notes record that the cap once ran on streams only. Requests that waited for the whole answer escaped it and ran at 125.8 tokens a second against a 30 tier.
The fix that capped both paths introduced this bug in the path it was added to.
What did we not measure?
This was one service on one afternoon. We kept the raw timing logs out of our notes. We left out prices, capacity and the rest of the benchmark on purpose.
What does this mean?
A speed cap needs a test that measures every path against the same expected number. And when a service looks slow, check whether something is slowing it on purpose before you tune the service.




