Sign in Publish

What is an LLM context?

What is it?

A context is a set of instructions and examples given to the AI model before the user's question. It steers the answer without retraining anything: this is in-context learning.

When to use it

  • Get answers in a precise format (JSON, table, brand tone).
  • Teach the model a task with a few examples (few-shot).
  • Give the model up-to-date or company-specific knowledge.

Page fields

TypeFew-shot (examples), system instruction, knowledge or persona.
System instructionThe model's role and rules.
ExamplesInput / expected output pairs; 2 to 10 are often enough.
KnowledgeReference text the model must use.
Target modelGeneral, or a family and specific model it was tuned for.

How to use it

“Use” tab: copy the JSON and inject the messages before the user's question. A Python example with the Anthropic API is provided.

Browse Contexts →