Your agent calls a tool, and the user waits several seconds before anything happens. The tool itself answers in milliseconds, so the delay sits in the model call. The fastest fix is usually not a faster GPU. It is fewer tokens before the call, and no second try. So your question is: why does a single tool call take so long, and what do I change first?
Where the time goes in one tool-calling turn
Tool calling (also called function calling) means you send the model a list of functions it may use. The model answers with a structured request to call one of them, with the arguments filled in. Your code runs the function and sends the result back.
One such turn has two waits. Time to first token (TTFT) is how long the model takes to read the prompt and send the first token of its answer. Output speed is how many tokens per second it writes after that. A token is a piece of text, roughly a short word.
The turn is done when the last token of the call has arrived. That gives a simple estimate:
time to a finished call = time to first token + tokens written / output speed
Our running example is a hypothetical support assistant on Qwen3.8 27B, one of the open models on our API, with 27 billion parameters (27B). Each turn sends 4,100 input tokens. They are a 1,200-token system prompt, 12 tool definitions of about 200 tokens each, 400 tokens of conversation and a 100-token user message. The model then writes a 60-token tool call. All of these token counts are hypothetical.
For the speeds, we use the Qwen3.8 27B model page: 291 ms to the first token and 45 tokens per second. These are the 7-day medians of our status checks on short requests, measured on 30 October 2026. A 4,100-token prompt takes longer to read than a short request, so the example understates the first-token time in every row.
Turn reasoning off for simple tool calls
Many open models write a reasoning trace before they answer: tokens in which the model works through the problem. Our docs note that the trace counts toward output tokens. On our model pages, reasoning tokens also count towards the speed figures. The pages do not split reasoning tokens from answer tokens, so the speed of the call alone may differ.
So a model that reasons first writes far more tokens before the tool call arrives. In the example we assume a 400-token trace. That is hypothetical: the length varies with the model and the request.
reasoning on: 0.291 s + (400 + 60) tokens / 45 tokens per second = 10.5 s
reasoning off: 0.291 s + 60 tokens / 45 tokens per second = 1.6 s
| Setup, same 60-token tool call | Time to a finished call | Cost of the reasoning |
|---|---|---|
| Qwen3.8 27B, reasoning on | 10.5 s | 400 x $2.40 per 1M = $0.00096 |
| Qwen3.8 27B Instant, reasoning off | 1.6 s | none |
| GLM-5.3 Flash, reasoning on (289 ms, 93 tokens per second) | 5.2 s | 400 x $0.50 per 1M = $0.00020 |
Our docs describe Instant variants as the same model with reasoning switched off. The Qwen3.8 27B Instant page lists no speed of its own, so the row uses the Qwen3.8 27B figures. GLM-5.3 Flash writes about twice as fast. Our docs advise leaving its reasoning on, because switching it off only moves the reasoning into the answer. On that model, a simple call still carries the trace.
Two limits apply. First, the 400-token trace is our assumption, which favours reasoning off: a shorter trace narrows the gap. Second, the example does not show whether calls stay correct with reasoning off.
You can switch reasoning off per request on Qwen3.8 27B. Clients that cannot pass request settings can call its Instant model ID instead, the same model ID with -instant at the end.
resp = client.chat.completions.create(
model="qwen/qwen3.8-27b",
messages=messages,
tools=tools,
reasoning_effort="none",
)
Keep reasoning on where the model has to plan several steps or choose between similar tools. Switch it off where the call only picks one tool and fills in its fields.
Keep tool definitions short and at the start of the prompt
Every tool you send is part of the prompt. OpenAI's function-calling guide says the definitions are "injected into the system message", "count against the model's context limit and are billed as input tokens". Open models work the same way: Hugging Face's guide passes tools to the model's chat template, the format in which the model expects its input.
So a long tool list takes longer to read, and you pay for it on every turn.
Prompt caching helps with both: the server reuses the work it already did on a repeated start of the prompt. The open-source serving engine vLLM describes this for a shared prefix. A new request then "can skip the computation of the shared part". The same docs add a limit: it shortens reading the prompt, not writing the answer.
On our API, prompt caching is automatic. Our docs say a repeated leading prefix "is reused and billed at a reduced input rate", and that a cache hit is best-effort, not guaranteed. In the example, the system prompt and the tool definitions are the 3,600 tokens that repeat. At the Qwen3.8 27B prices on our models page, read on 30 October 2026:
input, nothing cached: 4,100 tokens x $0.40 per 1M = $0.00164
input, start cached: 3,600 x $0.10 per 1M + 500 x $0.40 per 1M = $0.00056
Two rules follow. Put the system prompt and the tool definitions first, in the same order on every turn, and add the conversation after them. Keep changing values, such as timestamps or user IDs, out of that start.
Then cut the list itself. If a turn only ever needs 4 of the 12 tools, send those 4. In the example that removes 1,600 input tokens, worth $0.00064 per turn when nothing is cached.
Make the first tool call valid
A failed call costs a whole second turn: the model reads the prompt again and writes again. In the example, that doubles the 1.6 seconds.
Calls fail in two ways: a plain-text answer instead of a call, or arguments your code rejects.
For the first case, the tool_choice setting forces a call. Set to required, it makes the model call one of your tools. Set to a named function, it makes the model call that one tool. On our API, every chat model supports tool calling, including parallel calls and returning results. Our docs list three models that do not currently enforce a forced call: DeepSeek V4 Pro 0813, DeepSeek V4 Flash and GLM-5.3. GLM-5.3 Flash is a separate model, and its page says it honours both. The Qwen3.8 27B model page says it honours both a required call and a named function.
For the second case, validate the arguments in your code before you run the tool. Send the error back to the model once, and stop after that.
If you serve a model yourself, constrained decoding prevents malformed calls. The engine only lets the model write tokens that fit the tool's JSON schema. A JSON schema describes each field and its type. For a named function call, vLLM uses its structured outputs backend: it compiles a set of rules for which tokens may come next. Its docs promise "a validly-parsable function call - not a high-quality one". They also warn that the first such call can take "several seconds of latency (or more)" while the engine compiles those rules.
Measure first-token time and output speed on your own traffic
The example's numbers come from short test requests and assumed token counts. Your prompts, tools and models will differ. So measure three things per turn: the first-token time, the tokens written and the cached share.
The usage object in our API's response reports the cached tokens. Our docs note that the field is missing entirely on a cache miss, so read it defensively:
details = resp.usage.prompt_tokens_details
cached = details.cached_tokens if details else 0
print(resp.usage.prompt_tokens, cached, resp.usage.completion_tokens)
For user-facing turns, our docs recommend streaming, which sends tokens as they are written: it "lowers time-to-first-token". For the live picture per model, use our status page, and compare models on the models page.
A single turn is only part of an agent's wait. Our guide to multi-step agent workloads budgets the whole task, including parallel tool calls and a cap on rounds.
Running tool calls on our API
We are Lyceum, a sovereign European AI inference provider for open-source models: built and run in Europe. Our serverless models run in Paris and Finland, and prompts and outputs are processed, not stored, and never used for training.
You call the models through one OpenAI-compatible API, billed per token with no base fee. Our docs list the models, their reasoning settings and which ones enforce a forced call. To choose between per-token calls and a dedicated endpoint, which reserves GPUs for you, see our guide to picking an endpoint.
In our example, the reasoning trace was the largest single delay, so we would switch it off first for simple calls. Start with Qwen3.8 27B and its Instant variant on serverless inference, our shared models billed per token.
Frequently asked questions
Does tool calling make LLM requests more expensive?
Yes. Each tool definition is sent as input text on every request, so a long tool list raises the input bill. Sending only the tools a turn needs, at the start of the prompt where the cache can reuse them, keeps that cost down.