Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder
Module 1Beginner

LLM Fundamentals for Builders

What you need to know about models to build on them

The working knowledge of language models a builder actually needs: how text is generated, tokens and context, the anatomy of an API call, output controls, reasoning models, failure modes, and how provider APIs and SDKs differ.

Lessons
8
Reading time
72 min
Level
Beginner
Free lessons
1

Lessons in this module

  1. 1.1

    How LLMs Generate Text: A Builder's Mental Model

    Tokens, next-token prediction, training, and instruction tuning — explained through the lens of what it means for the features you build.

    10 minFree
  2. 1.2

    Tokens, Context Windows, and What They Cost

    How text becomes tokens, how to count them, what a context window really limits, and why input and output tokens are priced differently.

    9 min
  3. 1.3

    Anatomy of a Model API Call

    Messages, roles, system prompts, content blocks, stop reasons, and usage — every field of a real request and response, and what each one is for.

    9 min
  4. 1.4

    Output Controls: Max Tokens, Stop Sequences, and Effort

    The knobs you actually have over a model's output in 2026 — length limits, stop sequences, effort levels, and why sampling parameters like temperature are disappearing.

    9 min
  5. 1.5

    Reasoning Models: When Thinking Is Worth Paying For

    How thinking models change latency, cost, and quality inside product features, and how to pick an effort level per feature instead of per app.

    8 min
  6. 1.6

    Why Models Get Things Wrong

    Hallucination, knowledge cutoffs, sycophancy, instruction drift, and refusals — the failure modes you must design around, and the product patterns that contain them.

    9 min
  7. 1.7

    Comparing Provider APIs: Anthropic, OpenAI, and Google

    The same feature built against the three major APIs: where they agree, where they differ, and what that means for portability.

    9 min
  8. 1.8

    SDKs and Abstraction Layers: Provider SDKs vs. the AI SDK

    When to call a provider SDK directly and when a multi-provider toolkit like the Vercel AI SDK earns its place — with the same feature written both ways.

    9 min

About this module

You don't need to train a model to build great AI features, but you do need a working understanding of how language models behave. Developers who skip this step end up debugging symptoms: a classifier that flips its answer, a summary that invents an order number, a bill that doubles for no obvious reason, or a response that silently cuts off mid-sentence. Each of these has a cause you can trace back to how models generate text and how provider APIs work.

This module covers the LLM fundamentals a builder actually uses. You'll learn how next-token prediction, pretraining, and instruction tuning shape model behavior; what tokens are, how to count them, and why output tokens cost more than input; and what every field of a real API request and response is for, from system prompts and content blocks to stop reasons and usage.

From there, the module turns to the controls you have in 2026. Sampling settings like temperature are disappearing from current models, so you'll learn to work with max tokens, stop sequences, effort levels, and thinking instead, and to decide per feature when a reasoning model's extra latency and cost are worth paying. You'll also study the failure modes every AI product must design around: hallucination, knowledge cutoffs, sycophancy, instruction drift, and refusals, with the product patterns that contain each one.

The module ends with portability. You'll build the same feature against the Anthropic, OpenAI, and Google Gemini APIs, normalize the results behind one type, and compare calling provider SDKs directly with using a multi-provider toolkit like the Vercel AI SDK. Every lesson uses TypeScript examples that compile against current SDKs, built around a realistic help-desk app.

Questions about LLM Fundamentals for Builders

Do I need to understand machine learning to build with LLMs?

No. You need a practical mental model, not the math: a model predicts one token at a time from the context you send, its knowledge comes from training with a cutoff date, and it only knows what is in each request. That's enough to design, debug, and price AI features well.

What is a context window in an LLM?

The context window is the maximum number of tokens a model can handle in one request, covering your instructions, the conversation, any documents, and the generated output. Current frontier models have very large windows, but fitting more in doesn't guarantee the model uses all of it well, and every token adds cost and latency.

Why are output tokens more expensive than input tokens?

Input tokens are processed in parallel in a single pass, while output tokens are generated one at a time, each needing another step through the model. That sequential work costs more compute per token, so providers price output several times higher than input. Thinking tokens from reasoning models are billed as output too.

Is temperature still used with modern LLMs?

Less and less. Current Claude models reject temperature, top_p, and top_k, and other providers' reasoning models either reject them or recommend leaving them at defaults. For consistent output, use clear criteria, examples, and structured outputs; for variety, ask for several distinct options in one call.

Should I use the Vercel AI SDK or a provider's own SDK?

Use the AI SDK when you're building streaming chat or UI in React and Next.js, or need several providers behind one interface. Use the provider's SDK for backend jobs and features that depend on provider-specific capabilities like prompt caching controls, citations, or batch processing. Mixing both in one app is common.