Skip to content

About

Hands-on AI foundation workshop material for building real AI and web apps.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

AI foundation workshop

Objective

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.

Who it is for

  • 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.

Before you start

  • 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.

Run it

  1. Copy the repo and install the packages.
git clone https://github.com/learnwithparam/ai-foundation-workshop.git
cd ai-foundation-workshop
make setup

Expect: the last line says Now paste your key into .env.

  1. Open the new .env file and paste your key after ANTHROPIC_API_KEY=. Git never saves this file.

Expect: the file has your key on that line.

  1. Run every notebook with a fake model. This is free and needs no key.
make test

Expect: the last line says OK.

  1. Open the notebooks.
make run

Expect: JupyterLab opens in your browser. Start with 01-text-generation.ipynb and run one cell at a time.

  1. Run the small weather helper from lesson 5 on a real model.
uv run python mcp_agent.py

Expect: a line that starts with Called get_weather, then a line that starts with Answer:. The weather is made-up sample data.

  1. If you prefer Docker, use it in place of step 4.
make up

Expect: 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.

The picture

Six notebooks send their requests through one file, llm.py, to a model API.

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]
Loading

A real run of lesson 4. The model asks for the weather and a search at once, then does the math:

A real run of lesson 4. The model asks for the weather and a search at once, then does the math

Lessons

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/

Switch provider

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:

  1. LITELLM_MODEL for the fast model.
  2. LITELLM_STRONG_MODEL for the harder steps.
  3. The key for that provider. env.example shows 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.

Where to go next

Take the matching course on learnwithparam.com.

About

Hands-on AI foundation workshop material for building real AI and web apps.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages