// guide

vLLM tool calling for agents: flags, parsers and errors

vLLM tool calling needs two server flags, --enable-auto-tool-choice and a --tool-call-parser that matches the model; without them a request with tool_choice auto fails with a 400 error, and with the wrong parser the tool call arrives as plain text.

Updated

An agent such as OpenHands or Paperclip works only when the model server returns structured tool_calls. This page lists the exact vLLM error strings, the parser for each model family, the settings our agent Launchables use, and one request that proves tool calling works. Error strings are quoted from the vLLM v0.27.1 source, read 2026-12-03.

On this page

What does "auto" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be set mean?

It means the request asked the model to choose a tool, but the server was started without a tool parser. vLLM rejects the request before generation and returns HTTP 400 with error type BadRequestError.

RequestExact vLLM v0.27.1 error textFix
tools sent, tool_choice "auto" or not set"auto" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be setRestart vllm serve with both flags
tool_choice "required"tool_choice="required" requires --tool-call-parser to be setAdd --tool-call-parser
tool_choice naming one functiontool_choice=function "NAME" requires --tool-call-parser to be setAdd --tool-call-parser
  • A request that sets tool_choice without a tools array fails with a different message: When using tool_choice, tools must be set.

  • The three strings in the table come from vllm/renderers/online_renderer.py at tag v0.27.1, not from the older serving_chat.py path.

  • When a request carries tools and no tool_choice, vLLM sets tool_choice to "auto", so a plain agent request hits the first error.

  • vLLM skips this check for models with a Mistral tokenizer and for gpt-oss models, which use their own tool format.

  • The error is a server setting, not a client bug: changing the agent's settings does not clear it.

Which flags turn on vLLM tool calling?

The vLLM v0.27.1 tool calling page names one mandatory flag and three supporting ones.

FlagRequiredWhat the vLLM docs say it does
--enable-auto-tool-choiceyes, for "auto"Lets the model generate its own tool calls when it deems it appropriate
--tool-call-parser NAMEyesSelects the parser that turns the model's output into OpenAI-style tool_calls
--chat-template PATHoptionalA template that handles tool messages and earlier tool calls; Hermes, Mistral and Llama models ship one
--tool-parser-plugin PATHoptionalRegisters your own parser, then name it in --tool-call-parser

The docs add two limits worth knowing for agents. With "auto", vLLM extracts tool calls from raw text unless at least one tool sets strict: true, "so arguments may occasionally be malformed". With "required" or a named function, vLLM uses structured outputs: "You are guaranteed a validly-parsable function call - not a high-quality one."

Which --tool-call-parser matches my model?

Use the parser the model card or the vLLM docs name for that family. With a parser for the wrong family, the tool call can show up as text.

Model family--tool-call-parserAlso neededSource, read 2026-12-03
NVIDIA Nemotron 3.5 Lightning 30B-A3Bqwen3_coder--reasoning-parser nemotron_v3NVIDIA model card, vLLM v0.27.1
NVIDIA Nemotron 3 Nano 30B-A3B FP8qwen3_coder--reasoning-parser nano_v3 with the card's parser plugin fileNVIDIA model card, vLLM 0.12.0 or later
Llama 3.1 and 3.3llama3_jsonthe Llama 3.1 JSON chat templatevLLM docs v0.27.1
Llama 4llama4_pythonicthe Llama 4 pythonic chat templatevLLM docs v0.27.1
Qwen2.5 and Hermes modelshermesnonevLLM docs v0.27.1
Qwen3-Coderqwen3_xmlnonevLLM docs v0.27.1
MistralmistralnonevLLM docs v0.27.1
gpt-ossopenainonevLLM docs v0.27.1
DeepSeek-V3 / V3.1deepseek_v3 / deepseek_v31nonevLLM docs v0.27.1
Kimi-K2kimi_k2nonevLLM docs v0.27.1

The vLLM v0.27.1 parser list has no Nemotron heading; NVIDIA's model cards name qwen3_coder for both Nemotron models above. The same docs page lists qwen3_xml under Qwen3-Coder models. Our Nemotron Launchables use qwen3_coder, as the model card says, and their tests returned tool calls.

How do our agent Launchables configure tool calling?

Each Launchable sets the flags in its Compose file, so the model server starts with tool calling on. Read from the Compose files on 2026-12-03:

