All labs · Lab 41 · intermediate · 40 min

See every step: traces

Record every model call and tool call of a run so you can see where the time and money went.

You build: A local tracing dashboard showing one run of your harness, step by step, with cost.

  • Docker
  • Python 3.11 or newer and uv
  • Lab 30 done
  1. 01Start Langfuse on your machine

    git clone https://github.com/langfuse/langfuse.git && cd langfuse && docker compose up -d

    You pass when: The containers start. The first start pulls several images and takes a few minutes.

  2. 02Check that it answers

    curl -s -o /dev/null -w "%{http_code}\n" http://localhost:3000/api/public/health

    You pass when: 200. Open http://localhost:3000, create a local account and a project, and copy its two keys into your environment.

  3. 03Send one span per model call and per tool call from your harness

    uv run --with openai --with langfuse harness.py "Which file here is the largest?"

    You pass when: One new trace in the dashboard, with tool calls nested under the run and token counts on each model call.

  4. 04Find the slowest step and the most expensive step of that run

    cat TRACE-NOTES.md

    You pass when: Two lines naming each step, with its seconds and cost, and one idea to cut each.

The check runs on the computer, not on your word: a step passes when its command exits with 0 there.

Your computer · Fleet · off

Computers are not set up on this site yet. Run each command on your own machine and compare with "You pass when".