GuideAdvanced

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
Free
access
NIEVA

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.

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

Start whenever you like

Reviews

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!