The simplest production LLM application: a UI calls an API which calls the model. Everything else is built on top of this shape.
How a request travels through a basic LLM application
Step 1 of 5
UI
The user types a question and the web UI posts it to your API. The UI never talks to the model provider directly, so your key stays on the server.
Step 2 of 5
API
The API checks the input length, then builds the prompt: a fixed system instruction plus the user's text. This is the only place you control what the model sees.
Step 3 of 5
LLM
The provider SDK sends the prompt to the model, which generates the reply token by token. The model keeps no memory: the next request starts from nothing.
Step 4 of 5
Stream back
The API forwards tokens to the UI as they arrive, so the first words appear quickly instead of after the whole answer is done.
Step 5 of 5
Gaps
Nothing here validates input, retries a failed call, or filters the reply. Prompt injection and cost blowouts are open, which is why guardrails, retries and limits come next.
Three boxes and one prompt: everything else in this section is built on this shape.
clientservicemodeldatabaseagentexternal
Explanation
A client sends a request to your API. The API constructs a prompt, calls the LLM provider, and returns the response to the UI. This is the foundation — but it has no memory, no retrieval, no tools and no safety.
Components
Web UIAPI serverLLM provider SDKStreaming response layer