INTERACTIVE EXPLAINER · EXP-0018 LAYERS · 24 COMPONENTS

FROM CHAT BOX TO GPU AND BACK

How an AI response gets made

Follow one request through the software and hardware that runs a language model, then watch each generated token—a small unit of text—return to the chat box.

8 LAYERS / 24 COMPONENTS

EXPLORE THE EIGHT LAYERS

START HERE
Follow one request, step by step

A guided, plain-English trip through the software and hardware that runs the model. Each stop opens the exact component doing the work.

Exploded view: How an AI response gets madeInteractive layers show a request moving from an application to graphics processor hardware and generated text returning to the application.REQUEST DOWN / TOKENS BACK08 LAYERS · NOT TO SCALETOKENSREQTOK
REQUEST TOKENS

The application gathers the text, instructions, and available tools the model needs.

The chat box becomes a request the server can read. It names the model, orders the messages, describes any tools, sets rules for choosing words, and asks the server to return text as it is generated.

Primary budget
input tokens
assemble mechanism schematicPROMPT ASSEMBLY / ORDERED INPUT SEGMENTS BECOME ONE MODEL REQUEST
  1. 01INSTRUCTIONS
  2. 02HISTORY
  3. 03CONTEXT
  4. 04REQUEST
  5. 05PROMPT
PROMPT ASSEMBLY / ORDERED INPUT SEGMENTS BECOME ONE MODEL REQUEST
COMPONENT / PROMPT

Prompt assembler

Reading the animation: Four labeled segments—Instructions, History, Context, and Request—slide together and leave as one prompt.

Combines the instructions, earlier messages, reference material, and the user’s latest request.

WORKED EXAMPLE

Four inputs become one ordered prompt

system: Answer for a beginner. | history: 2 messages | context: DNS notes | user: Why cache DNS?
Instructions
Answer for a beginner.
History
the previous two messages
Reference context
retrieved DNS notes
Latest request
Why cache DNS?
Output
one ordered model message list

This step orders the messages, removes text that will not fit, and keeps repeated instructions stable so the server may reuse earlier work.

In engineering terms: Engineers call this prompt assembly. The finished prompt is the complete, ordered text the model receives for this turn.

FOLLOW THIS EXAMPLE

  1. 01

    Place system instructions before the conversation they govern.

  2. 02

    Append earlier messages and any retrieved reference material in a stable order.

  3. 03

    Add the latest request, count the tokens, and trim lower-priority material if the prompt is too large.

  4. 04

    Send one ordered message list to the model endpoint.

Measurements, controls, and tradeoff
Useful evidence
Input-token count, context-window use, truncated messages, and prompt-cache hits.
Controls
Message order, retrieval limits, history compression, and which stable prefixes appear first.
Tradeoff
More context can improve the answer while increasing cost, first-token delay, and the chance that useful instructions become buried.
Output
ordered messages
Definitions and sources

TERMS IN THIS VIEW

Prompt
The full input sent to the model, including instructions, conversation history, retrieved material, and the latest request.
Token
A small unit of text the model reads or writes. A token can be a whole word, part of a word, punctuation, or whitespace.
Context window
The maximum amount of text a model can consider in one request, measured in tokens.
Prefix cache
Saved attention state for an input prefix shared by later requests, such as a repeated system instruction.

SOURCES + CONTINUE READING

  1. [01]Prompts and message rolesVercel AI SDK docs
  2. [02]Prompt engineering for toolsVercel AI SDK docs

Why it matters: The amount and arrangement of input text affect cost, speed, and how much room remains in the model’s context window.

Definitions for this layer

TERMS IN THIS VIEW

Token
A small unit of text the model reads or writes. A token can be a whole word, part of a word, punctuation, or whitespace.
Prompt
The full input sent to the model, including instructions, conversation history, retrieved material, and the latest request.
AI SDK
A software development kit: reusable code that helps an application format model requests, stream responses, and call tools.
Tool schema
A structured description of a function the model may call, including its name, purpose, and accepted arguments.
Show 2 more definitions
Streaming
Returning a response in small pieces as they are generated so the user can begin reading before the full response is complete.
Context window
The maximum amount of text a model can consider in one request, measured in tokens.
ZACKPROSER.COM / EXPLODEDzackproser.com/demos/exploded-inference-stackUPDATED 2026.08.09
All eight inference layers expanded to show twenty-four labeled components

Every layer, fully expanded.

The shareable PNG shows all eight layers and all twenty-four components at once. Keep it beside the interactive version as a map, send it to a teammate, or use it while reading about inference.

Resolution
2400 × 3000 PNG
Contents
8 layers · 24 components
Attribution
URL included in the image

Follow the path from concept to measured performance.

BLUEPRINT DEEP DIVERead how an inference engine works

Walk through scheduling, memory, kernels, and hardware with the full written explanation.

INTERACTIVE BENCHMARKCompare local and cloud model performance

Explore measured quality, speed, energy, and cost across real coding workloads.