LangChain streaming not working with bind_tools: chunks arrive at once
Streaming breaks when tools are bound in LangChain. Learn why bind_tools disables token streaming, how to confirm it, and how to fix it.
The symptom
You have a working chat chain that streams tokens to your UI. You add tools so the model can call functions, and the stream goes quiet. Instead of many small chunks you get one message at the end, or a single chunk whose content holds the entire answer.
The shape is easy to recognize: iterate over the stream and print each chunk's content with a separator. Without tools you see many separators, so the text is arriving in pieces. With bind_tools you see the full sentence followed by a single separator, which means one chunk carried everything.
In the reported case this happened both with a LangGraph prebuilt tool node and with a bare prompt piped into the bound model, so the graph was not required to reproduce it. A later commenter reproduced the same single-chunk output using a local Ollama model bound to a tool, with no graph involved at all.
- One chunk instead of many, or no chunks until the response finishes.
- The same prompt streams correctly as soon as bind_tools is removed.
- No exception is raised, which is why it looks like a UI bug rather than a model bug.
Why it happens
The thread did not land on one confirmed cause, so rank these by how cheap they are to check.
1. The provider or model does not stream tool-call responses. Many OpenAI-compatible servers only emit incremental deltas for plain text, and fall back to a single payload when the request includes a tools array. Confirm it by calling the bound model directly, outside any chain or graph, and printing each chunk. If that is already a single chunk, the graph is innocent.
2. The model chooses to answer with a tool call rather than text. Tool-call arguments are usually delivered as one assembled object, so a turn that ends in a tool call can look unstreamed even when text streaming works. Confirm it by inspecting the chunk objects for tool call fields rather than only printing content.
3. The integration layer buffers when tools are present. Some chat model wrappers only enable streaming when they see no tool bindings, or require an explicit streaming flag alongside the tools. Confirm it by enabling streaming explicitly on the model constructor and re-running the same bound call.
How to fix it
- Strip the stack down to the smallest case: build the chat model, call bind_tools with one trivial tool, and iterate over .stream() or .astream() on a plain list of messages. Print the type and content of each chunk. This is the check the thread asked for and it separates model behavior from graph behavior.
- If the direct bound call already returns one chunk, the problem is at the provider or wrapper level, not in your graph. Try the same bound call against a different model family through the same interface to see whether the behavior follows the model.
- If the direct bound call streams fine but your chain does not, look at what sits between the model and your consumer. Prompt templates, output parsers, and callback handlers can each collapse a stream into a single value. Remove them one at a time until chunks reappear.
- Set the streaming flag explicitly on the model constructor instead of relying on the default, then re-test the bound call. If chunks now arrive, the wrapper was gating streaming on the presence of tools.
- If the turn is a tool call rather than text, do not expect token streaming for the arguments. Stream the text portion, let the tool execute, and stream the follow-up turn. Design the UI so a tool-call turn can render as a spinner rather than as partial text.
- When you cannot get streaming from a given model with tools bound, route tool-using turns to a model that streams them and keep the fast streaming model for plain chat. Verify per model rather than assuming the whole provider behaves the same.
When this is not the cause
If you never see chunks even without tools, the problem is upstream of tool binding. Check that streaming is enabled on the model object and that your consumer is not collecting the generator into a list before rendering.
If chunks arrive but the UI updates only once, the transport is the suspect, not the model. Server-sent events and fetch-based readers often buffer until a flush or until the response closes; test the same stream in a terminal first.
If the first chunk is fast and everything else arrives together, look at proxy or gateway buffering between your app and the model endpoint. A reverse proxy that buffers responses will produce exactly this pattern regardless of tools.
If you see tool call objects with empty content, that is expected for a tool-call turn and is not the streaming bug described here.
How to apply this with Admesh
Admesh exposes an OpenAI-compatible base URL at https://api.admesh.ai/v1 and an Anthropic-compatible endpoint at https://api.admesh.ai/v1/messages, with one API key and one balance across multiple model families. That makes it a practical place to run the differential test from the previous section: keep your LangChain code identical, point the base URL at Admesh, and compare chunk behavior across model families instead of standing up several provider accounts.
Start by reproducing the minimal bound call against the gateway. Create the chat model with your Admesh key and the base URL above, bind one trivial tool, and iterate over the stream while printing each chunk. If chunks arrive here but not against your original endpoint, the original provider was the limiting factor.
Then repeat the same script with a model from a different family available in the catalog at https://admesh.ai/models. Because the key and balance are shared, switching families is a one-line model change, which is the fastest way to learn whether tool-call streaming is a model property or a wrapper property in your setup.
Finally, keep the working configuration in your app: route tool-using turns to the family that streamed correctly, and check https://docs.admesh.ai for the current request parameters before you ship. Do not hardcode assumptions about which families stream tool calls; confirm against the live catalog and a real call.
FAQ
FAQ
Does bind_tools always disable streaming?
Is this a LangGraph bug?
Why do I get one chunk with tool call data and no text?
How do I check whether a gateway is buffering my stream?
References
Call these models through one gateway
Admesh provides a unified OpenAI-compatible API: one Base URL and one key for Claude, GPT, DeepSeek and more. New accounts get trial credit that never expires.
