PrerequisitesΒΆ
Complete these steps before the workshop to make sure your environment is ready.
1. Install ToolsΒΆ
Python 3.11+ΒΆ
Download from python.org. Check "Add Python to PATH" during installation.
GitΒΆ
uv (Python package manager)ΒΆ
2. Clone and InstallΒΆ
3. LLM Provider SetupΒΆ
The labs call LLMs via API. You need an API key from one provider. Labs 1 and 2 work on the Gemini free tier, but Labs 3 and 4 make 10-15+ LLM calls per run β more than free-tier rate limits allow. We recommend getting your own paid API key (OpenAI is the cheapest option β the entire workshop costs under $5).
The best option for the full workshop. Cheap, fast, high rate limits.
- Sign up at platform.openai.com
- Add a payment method (credit card required) and set a usage limit β $5 is more than enough for the entire workshop
- Go to API Keys and create a new secret key
- Install dependencies and configure your key:
uv sync --extra openai
cp .env-example .env
# Edit .env β uncomment the OpenAI section, set OPENAI_API_KEY=your-key
| Model | gpt-4o-mini (default) |
| Cost | ~$0.15 per 1M input tokens β the entire workshop costs under $5 |
| Rate limits | 500+ requests/min (pay-as-you-go Tier 1) |
| Works for | All labs |
Free tier, no credit card required β just a Google account. Good for Labs 1 and 2.
- Go to Google AI Studio
- When prompted to select a project, use the default project (usually called "Default Gemini Project" or "Generative Language Client"). Don't create a new project β the Gemini API is already enabled on the default one.
- Click Create API key and copy it
- Install dependencies and configure your key:
| Model | gemini-2.5-flash-lite (default) |
| Cost | Free |
| Rate limits | 15 requests/min, 1,000 requests/day |
| Works for | Labs 1-2 |
Created a new Google Cloud project?
If you created your key in a new project, you'll get an API_KEY_INVALID error. Either recreate the key in the default project, or enable the Generative Language API on your project.
Rate limits for Labs 3+
The free tier allows 15 requests per minute. Lab 3's multi-node agent (ReAct + grounding + critic) makes 10-15+ LLM calls per patient, so you'll hit rate limits. For Lab 3 onward, switch to a paid provider (OpenAI is recommended).
- Sign up at console.anthropic.com
- Add a payment method and go to API Keys to create a key
- Install dependencies and configure your key:
uv sync --extra anthropic
cp .env-example .env
# Edit .env β uncomment the Anthropic section, set ANTHROPIC_API_KEY=your-key
| Model | claude-haiku-4-5-20251001 (default) |
| Cost | ~$1 per 1M input tokens β the entire workshop should cost under $5 |
| Rate limits | 50+ requests/min (pay-as-you-go) |
| Works for | All labs |
The total LLM cost for the entire workshop should not exceed $5 on any paid provider. The workshop uses cheap, fast models β not frontier models β because the goal is learning agent patterns, not benchmarking LLM quality.
See .env-example for all available configuration options.
Verify your API keyΒΆ
After setting up your .env file, confirm the LLM is reachable:
You should see a short greeting. If you get an authentication error, double-check your API key in .env.
Switching providers mid-workshop
Change LLM_PROVIDER and the API key in your .env file, then restart the agent. No code changes needed.
Other free-tier options
If you don't want to pay for an API key, these providers offer free tiers with tool calling and structured output. They aren't pre-configured in app/llm.py but could be added.
| Provider | Free RPM | Free RPD | Best model | Catches |
|---|---|---|---|---|
| Groq | 30 | 1,000 | llama-4-scout-17b-16e-instruct | 30K token/min limit; no credit card needed |
| Cerebras | 30 | 14,400 | llama-3.3-70b | 8K context window cap β test whether your prompts fit |
4. Later-Lab PrerequisitesΒΆ
Docker (Labs 2, 3, 4)ΒΆ
Labs 2, 3, and 4 use Docker Compose for various services (Langfuse, Postgres). Install Docker before the workshop.
Verify it's working:
Pre-pull the images
The Langfuse and Postgres stacks pull container images on first run. To avoid waiting during the labs:
Ollama + Granite Guardian (Lab 3 β optional)ΒΆ
Lab 3 includes a grounding check that compares LLM-as-judge vs. Granite Guardian. The Guardian path is optional β the lab works out of the box with LLM-as-judge grounding. If you want to compare both approaches:
- Install Ollama
- Pull the Granite Guardian model (the
:3btag is required β the model has no default tag):
- Install the optional Python dependency:
Verify Ollama has the model:
Don't toggle without installing
The Grounding toggle in Lab 3's UI will switch to Guardian mode, but the agent will crash if ollama isn't installed or the model isn't pulled. Only flip the toggle if you completed these steps.
Why Ollama?
Granite Guardian runs locally β no API keys, no cloud dependency. Your patient data never leaves your machine, which matters when you're building hallucination detection for healthcare data.
Postgres via Docker (Lab 4)ΒΆ
Lab 4 stores agent concerns in Postgres with Row-Level Security. The database runs in Docker β no local Postgres installation needed.
# Start the Lab 4 Postgres database
docker compose up -d
# Verify it's running
docker compose exec postgres psql -U agent -d agent_store -c "SELECT id, display_name FROM providers;"
You should see three providers: Dr. Sarah Kim, MD; Rachel Torres, NP; and Maria Gonzalez.
5. Start the EHR InboxΒΆ
The workshop uses a simulated Electronic Health Record (EHR) inbox β a patient portal for Lakeview Family Medicine. Start it with a single command:
The EHR API server starts automatically in the background on port 8000.
Open http://localhost:8501 in your browser. You should see the inbox with 12 patients and their portal messages.
Changing ports
The API and UI ports are configurable:
Verify It WorksΒΆ
You should see:
- A patient dropdown at the top (12 patients, some with unread messages)
- Medical records with tabs for Conditions, Medications, Labs, History
- A Concerns panel (empty for now β the agent will populate this)
- An Inbox with patient messages and a conversation viewer
If you can browse patients and read their messages, you're ready.
Next StepsΒΆ
Proceed to Lab 1: The Naive Agent to start building.