Step 1 · Set up
Objective
Section titled “Objective”Get the project running on your machine, with your own keys, and prove it works before spending any quota.
Why this step exists
Section titled “Why this step exists”Most “it doesn’t work” problems in a workshop are environment problems, not code problems. We front-load them and give you a single command that proves the whole setup is sound.
Get the code
Section titled “Get the code”git clone https://github.com/dileepadev/deploying-agentic-ai-apps-workshop.gitcd deploying-agentic-ai-apps-workshop/appThe deployed application is its own uv project, so app/ is where the rest of
this step happens.
Install uv
Section titled “Install uv”uv manages the Python version, the virtual environment, and the packages — one tool instead of four.
curl -LsSf https://astral.sh/uv/install.sh | shpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"brew install uv # or: pipx install uvThen:
uv syncThat reads pyproject.toml and uv.lock, installs the exact versions this
project was tested with, and creates .venv for you. You never need to
activate it — uv run handles that.
Configure your secrets
Section titled “Configure your secrets”cp .env.example .envOpen .env (in app/, next to pyproject.toml) and fill in three values:
| Variable | Where to get it |
|---|---|
LLM_API_KEY |
https://aistudio.google.com/apikey → Create API key |
SUPABASE_URL |
Supabase → Connect (top of the dashboard) → Project URL |
SUPABASE_SECRET_KEY |
Supabase → Settings → API Keys → Secret keys → starts with sb_secret_ |
One more is optional, and you can add it later without changing anything else:
| Variable | Where to get it | What it buys |
|---|---|---|
TAVILY_API_KEY |
https://app.tavily.com → free, no card | Web search, so the agent can answer questions about this week rather than only what Wikipedia has written up |
Leave it blank and everything in this workshop still works — the agent researches with Wikipedia alone, and says so when asked about something recent.
Prove it works
Section titled “Prove it works”Run the tests. They need no API key and no network:
uv run --extra dev pytest................. [100%]17 passedThen start the server:
uv run fastapi dev main.pyExpected result
Section titled “Expected result”Open http://localhost:8000/health. You want:
{"ok": true, "database": true, "provider": "google", "model": "gemini-flash-latest", "web_search": false}Also open http://localhost:8000/docs — FastAPI generates that from your code,
and you’ll use it to test the deployed version later. It follows your system’s
light/dark setting: Swagger UI has had a dark theme since 5.31, and app/main.py
adds the few lines that switch it on.
Install the client
Section titled “Install the client”The frontend is a separate Vite + React app in client/, with its own
dependencies. It needs Node.js 20+ (node --version). From the repo root, in
a second terminal:
cd clientnpm installnpm run devOpen http://localhost:5173. You’ll get the demo UI with
Backend URL already pointing at http://localhost:8000 — leave it there for
now. You won’t have anything to ask it until step 7; this is just to confirm both
halves install.
What usually goes wrong
Section titled “What usually goes wrong”database: false
Your SUPABASE_URL or key is wrong, or the project is paused. Free projects
pause after about a week idle — open the Supabase dashboard and resume it.
You haven’t created the tables yet either — that’s step 2.
database: false at this point is expected if you’ve skipped ahead.
RuntimeError: Missing environment variable: LLM_API_KEY
Working as intended — config fails loudly at startup rather than mysteriously
at request time. Check .env exists in app/ and that there are no quotes
around the values.
If you’re following an older copy of this workshop, the variable used to be
called GEMINI_API_KEY. That name still works.
uv: command not found after installing
The installer added it to a shell profile that your current terminal hasn’t
read. Open a new terminal, or source ~/.bashrc / source ~/.zshrc.
Python version errors
You don’t need to fix your system Python. uv python install 3.12 then
uv sync again — uv will use its own.
What’s next
Section titled “What’s next”You have an environment. Now it needs somewhere to put things.