Ubicloud took Kimi's tool-call accuracy from 92% to 100% by flipping one vLLM flag

Fixing Tool-Call Accuracy in vLLM

Ubicloud took Kimi's tool-call accuracy from 92% to 100% by flipping one vLLM flag

Serving Kimi K2.6 with vLLM 0.28, Ubicloud saw only 92% of tool calls match the expected schema — two failures in every 25. The culprit wasn't the model but the inference engine's defaults. After enabling vLLM's constrained decoding, which masks invalid tokens during generation using XGrammar structural tags, they hit 100% schema accuracy on the K2VV ToolCall benchmark and shipped it to production.

The quality you observe isn't based on the model alone. The inference engine also plays an important role. Change the inference engine and its settings, and you change the model's output quality.
  1. Aurornis

    Constrained decoding has been in vLLM for a long time, and constrained tool call decoding has been in vLLM for a while, too.

    The blog post is rather confusing because until you understand the entire situation it appears to imply that they fixed vLLM (what the title implies) but really they just needed to configure it correctly.

    To be fair, the course of constrained tool calling configuration in vLLM changed over time in ways that changed behavior, which is the real problem. The Ubicloud team deserves a lot of credit for having benchmarks in place to track performance and catch regressions for investigations. Some of the providers you find on OpenRouter have inexplicably bad performance relative to others and clearly do not care this much.

    However, if this article left you confused because constrained decoding and constrained tool call schema have been features in vLLM for a long time, jump to the end where they show what configuration changes they made.

  2. mmastrac

    Amusingly constrained decoding is the same approach we use to turn an AR model into a /v1/systemone endpoint (I worked on the vLLM feature).

    Tool calling is fraught with peril, especially because there's nothing that necessarily says that a models tools are fixed in place for the life of its run.

    In some cases, tools are added mid-run to avoid a giant prefix miss and (at least last time I checked!), the industry has not settled on OpenAI-style chat message formats for tool call updates.

    I would absolutely prefer to run in a fully-constrained tool call environment, and would love if we hadn't YOLO'd the whole thing! The PTC-style tools sort of fix this by punting tool calling to JavaScript, but that's even harder to enforce, and models not trained on the style might take a turn of failed tool calls to get it right.

  3. hansvm

    I wish they'd published something about the actual impact on model quality. Schema-constrained decoding changes the distribution the LLM will output. I'd be curious how a back-up-and-retry method for tool calls (which also doesn't pollute the context and also has 100% tool-call accuracy) would compare. In their example stats (23/25 success rate), it'd be +9% tokens used for the tool call attempt itself, but that's +9% on just a small fraction of the total tokens, so if a retry solution gave any better accuracy I think it might win out.

  4. jesdo

    I'm one of the authors of this blog post. Figuring out how to integrate the LLM, the inference and serving engine, and the constrained decoding implementation such that you get the intended output and overall quality definitely requires careful engineering and testing. Please feel free to AMA. :)

  5. bob1029

    > For example, when we served Kimi K2.6 with vLLM version 0.28, we got the expected tool call schema only 92% of the time. In other words, 2 out of every 25 attempted tool calls failed.

    100% success is critical for tool calling.

    The probability that the overall agent iteration is successful would scale very poorly even if we achieved 95%. With p95, if you need 50 tool calls that must execute sequentially to achieve a result, the chances that you won't have an error are only ~8%. There are ways to recover from bad tool calls (error feedback helps a lot), but if the agent is persistently using the wrong tools with the wrong args the overall system will not work very well.

More from this day

2026-10-26