RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Prompt Engineering Fundamentals
  6. /Ch. 2
Prompt Engineering Fundamentals

02. Prompt Anatomy

Chapter 2 of 25 · 15 min
KEY INSIGHT

A complete prompt has five distinct components—instructions, context, input, format, and constraints—each serving a specific function.

A complete prompt has five components: instructions, context, input data, output format specification, and constraints. Most prompts fail because they omit one or more of these.

Instructions tell the model what to do. They should be imperative sentences: "Extract," "Classify," "Rewrite." Avoid vague verbs like "handle" or "deal with."

Context provides background information the model needs. This includes domain knowledge, user history, or situational details. Without context, models assume generic scenarios.

Input data is the content to process. Always clearly delimit this from instructions. Models can mix your instructions with their interpretation of the data if boundaries are unclear.

Output format specification describes how you want the response structured. This is separate from instructions because format and task are distinct concerns.

Constraints limit acceptable outputs. These include "do not include," "limit to," or "exclude."

INSTRUCTIONS: Classify the sentiment of each review as POSITIVE, NEGATIVE, or NEUTRAL.

CONTEXT: You are analyzing customer feedback for a coffee subscription service. Reviews mention product quality, delivery speed, and customer service.

INPUT DATA:
1. "Arrived on time, beans are fresh" - Rating: 5 stars
2. "Package was damaged but company sent replacement quickly" - Rating: 4 stars
3. "Tastes like burnt cardboard" - Rating: 1 star

OUTPUT FORMAT: Return a JSON array where each item has "review", "sentiment", and "confidence" fields. Confidence is a decimal between 0 and 1.

CONSTRAINTS: Only use the three sentiment labels. Do not infer sentiment from the star rating—use the text content only.

This prompt is verbose but produces consistent results. The verbosity is a feature: it reduces ambiguity.

A common failure is burying constraints in the instructions. "Classify sentiment (do not use the rating)" mixes the task with a constraint. Separating them prevents the model from treating constraints as secondary.

EXERCISE

Take a prompt from your current work and identify which of the five components are present and which are missing. Rewrite it to include all five.

← Chapter 1
The Fundamental Insight
Chapter 3 →
Zero-Shot Prompting