Skip to main content

Large Language Models (LLM)

Quick reference: LLM Cheatsheet

An LLM is a next-token predictor trained on huge text corpora, then tuned to follow instructions. As a developer you call it over an HTTP API (or run open weights locally) and turn its text output into product features.

What a developer must know​

  • It is stateless: every request must carry the whole conversation (system prompt + messages + tool results).
  • Everything is tokens: input and output are billed, limited and timed in tokens, not characters.
  • Output is probabilistic: same prompt, different answers. Design for variance (validation, retries, evals).
  • It does not know your data: give it context (RAG, tools) instead of expecting it to remember.
  • It can be wrong confidently: ground answers in sources and verify anything with consequences.
  • Untrusted text is code-like: anything in the context can steer the model (prompt injection).
  • Measure, do not guess: evals decide model choice, prompt changes and regressions.

Request lifecycle​

Pages in this section​

PageCovers
CheatsheetOne-page refresh, SDK versions, current models
Tokens, Context & SamplingTokens, context windows, temperature, top-p, max tokens
Prompt EngineeringSystem prompts, structure, examples, iteration
Structured Output & Tool CallingJSON schemas, function calling, the tool loop
RAGEmbeddings, chunking, vector DBs, hybrid search, reranking
Agents & MCPAgent loops, Model Context Protocol servers and clients
EvalsTest sets, graders, LLM-as-judge, regression checks
SecurityHallucination, prompt injection, data leakage
Cost & LatencyPrompt caching, batching, streaming, model routing
Prompting vs RAG vs Fine-tuningWhich lever to pull first
Local ModelsOllama, llama.cpp, vLLM, open weights
Model LandscapeVendors and current model families