Index Ai Academy
The course

AI engineering from first principles

174 lessons in seven phases. Every lesson runs real Python in your browser, ends with a quiz, and feeds a spaced-repetition review deck. 30 lessons are free, no account needed.

Start the first lesson Create a free account

Phase 0 · 3–4 weeks

Tools

Python, the terminal and calling APIs. 24 lessons, all free to try.

  1. Your first program FreeRun Python, print output, and read an error message without panicking.
  2. Variables FreeGive values names so your program can remember and reuse them.
  3. Numbers and arithmetic FreeIntegers, decimals, rounding, and the math behind every metric.
  4. Strings and f-strings FreeWork with text: join it, slice it, clean it, and format it.
  5. Decisions with if/else FreeCompare values and choose what happens next.
  6. Lists FreeKeep many values in order, then index, slice and change them.
  7. Loops FreeRepeat work over every item without copy-pasting code.
  8. Dictionaries FreeLook values up by name: the shape of almost all real-world data.
  9. Functions FreePackage steps into reusable, testable pieces with inputs and outputs.
  10. Comprehensions FreeFilter and transform a whole collection in one readable line.
  11. Errors and exceptions FreeRead tracebacks, and handle the failures you expect.
  12. Modules and imports FreeUse Python's standard library instead of reinventing it.
  13. Classes and objects FreeBundle data with the functions that work on it.
  14. JSON FreeThe text format APIs and LLMs use to exchange structured data.
  15. Files and CSV data FreeRead and write files, and turn a spreadsheet export into Python data.
  16. NumPy arrays FreeDo math on whole columns at once, the foundation of every ML library.
  17. The terminal FreeNavigate folders and run programs by typing commands.
  18. Version control with git FreeSave snapshots of your work, undo mistakes, and share code.
  19. Packages and environments FreeInstall libraries with pip and keep projects isolated with venv.
  20. How APIs work FreeRequests, responses, methods, status codes and headers.
  21. Calling APIs from Python FreeSend requests, read JSON responses, and handle failures.
  22. API keys and secrets FreeAuthenticate safely and keep keys out of your code.
  23. Your first LLM call FreeSend messages to a model and read its reply, tokens and stop reason.
  24. Capstone: ad-copy reviewer FreeCombine files, functions, JSON and an LLM call into one small tool.
Phase 1 · 6–8 weeks

Building with LLMs

Prompting, retrieval, tools, agents and evals. 31 lessons, 1 free to try.

  1. What an LLM actually does FreeNext-token prediction, and why that produces useful behavior.
  2. Tokens and the context windowHow text becomes tokens, and what fits in one request.
  3. Prompt fundamentalsClear instructions, context and constraints: the 80% of prompting.
  4. System prompts and rolesSet behavior once, separately from the conversation.
  5. Examples in promptsShow the model what good looks like (few-shot prompting).
  6. Structured outputGet reliable JSON back that your code can use.
  7. Prompt chainingBreak big tasks into a pipeline of smaller model calls.
  8. Choosing a modelTrade capability, speed and cost across model families.
  9. Reasoning models and effortWhen models think before answering, and how to control it.
  10. Streaming responsesShow output as it's generated instead of waiting.
  11. Conversations and memoryAPIs are stateless: how chat history and memory really work.
  12. Images and documentsSend screenshots, PDFs and charts as input.
  13. EmbeddingsMeaning as a list of numbers, so text can be compared.
  14. Similarity searchFind the most relevant text by comparing embeddings.
  15. Chunking documentsSplit long documents so the right piece can be retrieved.
  16. Vector databasesStore and search millions of embeddings quickly.
  17. Retrieval-augmented generationAnswer from your own documents instead of the model's memory.
  18. Making RAG goodHybrid search, reranking and citations.
  19. Hallucinations and groundingWhy models make things up, and how to design against it.
  20. Tool useLet the model call your functions (function calling).
  21. The agent loopModel → tool → result → model, until the task is done.
  22. Model Context ProtocolA standard way to plug tools and data into any AI app.
  23. Agent design patternsRouting, orchestrator-workers and when not to build an agent.
  24. LLMs in automationsPut models inside scripts and workflow tools that run on their own.
  25. Prompt injection and securityHow untrusted text hijacks models, and how to limit the damage.
  26. EvalsMeasure output quality with test sets instead of vibes.
  27. LLM-as-judgeGrade open-ended output with rubrics and a second model.
  28. Cost and latencyPrompt caching, batching and routing to cheaper models.
  29. Logging and monitoringSee what your LLM app actually did in production.
  30. Shipping an LLM appDeploy, secure keys, rate-limit and handle failures.
  31. Capstone: research agentA marketing research agent with retrieval, tools and evals.
