Summary
smolagents (smolagents) is HuggingFace's agent framework for building AI agents that write and execute Python code or use tool-calling to perform actions. It has 26.9k GitHub stars, 34 releases, and is actively maintained (latest: v1.24.0, January 16, 2026). This repository has zero instrumentation for any smolagents execution surface — no integration directory, no wrapper, no patcher, no auto_instrument() support.
smolagents provides two primary agent types: CodeAgent (agents write Python code snippets to call tools) and ToolCallingAgent (agents use standard tool-calling). Code agents achieve ~30% fewer steps and LLM calls compared to standard tool-calling on complex benchmarks. The framework supports multi-agent orchestration where agents can call other agents as tools.
Comparable agent frameworks (Agno, AutoGen, AgentScope, OpenAI Agents SDK, Claude Agent SDK, Google ADK, Pydantic AI) all have dedicated native integrations in this repository.
What needs to be instrumented
The smolagents package exposes these execution surfaces, none of which are instrumented:
Agent execution (highest priority)
| Class / Method |
Description |
CodeAgent.run() |
Executes an agent that writes and runs Python code to accomplish tasks |
ToolCallingAgent.run() |
Executes an agent using standard LLM tool-calling |
MultiStepAgent.run() |
Base class for multi-step agent execution |
Each run() call involves an iterative loop where the agent:
- Receives the task and available tools
- Thinks/plans (LLM call)
- Generates an action (code snippet or tool call)
- Executes the action
- Observes the result
- Repeats until the task is complete or max steps reached
Tool execution
| Class / Method |
Description |
Tool.__call__() |
Individual tool invocations during agent execution |
ManagedAgent |
Agent-as-a-tool for multi-agent orchestration |
Model calls
| Class / Method |
Description |
Model.__call__() |
LLM calls made by agents (supports OpenAI, Anthropic, HF, local models) |
HfApiModel.__call__() |
HuggingFace Inference API calls |
LiteLLMModel.__call__() |
LiteLLM-backed model calls |
OpenAIServerModel.__call__() |
OpenAI-compatible server calls |
Planning steps
| Class / Method |
Description |
Agent.planning_step() |
Individual reasoning/action steps within a run |
Implementation notes
Minimal framework: smolagents is designed to be minimal (~1,000 lines of core logic). The integration surface is correspondingly small, making it a good candidate for a lightweight integration.
Agent lifecycle: Each run() call produces a series of planning_step() calls. The integration should create a parent span for the run() and child spans for each planning step, tool call, and LLM invocation.
Code execution tracing: For CodeAgent, the generated Python code is a key piece of tracing data. The integration should capture the generated code in span metadata alongside the execution result.
Multi-agent: When agents call other agents via ManagedAgent, the integration should preserve the parent-child span hierarchy across agent boundaries.
No coverage in any instrumentation layer
- No integration directory (
py/src/braintrust/integrations/smolagents/)
- No wrapper function (e.g.
wrap_smolagents())
- No patcher in any existing integration
- No nox test session (
test_smolagents)
- No version entry in
py/src/braintrust/integrations/versioning.py
- No mention in
py/src/braintrust/integrations/__init__.py
A grep for smolagents or smol.agents (case-insensitive) across py/src/braintrust/ returns zero matches.
Braintrust docs status
not_found — smolagents is not mentioned on the Braintrust integrations directory or the tracing guide.
Upstream references
Local repo files inspected
py/src/braintrust/integrations/ — no smolagents/ directory exists on main
py/src/braintrust/wrappers/ — no smolagents wrapper
py/noxfile.py — no test_smolagents session
py/src/braintrust/integrations/__init__.py — smolagents not listed in integration registry
py/src/braintrust/integrations/versioning.py — no smolagents version matrix
- Full repo grep for "smolagents", "smol.agents" — zero matches in SDK source
Summary
smolagents (
smolagents) is HuggingFace's agent framework for building AI agents that write and execute Python code or use tool-calling to perform actions. It has 26.9k GitHub stars, 34 releases, and is actively maintained (latest: v1.24.0, January 16, 2026). This repository has zero instrumentation for any smolagents execution surface — no integration directory, no wrapper, no patcher, noauto_instrument()support.smolagents provides two primary agent types:
CodeAgent(agents write Python code snippets to call tools) andToolCallingAgent(agents use standard tool-calling). Code agents achieve ~30% fewer steps and LLM calls compared to standard tool-calling on complex benchmarks. The framework supports multi-agent orchestration where agents can call other agents as tools.Comparable agent frameworks (Agno, AutoGen, AgentScope, OpenAI Agents SDK, Claude Agent SDK, Google ADK, Pydantic AI) all have dedicated native integrations in this repository.
What needs to be instrumented
The
smolagentspackage exposes these execution surfaces, none of which are instrumented:Agent execution (highest priority)
CodeAgent.run()ToolCallingAgent.run()MultiStepAgent.run()Each
run()call involves an iterative loop where the agent:Tool execution
Tool.__call__()ManagedAgentModel calls
Model.__call__()HfApiModel.__call__()LiteLLMModel.__call__()OpenAIServerModel.__call__()Planning steps
Agent.planning_step()Implementation notes
Minimal framework: smolagents is designed to be minimal (~1,000 lines of core logic). The integration surface is correspondingly small, making it a good candidate for a lightweight integration.
Agent lifecycle: Each
run()call produces a series ofplanning_step()calls. The integration should create a parent span for therun()and child spans for each planning step, tool call, and LLM invocation.Code execution tracing: For
CodeAgent, the generated Python code is a key piece of tracing data. The integration should capture the generated code in span metadata alongside the execution result.Multi-agent: When agents call other agents via
ManagedAgent, the integration should preserve the parent-child span hierarchy across agent boundaries.No coverage in any instrumentation layer
py/src/braintrust/integrations/smolagents/)wrap_smolagents())test_smolagents)py/src/braintrust/integrations/versioning.pypy/src/braintrust/integrations/__init__.pyA grep for
smolagentsorsmol.agents(case-insensitive) acrosspy/src/braintrust/returns zero matches.Braintrust docs status
not_found— smolagents is not mentioned on the Braintrust integrations directory or the tracing guide.Upstream references
Local repo files inspected
py/src/braintrust/integrations/— nosmolagents/directory exists onmainpy/src/braintrust/wrappers/— no smolagents wrapperpy/noxfile.py— notest_smolagentssessionpy/src/braintrust/integrations/__init__.py— smolagents not listed in integration registrypy/src/braintrust/integrations/versioning.py— no smolagents version matrix