LaunchableServer and versionServed model nameTool-calling flagsTest on NVIDIA Brev, one run
OpenHands Coding Agent on NemotronvLLM v0.27.1 imagecoder--enable-auto-tool-choice --tool-call-parser qwen3_coder, plus --reasoning-parser nemotron_v3 for Nemotron 3.5 Lightning2026-11-15: finish_reason was tool_calls; add called with {"a": 2, "b": 3}
Paperclip Multi-Agent Team on NemotronvLLM v0.27.1 imageagent-model--enable-auto-tool-choice always; qwen3_coder and nemotron_v3 for Nemotron models, hermes for any other model2026-11-15: tool_calls with get_weather and {"city": "Paris"}
Hermes Agent on Nemotron 3.5 Boltllama.cpp server-cuda-b12464nemotron-boltnot vLLM: llama.cpp runs with --jinja2026-11-19: tool-call check passed
  • Both vLLM stacks set --max-num-seqs 16 and a default --max-model-len of 65536.

  • Each test checked one tool call on the default model, not a full agent task.

  • Both vLLM tests ran on one NVIDIA L40S 48GB (AWS g6e.xlarge).

How do I test that vLLM returns a real tool call?

Send one request with a single tool and read two fields of the answer. This is the shape of the check our Launchable tests use.

  1. Start the server with both flags, for example vllm serve MODEL --served-model-name coder --enable-auto-tool-choice --tool-call-parser qwen3_coder.

  2. POST to the server's /v1/chat/completions on port 8000 with "model": "coder", a user message such as "What is 2 plus 3? Use the add tool.", and a tools array holding one function add with integer parameters a and b.

  3. Check that choices[0].finish_reason is tool_calls.

  4. Check that choices[0].message.tool_calls[0].function.name is add and its arguments string parses as JSON.

  5. If finish_reason is stop and the content holds JSON or tags, the parser does not match the model: change --tool-call-parser.

The Nemotron 3.5 Lightning model card adds one note for coding agents: pass the chat template option force_nonempty_content set to True through chat_template_kwargs in the request's extra_body.

Why does the tool call appear as text instead of tool_calls?

The server answered, but no parser turned the model's tool-call text into tool_calls. NVIDIA's NemoClaw troubleshooting page describes this symptom: a JSON object such as a tool name and arguments appears in the chat, and no tool runs.

What you seeLikely causeWhat to check
HTTP 400 with the "auto" tool choice errorFlags missingBoth flags on vllm serve
JSON or tool tags inside content, finish_reason is stopParser does not match the modelThe model card's parser name
The model answers in text and never calls a toolThe model may not be trained for tool callsThe model card's tool-calling section
The agent stops mid-task or loses earlier stepsContext window too small for the agent's prompt and tools--max-model-len against the agent's minimum

NVIDIA's page says agent loops with several tools, long instructions or multi-turn dispatch need a server that returns structured tool calls consistently, and names vLLM for that case. For OpenHands, its local-model docs ask for a context of at least 22000 tokens, and 32768 is recommended.

How do I connect OpenHands to vLLM tool calling?

Set three values in OpenHands under Settings, LLM, Advanced. The OpenHands local-model docs, read 2026-12-03, give this pattern:

OpenHands settingValue
Custom Modelopenai/ plus the served model name, for example openai/coder
Base URLthe vLLM address ending in /v1, for example http://vllm:8000/v1 inside our Compose network
API Keythe key given to vllm serve --api-key; our OpenHands Launchable starts vLLM without --api-key

The full walkthrough is in how to run OpenHands with a local Nemotron model. Model and harness choices for Nemotron are compared in Nemotron coding agent: models, harnesses and tool calling.

What else do people ask about vLLM tool calling?

Does vLLM support tool calling?

Yes. vLLM v0.27.1 supports named function calling and the auto, required and none values of tool_choice in its OpenAI-compatible chat API. Only auto needs --enable-auto-tool-choice; all three that call tools need a parser.

What is the difference between tool_choice auto and required?

With auto the model decides whether to call a tool. With required vLLM uses structured outputs, so the model returns one or more tool calls from the tools list.

Which tool call parser does Nemotron use in vLLM?

NVIDIA's model cards for Nemotron 3.5 Lightning and Nemotron 3 Nano name qwen3_coder. Lightning adds --reasoning-parser nemotron_v3; Nano adds nano_v3 through a plugin file from its model card.

Does tool_choice none still send the tools to the model?

Yes, by default. The vLLM docs say tool definitions are included in the prompt regardless of tool_choice; start the server with --exclude-tools-when-tool-choice-none to leave them out.

Can I use a local model for tool calling with an agent?

Yes, if the model supports tool calls and the server returns structured tool_calls. Our OpenHands and Paperclip Launchables each returned a tool call from a local Nemotron model on one GPU in 2026-11-15 tests.

Sources: where do these facts come from?

How was this page made?

9owls published this page. Error strings were read from the vLLM v0.27.1 source and docs; parser names from the vLLM docs and NVIDIA model cards; Launchable settings from their Compose files; and the tool-call results from our own fresh-deploy tests, one run each, on the dates shown. We did not benchmark tool-call accuracy for this page. No other site's text was reused. Found an error? Tell us on the company page.

All guides