Phase 2 · 6–8 weeks

Math, when you need it

The linear algebra, calculus and probability models run on. 29 lessons, 1 free to try.

  1. Vectors FreeA list of numbers as a point or an arrow in space.
  2. Vector arithmetic and lengthAdd, scale and measure vectors.
  3. Dot product and cosine similarityThe one operation behind similarity search and attention.
  4. MatricesTables of numbers that hold datasets and model weights.
  5. Matrix multiplicationMany dot products at once: what a neural network layer computes.
  6. Matrices as transformationsA matrix stretches, rotates and projects space.
  7. Transpose, identity and inverseThe matrix operations you'll see in every formula.
  8. TensorsArrays with more axes: batches, sequences, heads.
  9. Eigenvectors (intuition)The directions a transformation leaves pointing the same way.
  10. SVD and PCACompress data to its most important directions.
  11. Functions and graphsRead a graph and see how an output depends on an input.
  12. Exponentials and logarithmsGrowth, decay, and why logs turn products into sums.
  13. DerivativesThe slope at a point: how fast the output changes.
  14. Derivative rulesPower, sum and product rules, so you rarely compute from scratch.
  15. The chain ruleDerivatives of functions inside functions: the heart of backprop.
  16. Partial derivativesChange one input at a time when there are many.
  17. GradientsThe vector of all partial derivatives: which way is uphill.
  18. Optimization by walking downhillRepeatedly step against the gradient to find a minimum.
  19. Probability basicsEvents, outcomes and the rules for combining them.
  20. Conditional probability and BayesUpdate beliefs when new evidence arrives.
  21. DistributionsRandom variables and the shapes their outcomes take.
  22. Mean, variance and spreadExpected value, variance and standard deviation.
  23. The normal distributionThe bell curve, and why it shows up everywhere.
  24. Samples and confidenceEstimate from a sample and say how sure you are.
  25. A/B tests and significanceTell a real lift from noise.
  26. Maximum likelihoodChoose the parameters that make the data most probable.
  27. SoftmaxTurn any list of scores into probabilities.
  28. Entropy and surpriseMeasure uncertainty in bits.
  29. Cross-entropy and KL divergenceThe loss function language models are trained on.
Phase 3 · 4–6 weeks

Machine learning

Learning from data, and knowing when it worked. 24 lessons, 1 free to try.

  1. What machine learning is FreePrograms that learn rules from examples instead of being told them.
  2. Features and labelsSupervised learning: inputs, targets and predictions.
  3. Preparing dataClean, encode and scale data before a model sees it.
  4. Feature engineeringTurn raw data into signals a model can use.
  5. Train, validation and test setsHold data back so you can trust your results.
  6. Linear regressionFit a line, and predict numbers from features.
  7. Loss functionsOne number that says how wrong the model is.
  8. Training with gradient descentAdjust weights step by step to reduce the loss.
  9. Learning rateStep size, convergence and divergence.
  10. Logistic regressionPredict probabilities for yes/no outcomes.
  11. Multiclass classificationSoftmax and cross-entropy for more than two classes.
  12. Decision treesLearn a flowchart of yes/no questions.
  13. Random forests and boostingMany weak models voting beat one strong one.
  14. Nearest neighborsPredict from the most similar examples.
  15. Overfitting and underfittingMemorizing versus learning.
  16. RegularizationPenalize complexity so models generalize.
  17. Bias and varianceThe two ways a model can be wrong.
  18. Precision, recall and F1Accuracy lies; these don't.
  19. ROC curves and AUCJudge a classifier across every threshold.
  20. Cross-validationReuse limited data for more reliable estimates.
  21. ClusteringGroup similar items without labels (k-means).
  22. Dimensionality reductionVisualize and compress high-dimensional data.
  23. The scikit-learn workflowFit, predict and evaluate with the standard ML library.
  24. Capstone: churn predictionPredict which customers will leave, and measure it properly.
Phase 4 · 6–8 weeks

Deep learning

