Skip to content
All patterns
LLM Applications

Basic LLM application

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.

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
When to use
  • Prototypes and demos
  • Stateless utilities (summarise this, translate this)
  • Internal developer tools with trusted users
When NOT to use
  • Anything touching private data (use RAG)
  • Anything requiring action (use Agents)
  • Customer-facing products without guardrails
Failure modes
  • Prompt injection via user input
  • Token cost blowouts from unbounded input
  • No streaming — high time-to-first-token
  • No retries — single provider failure breaks the app
Production checklist
  • Input validation and length limits
  • Streaming responses
  • Retry with exponential backoff
  • Rate limiting per user
  • Prompt injection defence
  • Cost monitoring and budgets
  • Logging of prompts and responses (PII-aware)