Skip to content

Add Hugging Face agent trace analysis cookbook - #102

Merged
DaRubberDuckieee merged 6 commits into
mainfrom
hf-agent-traces-cookbook
Jun 24, 2026
Merged

Add Hugging Face agent trace analysis cookbook#102
DaRubberDuckieee merged 6 commits into
mainfrom
hf-agent-traces-cookbook

Conversation

@DaRubberDuckieee

Copy link
Copy Markdown
Contributor

What

Adds a new cookbook, Analyzing agent traces from Hugging Face in Braintrust, under examples/HuggingFaceAgentTraces/. It's the companion guide to the HF agent trace analysis blog post: how to take 1,781 real agent-eval traces published on Hugging Face (the Exgentic agent-llm-traces dataset), import them into Braintrust, score them with an LLM judge, and analyze them with Topics and SQL.

Contents

  • HuggingFaceAgentTraces.mdx — the walkthrough: import → score → cluster failures with Topics → slice by benchmark/harness/model → build a targeted eval dataset.
  • hf_bt_cookbook/ — the reusable importer scripts (from Izzy Hurley's work):
    • import_logs.py — streams an HF trace dataset into Braintrust Logs as a span tree per session, with deterministic IDs so re-runs upsert (which is also how scores write back).
    • import_dataset.py — turns an HF dataset into a gradable Braintrust Dataset.
    • normalize.py, braintrust_logs.py — message/trace normalization and span-tree helpers.
  • assets/ — Logs view and Topics screenshots.
  • requirements.txt and a registry.yaml entry (author: jesswang).

Notes

  • The importer streams via datasets.load_dataset(..., streaming=True), so there's no need to download the 39 Parquet shards locally.
  • Scoring is shown the way the importer is designed for: judge each session, add the verdict as a column, point SCORE_COLS at it, and re-run — the deterministic IDs upsert the score onto the existing spans.

🤖 Generated with Claude Code

DaRubberDuckieee and others added 6 commits June 22, 2026 11:23
A guide to importing real agent-eval traces from Hugging Face into
Braintrust, scoring them with an LLM judge, and analyzing them with
Topics and SQL. Bundles the reusable hf_bt_cookbook importer scripts
(streaming HF -> Braintrust Logs and Datasets).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Rewrite the judge intro to explain the Braintrust gateway inline
  (OpenAI-compatible endpoint fronting all providers, one key).
- Switch the deprecated proxy endpoint/doc to the gateway
  (https://gateway.braintrust.dev/chat/completions, /docs/deploy/gateway).
- Fix malformed blog-post markdown link.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Give the concrete cross-judge example (GPT-4.1 graded by GPT-4o).
- Add a paragraph on how Topics independently confirmed a failure mode
  we found by hand (the AppWorld false-success case).
- Add the config x benchmark success heatmap after the slicing query.
- Fix a typo in the slicing intro sentence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Drop 'in Braintrust' from the title (STYLE.md forbids appending it).
- Add trailing periods to the 'By the end', 'You'll need', and 'Next steps' bullet lists.
- Link the bt CLI mention to /reference/cli/quickstart.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Show the OpenTelemetry GenAI parts format vs the normalized OpenAI shape.
- Link import_logs.py and import_dataset.py to their files on GitHub.
- Remove the Topics Tasks facet image (and unused asset).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Old /guides/* paths don't exist in the current docs; point to
/annotate/datasets/index and /evaluate/run-evaluations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@imhurl23 imhurl23 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@DaRubberDuckieee
DaRubberDuckieee merged commit d57d053 into main Jun 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants