deliver · intermediate · 50 min

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.

HANDS-ON LAB · YOU RUN IT ON YOUR MACHINE · 5 STEPS
  1. Step 1 of 5

    Put the harness behind two HTTP routes: /health and /ask

    Run this to check

    curl -s localhost:8080/health

    You pass when

    {"status":"ok"} from the server running on your machine.

    Files you write

    • app.py
  2. Step 2 of 5

    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/health

    You pass when

    The same health answer, now from the container.

    Files you write

    • Dockerfile
    • .dockerignore
  3. Step 3 of 5

    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 -a

    You pass when

    The count is 0 and no .env file is listed. Keys arrive when the container starts, never when it is built.

  4. Step 4 of 5

    Send 50 requests and work out the cost of one

    Run this to check

    uv run --with requests load.py --n 50

    You 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
  5. Step 5 of 5

    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.

No transcript here on purpose. This page does not show terminal output, because model answers differ from run to run. Each step says what a pass looks like; your own terminal is the proof.