GuideIntermediate
Building with LLMs in Code
Integrate an LLM into a real product from code, not from an experimentation notebook. This guide works directly against the provider's SDK — on purpose, so you understand what a framework abstracts away before you adopt one — across eight modules: treating the LLM as just another dependency of your software (non-deterministic, billed by token), building your first serious integration with your own client, keeping prompts as versioned code, getting structured, validated outputs instead of parsing free text, giving the model tools through tool calling controlled by your code, streaming responses, hardening the integration against real provider failures, and evaluating and shipping with an eval suite that tells you whether a change made the system better or worse. The final project is a production-ready support-ticket triage service: Pydantic-validated classification, streaming responses, real tools, retries, caching, cost control, and evals running in CI.
- 64
- lessons
- 8
- modules
- English · Spanish
- available in
- Included in the Club
- access
Outcomes
What you'll be able to do
- Decide with judgment when a problem calls for an LLM versus regular code, calculating the cost of a call before writing it and measuring its real latency afterward
- Build your own reusable LLM client, with correct secrets handling, multi-turn conversations, and context-window management
- Keep your prompts as versioned, tested artifacts, separate from user data, avoiding the anti-patterns that break integrations
- Get back objects that satisfy a defined schema, validated with Pydantic, instead of parsing free text with regular expressions
- Define tools with a schema and run the full call-execute-respond cycle with validation and safety limits, without it turning into an autonomous agent
- Stream an LLM response from your own API with Server-Sent Events, handling cancellation and timeouts
- Harden an integration for production: retries with exponential backoff, idempotency, timeouts, fallbacks, and response caching
- Measure and budget cost per token, per function, and per user, and set hard spending limits
- Build an eval suite — deterministic checks plus LLM-as-judge — that runs in CI and tells you whether a prompt or model change made the system better or worse
Before you start
What you need to bring
It's for you if...
- Backend or fullstack devs who need to integrate an LLM into a real product, not just experiment in a notebook
- Teams that already have an LLM integration in production and want to harden it — retries, cost, evals — before it fails on real users
- Devs who prefer working directly against the provider's SDK and want to understand what a framework abstracts away before adopting one
- Anyone who needs to decide, with data, whether a problem deserves an LLM or whether a regex or a SQL query does the job better
Requirements and materials
- Intermediate Python: functions, classes, exception handling, virtual environments, `pip`
- HTTP and REST API fundamentals, and having built or consumed at least one API with FastAPI or equivalent
- An API key from a provider (Anthropic or OpenAI) with a minimum balance; the guide's total cost runs a few dollars
Content
The syllabus, module by module
Open any of them to see its lessons.
- 1. Introduction: building with AI, not just using it
- 2. What an LLM is for a developer
- 3. Tokens: the unit of work and billing
- 4. The API contract: messages, roles, and response
- 5. Non-determinism: why your tests are going to hurt
- 6. When an LLM is the wrong tool
- 7. Providers: choosing one without marrying it
- 8. Project: your first call, measured
- 1. Introduction: from loose script to reusable client
- 2. Installation, API keys, and secrets handling
- 3. Anatomy of a call: system, messages, and response
- 4. The parameters that actually matter
- 5. Multi-turn conversations: keeping the history
- 6. Context window: what fits and what to do when it doesn't
- 7. Wrapping the SDK behind your own interface
- 8. Project: reusable `llm_client` module
- 1. Introduction: the prompt is part of your source code
- 2. Anatomy of a production prompt
- 3. Examples in the prompt: when they help and when they get in the way
- 4. Templates: separating instruction from data
- 5. Versioning and reviewing prompts
- 6. User data and delimiters: the first defense
- 7. Antipatterns that break integrations
- 8. Project: versioned prompt catalog
- 1. Introduction: the model returns data, not paragraphs
- 2. Why parsing free text is technical debt
- 3. Asking for JSON for real: JSON mode and schemas
- 4. Pydantic as the contract between the model and your code
- 5. Validation and recovery when the output arrives wrong
- 6. Enums and classification: narrowing the response space
- 7. Structured extraction in practice
- 8. Project: data extractor with strict validation
- 1. Introduction: what tool calling is and what it is not
- 2. Defining a tool: name, description, and parameters
- 3. The full loop: the model asks, you execute, you respond
- 4. Executing tools safely
- 5. Multiple tools: how the model chooses and how you guide it
- 6. When the model gets the tool or the arguments wrong
- 7. Tool or plain code: where to put the decision
- 8. Project: assistant with three real tools
- 1. Introduction: latency is a product problem
- 2. How streaming works under the hood
- 3. Consuming a stream from Python
- 4. Exposing streaming from your own API
- 5. Streaming with tools and structured outputs
- 6. Cancellation, timeouts, and users who leave
- 7. UX patterns for model latency
- 8. Project: streaming chat endpoint
- 1. Introduction: what breaks when there are real users
- 2. Catalog of LLM API failures
- 3. Retries with exponential backoff and jitter
- 4. Idempotency: not paying or acting twice
- 5. Timeouts, fallbacks, and graceful degradation
- 6. Caching: what can be reused and how much it saves
- 7. Cost per token in practice: measure, budget, limit
- 8. Project: hardening your LLM client
- 1. Introduction: you can't ship what you can't measure
- 2. Why traditional QA breaks with LLMs
- 3. Building an evaluation dataset that's actually useful
- 4. Deterministic evals: what can actually be asserted
- 5. LLM as judge: the basics and its limits
- 6. Logging, tracing, and privacy
- 7. Minimum security for an LLM feature
- 8. Final project: production-ready LLM service
Where it fits
This guide is part of something bigger
It's studied inside these programs, with support and dates.
Common questions
What people usually ask
As long as your Club subscription is active. If you cancel and come back later, you get the access and your progress back.
No. Modules run from easier to harder, but you can jump to the one you need. Progress is saved per lesson.
Whatever is needed is listed under “What you need to bring”, above. If nothing is listed there, you can start from zero.
In the Club's WhatsApp group, and every two weeks there's a live with an instructor where questions get worked through.
No. This guide is self-paced with no dates. The bootcamp is live, by cohort, with work someone reviews.
Start whenever you like
What students say
These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.
No approved reviews yet.
Be the first to share your experience!