Before you start
Set up your notebook
Every lesson has a notebook that runs in your browser on Google Colab. To use it you need two API keys, one for Gemini and one for Tavily. Both are free to create. Setup takes about 10 minutes, and you don't need to install anything on your computer.
Already use Jupyter and want to run the notebooks on your own machine? Create your keys in step 1, then skip to Alternative: run it locally with Jupyter.
Create your two API keys
Gemini API key
This one runs the model in every lesson.
- Go to aistudio.google.com/apikey and sign in with your Google account.
- Click Create API key, then copy it.
It's free, and you don't need a card.
Tavily API key
This one runs web search, which you'll need from Lesson 3.
- Sign up at app.tavily.com.
- Copy the key from your dashboard. It starts with
tvly-.
The free plan gives you 1,000 searches a month, and you don't need a card.
Save the keys in Colab
- Open the Lesson 1 notebook from the watch page.
- In the left sidebar, click the 🔑 key icon (Secrets).
- Click Add new secret. Set the name to
GEMINI_API_KEYand paste your Gemini key as the value. - Add a second secret. Set the name to
TAVILY_API_KEYand paste your Tavily key. - Turn on Notebook access for both keys.
Type the names exactly as shown: all caps, with underscores. The notebook looks for these exact names.
Run the setup cell
- Click ▶ on the first code cell.
- If Colab warns that the notebook wasn't written by Google, click Run anyway.
- If a pop-up asks to give the notebook access to your secrets, click Grant access.
- The first run takes a few minutes while it installs everything. When it's done, it prints
✓ Ready. - Now run the cells in order, from top to bottom.
Every time you come back
- Turn on Notebook access for both keys in any lesson you haven't opened before.
- The setup cell reinstalls every session. Colab gives you a fresh machine each time, so expect the same few-minute install at the start.
- To keep your changes, use File → Save a copy in Drive. Otherwise your edits are gone when you close the tab.
Troubleshooting
Add your GEMINI_API_KEY first
The notebook can't read your Gemini key. Open 🔑 and check two things:
- the name is exactly
GEMINI_API_KEY - Notebook access is on
Then run the setup cell again.
No TAVILY_API_KEY yet
The notebook can't read your Tavily key. The setup still finishes, and Lessons 1 and 2 don't use web search, so you can carry on. Before you start Lesson 3, open 🔑 and check:
TAVILY_API_KEYis there, with the name exactly as shown- Notebook access is on
Then run the setup cell again.
An error with 429 or RESOURCE_EXHAUSTED
You've hit a free-tier limit on your Gemini key. There are two kinds:
- Per minute: wait a minute, then run the cell again.
- Per day: the daily limit resets at midnight Pacific time. Carry on the next day, or turn on billing for your key in AI Studio if you want to keep going.
Optional
Alternative: run it locally with Jupyter
You don't need this if you're using Colab. It's for anyone who would rather run the notebooks on their own machine.
-
Make a folder for the masterclass
ai-engineering-masterclass/ ├── .env ← your keys ├── notebooks/ ← the lesson notebooks go here └── demo-repo/ ← created for you on the first run -
Download each lesson notebook into
notebooks/In Colab, use File → Download → Download .ipynb.
-
Add your keys
- Download the example env file into
ai-engineering-masterclass/. - Rename it to
.env. - Paste your two keys into it.
On a Mac, Finder hides files whose names start with a dot. Press Cmd + Shift + . to show them.
- Download the example env file into
-
Set up Python
We tested with Python 3.12. Use a virtual environment so the masterclass packages stay separate from everything else. From inside
ai-engineering-masterclass/, run:python3.12 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install notebook jupyter notebook -
Run the setup cell
Open a lesson from
notebooks/and run the setup cell. It installs the same package versions used in the videos and downloads the practice files intodemo-repo/. Each time you come back, activate the environment again before you runjupyter notebook.