Command Palette

Search for a command to run...

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.

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)