Neural networks, backprop and training them well. 23 lessons, 1 free to try.

  1. The artificial neuron FreeWeighted sum plus a nonlinearity.
  2. Activation functionsReLU, sigmoid, GELU, and why nonlinearity matters.
  3. Multi-layer networksStack layers to learn complex functions.
  4. The forward passFollow numbers through a network to a prediction.
  5. Computation graphsEvery calculation as a graph of small operations.
  6. BackpropagationThe chain rule applied backwards to get every gradient.
  7. Build an autograd engineWrite backprop yourself in ~100 lines (micrograd).
  8. Weight initializationStart weights at the right scale.
  9. The training loopForward, loss, backward, step, repeat.
  10. Mini-batches and SGDTrain on small random batches instead of everything at once.
  11. OptimizersMomentum and Adam.
  12. Normalization layersBatch and layer norm keep training stable.
  13. DropoutRandomly switch off neurons to prevent overfitting.
  14. Vanishing and exploding gradientsWhy deep networks were hard to train.
  15. Debugging trainingRead loss curves and fix what's wrong.
  16. Residual connectionsSkip connections that let gradients flow.
  17. Convolutional networksPattern detectors for images.
  18. Recurrent networksProcess sequences step by step, and their limits.
  19. Embedding layersLearned lookup tables that turn tokens into vectors.
  20. PyTorch tensorsNumPy-like arrays that run on GPUs.
  21. PyTorch autograd and modulesLet PyTorch compute gradients; build models with nn.Module.
  22. GPUs and computeWhy deep learning runs on graphics cards.
  23. Capstone: train a classifierBuild, train and debug a network end to end.
Phase 5 · 6–8 weeks

Transformers

Attention, GPT from scratch and pretraining. 21 lessons, 1 free to try.

  1. Language modeling FreePredict the next token, and score it with cross-entropy.
  2. Tokenization and BPEHow tokenizers are built from data.
  3. A bigram modelThe simplest language model, built from counts.
  4. Sampling strategiesTemperature, top-k and top-p: turning probabilities into text.
  5. Neural language modelsWhy counting fails, and what embeddings fix.
  6. Attention: the intuitionEach token decides which other tokens matter to it.
  7. Queries, keys and valuesThe three projections behind attention.
  8. Scaled dot-product attentionThe attention formula, line by line.
  9. Causal maskingStop tokens from seeing the future.
  10. Multi-head attentionSeveral attention patterns in parallel.
  11. Positional encodingsTell the model where each token sits.
  12. The transformer blockAttention, MLP, residuals and norms together.
  13. The GPT architectureA stack of decoder blocks that predicts the next token.
  14. Build a tiny GPTWrite and train a small GPT from scratch.
  15. Encoders and embedding modelsBERT-style models and where they fit.
  16. Pretraining at scaleData, compute and what models learn from the internet.
  17. Scaling lawsHow loss falls predictably with size, data and compute.
  18. Inference and the KV cacheWhy generation is fast after the first token.
  19. Long contextEfficient attention and million-token windows.
  20. Mixture of expertsRoute each token to a few specialist sub-networks.
  21. Multimodal transformersHow models see images and hear audio.
Phase 6 · 6–8 weeks

Modern LLM engineering

Post-training, fine-tuning, serving and safety. 22 lessons, 1 free to try.

  1. Base models vs assistants FreeWhat post-training adds to a pretrained model.
  2. Supervised fine-tuningTeach behavior from example conversations.
  3. Instruction and preference dataThe datasets that shape assistant behavior.
  4. RLHFReward models and reinforcement learning from human feedback.
  5. DPO and direct preference methodsPreference training without a separate reward model.
  6. Constitutional AITraining with AI feedback guided by written principles.
  7. Training reasoning modelsReinforcement learning on verifiable problems.
  8. Prompting vs RAG vs fine-tuningPick the cheapest approach that works.
  9. LoRAFine-tune a big model by training small low-rank updates.
  10. Fine-tune an open modelRun a real fine-tune and evaluate the result.
  11. DistillationTrain a small model to imitate a large one.
  12. QuantizationStore weights in fewer bits to run models cheaply.
  13. Serving modelsBatching, throughput and latency in production.
  14. Speculative decodingDraft with a small model, verify with a big one.
  15. Running open models locallyDownload, quantize and run a model on your own machine.
  16. Benchmarks and their limitsWhat leaderboards measure, and what they miss.
  17. InterpretabilityLooking inside models to see what they compute.
  18. Alignment and safetyMaking capable models behave as intended.
  19. Multi-agent systemsCoordinating many agents on one large job.
  20. Evaluating agentsMeasure multi-step, tool-using behavior.
  21. Reading AI papersGet the idea out of a research paper in 30 minutes.
  22. Capstone: a tuned, evaluated assistantFine-tune, evaluate and deploy a specialist assistant.