By the end, you can call a model from Python. You can send it text and pictures, get clean data back, and let it use your code.
You learn this in six short notebooks. A notebook is a page of text and code that you run one block at a time.
- Python developers who are new to model APIs. An API is a way for your code to talk to another program.
- People who want a one day tour of the main ideas, with code they can run and change.
- Not for you if you have never written Python, or if you want to train your own model.
- uv, which installs Python and the packages.
- Git, to copy the repo to your computer.
- An Anthropic API key from the Claude Console. Model calls cost money.
- Docker, only if you choose to run the notebooks in Docker.
- Copy the repo and install the packages.
git clone https://github.com/learnwithparam/ai-foundation-workshop.git
cd ai-foundation-workshop
make setupExpect: the last line says Now paste your key into .env.
- Open the new
.envfile and paste your key afterANTHROPIC_API_KEY=. Git never saves this file.
Expect: the file has your key on that line.
- Run every notebook with a fake model. This is free and needs no key.
make testExpect: the last line says OK.
- Open the notebooks.
make runExpect: JupyterLab opens in your browser. Start with 01-text-generation.ipynb and run one cell at a time.
- Run the small weather helper from lesson 5 on a real model.
uv run python mcp_agent.pyExpect: a line that starts with Called get_weather, then a line that starts with Answer:. The weather is made-up sample data.
- If you prefer Docker, use it in place of step 4.
make upExpect: JupyterLab answers at http://localhost:8888. Run make down to stop it.
A run stops once it has spent 1 US dollar, by the repo's own estimate. Set SPEND_CAP_USD in .env to change that limit.
Every notebook asks for a model through llm.py. That one file picks the model, so you can change it in one place. Lesson 5 also starts a small program that offers tools.
flowchart LR
Notebooks[Six notebooks] --> Wrapper[llm.py]
Wrapper --> Model[A model API]
Model --> Wrapper
Notebooks --> Agent[mcp_agent.py]
Agent --> Wrapper
Agent <--> Server[mcp_weather.py tool server]
A real run of lesson 4. The model asks for the weather and a search at once, then does the math:
| File | Lesson | What you build |
|---|---|---|
01-text-generation.ipynb |
Text generation and chat: your first AI conversation | A chat that remembers and streams its reply |
02-multimodal.ipynb |
Images and text: teaching a model to look | Code that reads photos, charts and bills |
03-structured-outputs.ipynb |
Structured outputs: turning text into data | A reader that turns plain text into fields |
04-tools.ipynb |
Tools: letting a model use your code | A loop that runs your functions for the model |
05-mcp.ipynb |
MCP: one standard way to plug in tools | A tool server and a client that uses it |
06-reasoning-models.ipynb |
Reasoning: giving a model room to think | A solver that shows a summary of its thinking |
Other files you will meet:
| File | What it does |
|---|---|
llm.py |
The only place that calls a model |
mcp_weather.py |
A weather tool server with made-up data |
mcp_agent.py |
A client that lets a model use that server |
scripts/draw_images.py |
Draws the pictures in images/ |
The notebooks use Claude unless you say otherwise. The fast model is anthropic/claude-haiku-5-5. The harder steps use anthropic/claude-sonnet-5-5.
To use another provider, set these lines in .env:
LITELLM_MODELfor the fast model.LITELLM_STRONG_MODELfor the harder steps.- The key for that provider.
env.exampleshows the name of each key.
Your model must handle the thing each lesson uses. Lesson 2 needs a model that reads pictures. Lessons 3 and 4 need structured outputs and tools. Lesson 6 sends Claude's thinking setting, and other providers may refuse it.
Take the matching course on learnwithparam.com.
