Learn Everything

Module · AI Engineer

LLM Fundamentals

Tokens, context windows and inference.

2 topics4 interactive tasks

TOPIC 01

Tokens and Context Windows

Why LLMs bill and think in tokens, and how the context window shapes what a model can see.

Tokens and Context Windows

Language models do not read text — they read tokens: chunks of a few characters that the model turns into numbers. Every API call is priced per token, and every model has a hard ceiling called the context window: the maximum number of tokens it can consider at once, prompt and answer combined.

What you'll practice

  • Set a Token Budget — guided · beginner
  • Count the Turns in a Chat Log — challenge · beginner

A command you'll meet

wc -l transcript.txt

Open any task below to get the full step-by-step walkthrough — every command is explained, and the lab validator checks what you actually built.

TOPIC 02

Sampling & Output Contracts

The knobs that shape an answer, and the schema that makes it machine-readable.

What you'll practice

  • Configure the Sampling Knobs — guided · beginner
  • Define a Structured Output Schema — practice · intermediate

A command you'll meet

cat ~/llm-lab/sampling.json

Temperature decides how creative the answer is allowed to be. Open the task below for the full walkthrough.