Appearance
Prompt Engineering , From First Principles to Production
The difference between a prompt that gets a useful answer and one that gets a vague paragraph is not magic. It's engineering. This course treats prompt engineering as a disciplined practice: measurable, testable, and optimizable. Every technique is grounded in how models actually process input , not folk wisdom, not "just be more specific."
Five days, from the anatomy of a single prompt to managing prompt libraries at scale. Every technique works across Claude, Gemini, GPT, and open models , model-specific differences are called out where they matter.
Before you start: tooling you'll need
Every lesson in this course uses real, runnable code. You'll need a working Python environment with the libraries below. If you don't have a Python environment set up, complete Practical Fundamentals first, it covers Linux, Python environments, git, and API keys in about an hour.
Required
| Tool | Version | Purpose | Install |
|---|---|---|---|
| Python | 3.10+ | All code examples | python.org or apt install python3 |
| pip or uv | latest | Package management | Comes with Python; curl -LsSf https://astral.sh/uv/install.sh | sh for uv |
| An API key | , | Calling models | At least one of: Anthropic Console, OpenAI Platform, Google AI Studio, or OpenRouter |
Python libraries (install as you go)
| Library | Used in | Purpose |
|---|---|---|
anthropic | Days 1-5 | Claude API calls |
openai | Days 1-5 | GPT-4 API calls |
google-generativeai | Day 4 | Gemini API calls |
pydantic | Days 2, 4, 5 | Structured output validation |
jinja2 | Day 2 | Prompt templating |
tiktoken | Day 3 | Token counting |
pytest | Days 3, 5 | Benchmark testing |
bash
# Install everything at once
pip install anthropic openai google-generativeai pydantic jinja2 tiktoken pytestAPI key setup
Properly managing API credentials is a fundamental prerequisite for programmatic model access. Exporting these keys securely in your environment ensures your scripts can authenticate without hardcoding secrets.
bash
# At least one of these, in your shell profile or .env file
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export GOOGLE_API_KEY="..."The code examples default to Claude (Anthropic SDK) but include notes for switching to GPT-4 or Gemini. If you only have one provider's key, you can follow every lesson, just substitute the SDK call.
What you won't need
- A GPU or local model, all examples use hosted APIs
- A database or Docker, this course is about prompts, not infrastructure
- Prior ML experience, the course starts from first principles
If you hit a setup issue, the Practical Fundamentals course has step-by-step guides for Python environments, API keys, and package management.
The arc
Day 1 , Foundations: How Models Read Prompts covers what prompt engineering actually is, the anatomy of a prompt, zero-shot and few-shot prompting, system prompts and role assignment, and the instruction hierarchy that determines which parts of a prompt win when they conflict.
Day 2 , Reasoning & Structure covers chain-of-thought prompting, structured output and format control, self-consistency and verification, meta-prompting and self-reflection, and prompt templates with variables.
Day 3 , Context & Optimization covers context window management, prompt compression and summarization, prompt optimization techniques, evaluating prompt quality, and A/B testing prompts.
Day 4 , Advanced Techniques covers tool use and function calling, multi-turn conversation design, prompt chaining and pipelines, retrieval-augmented prompting, and model-specific prompting strategies.
Day 5 , Safety & Production covers prompt injection defense, jailbreak prevention, content safety and guardrails, prompt versioning and CI/CD, and prompt engineering at scale.
Then you build it for real
The Capstone: Build a Prompt Library is a structured, versioned, tested prompt library for a real application , a customer support agent, a code reviewer, or a content pipeline. You'll write the prompts, test them against a benchmark, optimize them, and wrap them in a guardrail system.
This course assumes you can already use an LLM through an API or chat interface. If you're new to working with LLMs programmatically, start with Practical Fundamentals first.