Day 2 — The Alchemist’s Lab
Day 2 moves from the shell into Python, and from there into calling AI models from your own code. You’ll open JupyterHub and run Python on the Yens from your browser, build an isolated virtual environment that anyone can rebuild from a requirements.txt, and then work with Stanford’s AI API Gateway: loading a key from a .env file, extracting structured fields out of real SEC filings, and validating what comes back with Pydantic so bad output fails loudly instead of quietly. The day closes on the judgment that surrounds all of it — which data you’re allowed to send where, what a run costs, and which calls a human still has to make.
Duration: ~3 hours

Sections
Work through the sections in order — later ones build on earlier ones, and the Day 2 Challenge draws on everything you’ve learned.
| Section | Format | What you’ll learn |
|---|---|---|
| Running Python on the Yens | 💻 Hands-on | How $PATH decides which python3 answers, JupyterHub in your browser, and the three ways to run Python — interpreter, notebook, and script |
| Python Environments | 💻 Hands-on | Build an isolated virtual environment, register it as a JupyterHub kernel, and rebuild any project from its requirements.txt |
| Stanford’s AI Services | 🖊️💬 Concept + demo | The AI Playground chat window vs. the AI API Gateway for code, and which data-risk levels each one is cleared for |
| Managing API Keys | 💻 Hands-on | Load a key from .env, keep it out of git, and know why a committed key is a leaked key |
| Extracting Data with an LLM API | 💻 Hands-on | Your first API call, then pulling structured fields out of real SEC filings — validated with Pydantic, and moved from a notebook into a logged script |
| AI Agents & Data Privacy | 💬 Discussion | What coding agents send to remote servers, how to classify your data, what each path costs, and how to keep a pipeline defensible |
| Day 2 Challenge | 🔑 Capstone | Scale a research judgment call with LLM-as-a-judge: classify, check it with a second model, then route the contested cases to a human |