Writing
The Model Is Becoming a Runtime
Function calling, code execution and structured output turn inference into a loop. The model stops being a text generator and starts being a control layer.
Writing
Function calling, code execution and structured output turn inference into a loop. The model stops being a text generator and starts being a control layer.
Notes
For most of the last two years, the default mental model for an LLM application has been simple: send text in, get text back.
OpenAI added function calling to GPT-4 and GPT-3.5 in June 2023. By November, GPT-4 Turbo could return valid JSON, call multiple functions in one turn, and work inside the Assistants API with Code Interpreter and Retrieval. Anthropic made tool use generally available across the Claude 3 family at the end of May. Google added parallel function calling to Gemini 1.5 in May as well.
Models are moving from producing answers to deciding what operation should happen next.
Strictly speaking, the model is not a runtime. The application around it still executes code, owns state and enforces permissions. But the model is starting to occupy a role that looks increasingly like the control layer of one.
A normal language-model response is terminal. The model writes something, the application displays it, and the turn is over.
Function calling changes that contract.
Instead of asking the model to describe an action in prose, a developer gives it a set of functions with names, descriptions and parameters. The model can select one and produce arguments for it. The application executes the function, returns the result, and the model continues from the new state.
That creates a loop:
request → model decision → tool call → execution → result → model decision
The useful output is no longer necessarily the text generated by the model. Sometimes the useful output is the side effect produced by the tool.
If I ask a system to "rename these exported assets according to our convention," I need validated operations against the filesystem or asset database, not a paragraph explaining them.
OpenAI's original function-calling release made this shift explicit. GPT-4 and GPT-3.5 could return JSON arguments matching developer-defined functions, allowing natural language to be converted into API calls or database queries. OpenAI did not execute those functions for the developer; the application remained responsible for that boundary.
There is a temptation to think of JSON output as nicer formatting for model responses. I think it is closer to a type boundary between probabilistic reasoning and deterministic software.
OpenAI's JSON mode, introduced with GPT-4 Turbo, guarantees syntactically valid JSON. That makes parsing safer, but valid JSON is not the same as a correct schema. A model can still return the wrong field, the wrong value or a semantically bad decision.
Function schemas go a step further because they describe the operations the model is allowed to request. Anthropic's tool-use implementation follows the same general pattern: developers define tools, Claude chooses one when appropriate, and structured tool-use blocks connect the model to application code. Anthropic lists use cases such as extracting structured fields, converting natural-language requests into API calls, querying databases and automating software tasks.
A useful architecture follows from this: keep language at the human boundary and use typed structures at the software boundary. Once a decision crosses into production software, validate it.
Tool calls give a model access to functions that developers have already implemented. Code execution extends the idea.
OpenAI's Assistants API includes Code Interpreter, which can write and run Python in a sandbox, inspect the result, revise the code and run it again. In this setup, code is not only an artifact generated for a person to copy. It becomes a temporary instrument the model can use while solving the task.
That is a different capability from "write me a Python script."
A text-only model has to simulate the result of computation in its tokens. A model connected to an execution environment can externalise part of the task: calculate, inspect, plot, parse a file, observe an error, then continue.
Claude 3.5 Sonnet, released three days ago, makes the direction even clearer. Anthropic reports an internal agentic coding evaluation where the model is given a codebase, a natural-language change request and relevant tools. The task is not to generate a code snippet in isolation. It must modify an existing repository and solve the requested problem. Anthropic says Claude 3.5 Sonnet solved 64% of those tasks, compared with 38% for Claude 3 Opus.
The number matters less to me than the evaluation shape: the model is being tested inside an environment with state and actions, not as an isolated chat completion.
This is where the runtime analogy becomes useful.
A traditional program has explicit control flow. The developer decides which function runs next. Conditions and state transitions are encoded ahead of time.
An LLM-based system can move some of that control flow into inference. The developer exposes a bounded set of operations. The model looks at the current state, chooses the next operation, receives the result and decides again.
The program is no longer a fixed sequence of calls. Part of the execution path is generated at runtime from the task and the observed state.
Ordinary software architecture does not disappear. It becomes more important.
The model should not own permissions. It should not be trusted to validate its own output. It should not become the source of truth for project state. Those jobs belong to deterministic systems around it.
What changes is the layer between user intent and those systems.
I see a direct application in 3D, game-development and automation pipelines because these environments already contain many small tools with strict inputs.
A Blender pipeline might expose operations such as find_objects, validate_materials, set_render_settings, export_asset or run_scene_check. A game pipeline could expose build commands, localisation checks, asset validation, test execution and project metadata queries.
I would not give a model unrestricted access to Blender's Python API or a project filesystem and hope for the best. A better design is to expose narrow operations with explicit schemas, permissions and observable results.
The model handles intent:
"Prepare the selected product models for web export, keep the current materials, flag anything above the polygon budget, and do not overwrite existing files."
The pipeline handles truth:
which objects are selected, what the polygon budget is, whether the destination exists, whether overwriting is allowed, and whether the export passed validation.
Language models can resolve instructions that are awkward to encode as rigid command syntax; production software can enforce the constraints.
For founders, the practical implication is that an AI feature should not be designed only as a chat surface. The more capable pattern is a model surrounded by typed tools, state, validation and logs.
The quality of those interfaces may matter as much as the model choice.
I expect tool interfaces to become a normal part of application architecture for LLMs.
Models will probably get better at selecting tools, chaining them and recovering when an operation fails. The bigger change may happen outside the model: developers will expose more software capabilities as machine-readable operations rather than UI-only actions.
That could create a new abstraction layer over existing applications. Instead of building a separate natural-language workflow for every feature, software can expose a controlled set of capabilities and let the model compose them according to intent.
Long chains still amplify errors. A wrong early decision changes the state seen by later steps. Production systems will need checkpoints, validation and clear completion criteria rather than assuming that a stronger model solves orchestration automatically.
For this reason, I do not think the future is "the model replaces the application."
I think the model becomes part of the application's execution architecture.
The transition from text generation to tool use is the first clear sign. Once a model can choose operations, run code, inspect results and continue from changed state, calling it a text generator starts to describe only the smallest part of what the system is doing.
More