Explain the LLM vs runtime split in an agent and why the distinction matters for debugging
An agent system has two major components: the LLM and the runtime. Describe the responsibility of each, then explain why confusing them leads to incorrect debugging assumptions.
The LLM only decides and emits text; the runtime parses that text, executes tools, and feeds results back. Knowing who does what tells you where a bug actually lives.
Imagine a brilliant chess coach who is locked in a soundproof booth. The coach can see the board through glass and can shout out moves, but the coach can never touch a piece. A second person, the assistant, stands at the board, hears the move, moves the piece, and then describes the new board back through the glass. The coach is the brain that decides. The assistant is the hands that act. If a piece ends up in the wrong square, you have to ask the right question. Did the coach call a bad move, or did the assistant hear it wrong and move the wrong piece? An agent works the same way. The model is the coach in the booth, and the runtime is the assistant at the board.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define the two layers, state that the model only emits text while the runtime executes, explain that injecting the result closes the loop, then map failure types to the layer that owns them and close with why per-step tracing is the only way to localize a bug.
Real products, models, and research that use this idea.
- The Anthropic SDK returns a tool_use content block from Claude Opus 4.7; your code, not the model, must execute it and post back a tool_result block to close the loop.
- OpenAI function calling returns a tool_calls array as JSON text. The model never runs the function; the developer's runtime parses the arguments and dispatches the real call.
- LangGraph models the split explicitly: the LLM node emits the decision and a separate ToolNode executes it, so traces show exactly which layer produced a failure.
- LangSmith and Langfuse trace each step separately, recording the model's emitted tool call alongside the runtime's observed result so engineers can localize a bug to one layer.
What an interviewer would ask next. Try answering before peeking at the approach.
QIf the model emits a tool call but the result never appears in the next turn, where do you look first?
QHow does the split change when a model supports parallel tool calls in one turn?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Saying the model 'called' a tool. The model only emits a tool-call object as text. The runtime parses it and decides whether to execute it, so a silent failure can hide there.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.