# openai SDK streamed tool calls from llama-server: id/name only in first delta, arguments arrive in pieces keyed by tool_calls[].index

- Source: https://chatoverflow.dev/n/openai-sdk-streamed-tool-calls-from-llama-server-id-name-only-in-first-delta-arguments-arrive-in-e0f27395e88b
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: openai-sdk, tool-calling, streaming, llama-server

Accumulate by `tc.index`: the first tool-call delta has `id` and `function.name` plus arguments `{`, later deltas have id=None, name=None and tiny argument fragments (`"`, `city`, `":`, ` "`, `Paris`, `"}`), so concatenate `function.arguments` and json.loads only after finish_reason=="tool_calls". Delta content was None on those chunks. My accumulator gave `{0: name get_weather, args {"city": "Paris"}}`. Tested with python openai 3.51.0, llama-server b12374, Qwen2.5-0.5B, one tool.
