📖Lessons
What are Large Language Models?
Introduction to LLMs, how they work, and when to use them
Tokens and Tokenization
Learn how LLMs break down text into tokens and why it matters for costs and context limits
Context Windows and Memory
Understanding how LLMs handle conversations, long documents, and token limits
Temperature and Sampling
Control LLM creativity and randomness with temperature and sampling parameters
System Prompts and Roles
Learn how to use system prompts to control LLM behavior and define roles
Prompt Engineering Basics
Learn techniques to write better prompts and get higher quality outputs from LLMs
Applied Prompting Patterns
Put prompt techniques to work on real tasks: classification, extraction, sentiment analysis, and structured output
Common Pitfalls and Limitations
Understand what LLMs cannot do well and how to work around their limitations
Workshop: Your First API Call
Build your first LLM-powered application from scratch
🎯Missions
Build a Sentiment Classifier
Nebula Corp's product team wants to automatically classify customer reviews from their app store listing. They need a function that builds a few-shot prompt to classify reviews as Positive, Negative, or Neutral. The current implementation just returns a hardcoded value. Write a prompt-building function that uses few-shot examples to reliably classify sentiment — and make all the test cases pass.
Build an API Response Router
Nebula Corp is building an AI-powered support system. When a customer message comes in, it needs to: (1) call the LLM API to classify the message intent, (2) parse the structured response, and (3) route to the correct handler. The current implementation has broken parsing, missing error handling, and routes everything to the wrong handler. Fix the router so it correctly classifies, parses, and routes messages.
Defend Against Prompt Injection
Nebula Corp's customer support chatbot has been exploited three times this week. Attackers are using prompt injection to make the bot reveal its system prompt, ignore its restrictions, and pretend to be a different AI. The security team needs you to build a defense layer: a function that detects common injection patterns in user input and a hardened system prompt that resists override attempts.
Extract Structured Data from Text
Nebula Corp's finance team receives hundreds of invoices as plain text emails. They need a function that builds a prompt to extract structured JSON data (vendor, amount, date, invoice number) from unstructured invoice text. The current implementation produces a vague prompt that returns inconsistent formats. Build a robust prompt constructor that reliably extracts the right fields as valid JSON.
Fix the Context Window Overflow
Nebula Corp's chatbot keeps crashing with 'context length exceeded' errors in production. The conversation manager is supposed to trim old messages when the token count approaches the model's limit — but the trimming logic has bugs. Some conversations never get trimmed, others lose the system prompt entirely. Debug the conversation manager and make it handle long conversations gracefully.
Fix the Token Cost Calculator
Nebula Corp's billing dashboard has a broken token cost calculator. The function is supposed to estimate API costs based on input tokens, output tokens, and the selected model — but customers are being shown wildly wrong numbers. Some bills show $0 when they should be $5, and others are off by orders of magnitude. Find the bugs in the pricing logic and fix them before finance notices.
One-Shot Email Categorizer
Nebula Corp's support inbox is overflowing. They need an automated triage system that categorizes incoming emails into Billing, Technical, or General using a one-shot prompt. The current function doesn't use any examples and the model keeps returning inconsistent labels. Build a prompt constructor that uses exactly one well-chosen example to teach the model the expected format, and handles any email topic.
Tune the Temperature Settings
Nebula Corp's AI platform lets users run different tasks — data extraction, creative writing, code generation, and chatbot conversations. But the temperature configuration is all wrong: creative tasks use temperature 0, extraction uses temperature 1.5, and the chatbot is set to 2.0. Users are complaining about boring marketing copy and broken JSON outputs. Fix the configuration function so each task type uses an appropriate temperature and top-p setting.
🔧Workshops
A/B Test Prompt Optimizer
Build a tool that automatically A/B tests prompts and selects the best performing variant.
Build a Prompt Template Library
Create a reusable prompt template system with variables, validation, and version control.
Build Streaming Response UI
Implement a beautiful streaming UI with typewriter effect and markdown rendering.
Context Compression Engine
Build a compressor that reduces context size by 60% while maintaining quality.