Module 01
LLM Mental Model and API Setup
Build an accurate picture of what a large language model does: predict the next token, one at a time, from frozen parameters, with no memory between requests. Then set up OpenAI, Gemini and Claude, read every part of an API call and its response, and learn to use models as programmable reasoning engines while designing around hallucination, knowledge cutoffs and non-determinism.
By the end of this module you can
- explain next-token prediction, tokens, context windows and sampling in plain words, and predict how they affect cost and behaviour
- estimate what an LLM feature will cost in tokens, rupees and dollars before building it
- call OpenAI, Gemini and Claude from Python with keys kept safely in a .env file
- read a full API response, including the stop reason and token usage, and refuse to ship a cut-off or empty reply
- split a task between the model and ordinary code so facts, arithmetic and decisions stay reliable
- choose a model for a job by weighing quality, speed, price and data privacy against your own test examples
Lessons
9 in this module- 01What is a large language model?Explain how an LLM writes by predicting one token at a time, build a tiny next-word model yourself, and use that picture to predict when a model will be fluent but wrong.
- 02Tokens and tokenisationCount tokens with real tokenizers, explain why codes, numbers and Indian-language text cost more, and turn token counts into a realistic monthly budget.
- 03Training vs inference: where the cost goesExplain why models are trained once at enormous cost but billed per token at inference, and use prefill and decode to predict which requests will be slow or expensive.
- 04Context windows and why LLMs forgetExplain why every request starts from nothing, make a model "remember" by resending history, and check that instructions, history and the reply fit inside the context window.
- 05Sampling, temperature and top-pExplain how sampling turns probabilities into a chosen token, compute what temperature and top-p do to them, and choose settings by task while knowing that consistency is not correctness.
- 06Setting up OpenAI, Gemini and Claude accountsCreate OpenAI, Gemini and Claude API accounts, store the keys safely in a .env file, and run one Python script that gets an answer from all three.
- 07Anatomy of an LLM API callRead every part of an LLM request and response, including max tokens, stop sequences, stop reasons and token usage, across OpenAI, Gemini and Claude, and refuse to ship cut-off or empty replies.
- 08LLMs as programmable reasoning enginesProgram an LLM with instructions and data instead of asking it for facts, ground it in real records, and split work so code handles facts, arithmetic and decisions while the model handles language.
- 09Choosing a model: open vs closed, big vs smallChoose a model per job by weighing quality, speed and price, compare open and closed models, and run a small eval of your own instead of trusting leaderboards.