Smolagents (tracing)
Smolagents (tracing)
Smolagents is HuggingFace’s lightweight agent framework that lets you build agents with code-based actions. It focuses on simplicity and supports both code agents and tool-calling agents. Respan gives you full observability over every agent run, planning step, code execution, tool call, and LLM generation — and gateway routing through the OpenAI-compatible Respan endpoint.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Use Respan Gateway
See Smolagents gateway setup to route this integration through the Respan gateway.
Example projects
Setup
Set environment variables
OPENAI_API_KEY is used for LLM requests. RESPAN_API_KEY is used to export traces to Respan.
View your trace
Open the Traces page to see your Smolagents workflow, identified by smolagents_code_agent_workflow, with planning steps, code execution, tool calls, and LLM generations.
Configuration
Attributes
In Respan()
Set defaults at initialization — these apply to all spans.
With propagate_attributes
Override per-request using a context scope.