How to Evaluate Libraries for AI Agents: transformers as a Case Study, and Traces Instead of Answers
An AI agent can return the right answer and still reach it by the most expensive route: reading unnecessary code, guessing at APIs, crashing on errors and rebuilding the solution from scratch. For library developers, this is no longer a minor detail but a separate layer of tool quality. Using the transformers library as an example, this piece walks through how to build an evaluation harness that analyzes an agent's traces, tokens, time and errors.
AI-processed from Habr AI; edited by Hamidun News
Developers of libraries for AI agents face a problem: blindly checking an agent's final answer does not show how efficiently it got there. An agent can return the correct string and still take the most expensive route to it, reading unnecessary code, guessing API signatures, failing on errors and rebuilding the solution from zero.
Why a correct answer is not enough
For a library developer, an agent's flawed path is no longer a cosmetic issue but a signal of a new layer of quality in the tool itself. If an agent regularly spends extra steps guessing at APIs or reading code it does not need, that points to documentation, function signatures or library structure that are not clear enough for agent use, even when the end result is formally correct.
- The walkthrough is built on the transformers library
- Not only the final answer is evaluated, but the agent's path to it
- Key metrics: call traces, token consumption, execution time, errors
- Behavioral markers are recorded separately, for example repeated API guessing
What the evaluation harness includes
The evaluation harness, built using transformers as the example, collects full traces of the agent's work: which tool calls it made, how many tokens it spent, how long the solution took and which errors occurred along the way. Behavioral markers are tracked separately: repeating patterns showing that the agent is unsure about the API and works by trial and error instead of applying the right tool immediately.
What this means
As libraries and SDKs are increasingly used not directly by people but by AI agents, tool quality starts to be measured not only by how correct the documentation is for a human, but by how predictably and cheaply an agent can work with it. Evaluation based on traces and behavioral markers is becoming the new standard for developers who want their library to be convenient for agents in particular.
- Dec 2, 2026Ai2 Releases MolmoWeb2 Web Agents: 27B Model Solves 75.3% of Tasks
- Dec 2, 2026Amazon Releases Ergo Open Weights for Coding: 1.1 Trillion Parameters and 2,200 Tokens per Second
- Dec 2, 2026OpenAI Opens Dots Agent to ChatGPT Plus Subscribers With 10,000+ Plugins
- Dec 2, 2026FSK Group Has Launched 395 AI Agents in Six Months, with a 97.7% Success Rate
Key Questions Answered
Why a correct answer is not enough?
For a library developer, an agent's flawed path is no longer a cosmetic issue but a signal of a new layer of quality in the tool itself. If an agent regularly spends extra steps guessing at APIs or reading code it does not need, that points to documentation, function signatures or library structure that are not clear enough for agent use, even when the end result is formally correct.
What the evaluation harness includes?
The evaluation harness, built using transformers as the example, collects full traces of the agent's work: which tool calls it made, how many tokens it spent, how long the solution took and which errors occurred along the way. Behavioral markers are tracked separately: repeating patterns showing that the agent is unsure about the API and works by trial and error instead of applying the right tool immediately.
What this means?
As libraries and SDKs are increasingly used not directly by people but by AI agents, tool quality starts to be measured not only by how correct the documentation is for a human, but by how predictably and cheaply an agent can work with it. Evaluation based on traces and behavioral markers is becoming the new standard for developers who want their library to be convenient for agents in particular.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
