Ship it and know the bill
Package your assistant so it runs the same anywhere, keep secrets out of the package, and work out what a request costs.
-
Put the harness behind two HTTP routes: /health and /ask
Run this to check
curl -s localhost:8080/healthYou pass when
{"status":"ok"} from the server running on your machine.
Files you write
- app.py
-
Write a Dockerfile and run the image with keys passed in at start
Run this to check
docker build -t parcel-desk . && docker run -d --name pd -p 8080:8080 --env-file .env parcel-desk && sleep 3 && curl -s localhost:8080/healthYou pass when
The same health answer, now from the container.
Files you write
- Dockerfile
- .dockerignore
-
Check that no key is inside the image
Run this to check
docker history --no-trunc parcel-desk | grep -c -i "api_key"; docker run --rm --entrypoint ls parcel-desk -aYou pass when
The count is 0 and no .env file is listed. Keys arrive when the container starts, never when it is built.
-
Send 50 requests and work out the cost of one
Run this to check
uv run --with requests load.py --n 50You pass when
Average seconds and average cost per request, and what 1,000 requests a day would cost a month.
Files you write
- load.py
- COST.md
-
Stop everything the course started
Leaving things running is how a free experiment becomes a bill. Make teardown the last step of every delivery.
Run this to check
docker rm -f pd learn-pg learn-qdrant; docker ps --format "{{.Names}}"You pass when
None of the lab containers are listed. Stop Langfuse with docker compose down in its folder.