Free module
Calling language models from code
Learn to call language models from code hands on: messages, parameters, streaming, retries and a command-line assistant.
The lessons
Each lesson is free to read in full. Create a free account to run its commands in a live lab and to sit its quizzes and tasks.
1 · Container lab
System, user and assistant messages
I can build the list of messages that a language model call takes.
Read the lesson2 · Container lab
Temperature and max tokens
I can say what temperature, a token limit and stop text change in a model call.
Read the lesson3 · Container lab
Streaming responses from an LLM API
I can read an answer that arrives in pieces and join it into one text.
Read the lesson4 · Container lab
Retrying LLM API errors and rate limits
I can tell a failure to retry from a failure to fix.
Read the lesson5 · Container lab
How to choose a language model
I can choose a model for a job and say why.
Read the lesson6 · Container lab
Build a command-line chatbot
I can put model calls together into a program that a person can use.
Read the lesson
Worked in a real lab
Every lesson of this module is worked in a lab started for you alone. The labs it uses:
Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.