Module 1 · Phase 1: Foundations from raw APIs · Weeks 1–2
LLM API Mastery
No frameworks. Raw HTTP/SDK calls only. Everything an agent does reduces to these mechanics: the message array, tool calling, structured outputs, streaming, tokens, and robust error handling.
After this module you can
- ▸Explain and implement the chat message format (system/user/assistant/tool roles) from memory
- ▸Implement tool calling end-to-end: schema → model emits call → you execute → return result → model continues
- ▸Produce validated structured outputs with JSON schema and recover from malformed JSON
- ▸Stream responses token-by-token and explain why streaming matters for agent UX
- ▸Count tokens, estimate cost per call, and reason about context-window budgets
- ▸Handle rate limits, timeouts, and refusals with exponential backoff and graceful degradation
Lessons
125 min220 min330 min420 min525 min
Messages Are the Only State
The single most important fact in agent engineering: the model is stateless. A 'conversation' is you resending an ever-growing array. Every agent pattern you'll ever build follows from this.
Sampling Parameters & Streaming
Temperature and top_p control the randomness of token selection — get them wrong and your agent is either erratic or uselessly rigid. Streaming turns dead air into perceived speed.
Tool Calling End-to-End
The mechanism that turns a text generator into something that can act. Crucial mental model: the model never executes anything — it emits structured JSON, and your code does the work.
Structured Outputs & JSON Schema
When you need data, not prose: forcing model output to conform to a schema, and what to do when it doesn't.
Errors, Rate Limits & Cost Control
An agent lives or dies on the unhappy path. Rate limits, timeouts, overloaded servers, refusals, context overflows — production behavior is defined by how you handle these.
Module quiz
12 questions · pass ≥ 80%
Lab: Tool-Calling CLI Assistant
Build a CLI assistant from scratch — raw SDK only, no frameworks — that answers questions using three tools: calculator, get_current_time, and read_file. This is the atom every later lab is built from. Starter code lives in labs/lab01-agent-loop/.
Best external resources
Curated reading, docs, and tools that pair with this module.
Anthropic — Tool use docs
The canonical reference for the message shapes used in Lab 01.
DocsOpenAI — Function calling & structured outputs
Compare the two vendors' shapes — interviews ask about both.
DocsAnthropic Cookbook
Runnable notebooks for every pattern in this module. Run the tool-use ones.
RepoPrompt Engineering Guide
Reference for prompting techniques; skim the basics, bookmark the rest.
GuideOpenAI Cookbook
The other vendor's runnable examples — structured outputs, function calling, streaming.
RepoChip Huyen — AI Engineering (book)
The best book-length treatment of this whole curriculum; chapters 1–2 pair with this module.
Book