Hugging Face smolagents
How to use the SmolagentsInstrumentor to trace smolagents by Hugging Face
smolagents is a minimalist AI agent framework developed by Hugging Face, designed to simplify the creation and deployment of powerful agents with just a few lines of code. It focuses on simplicity and efficiency, making it easy for developers to leverage large language models (LLMs) for various applications.

Phoenix provides auto-instrumentation, allowing you to track and visualize every step and call made by your agent.
Launch Phoenix
We have several code samples below on different ways to integrate with smolagents, based on how you want to use Phoenix.
Sign up for Phoenix:
Sign up for an Arize Phoenix account at https://app.phoenix.arize.com/login
Install packages:
Set your Phoenix endpoint and API Key:
Your Phoenix API key can be found on the Keys section of your dashboard.
Install
Setup
Add your HF_TOKEN
as an environment variable:
Connect to your Phoenix instance using the register function.
Create & Run an Agent
Create your Hugging Face Model, and at every run, traces will be sent to Phoenix.
Observe
Now that you have tracing setup, all invocations and steps of your Agent will be streamed to your running Phoenix for observability and evaluation.
Resources
Last updated
Was this helpful?