Hugging Face smolagents
How to use the SmolagentsInstrumentor to trace smolagents by Hugging Face
Last updated
Was this helpful?
How to use the SmolagentsInstrumentor to trace smolagents by Hugging Face
Last updated
Was this helpful?
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.
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:
Install packages:
Set your Phoenix endpoint and API Key:
Add your HF_TOKEN
as an environment variable:
Connect to your Phoenix instance using the register function.
Create your Hugging Face Model, and at every run, traces will be sent to Phoenix.
Now that you have tracing setup, all invocations and steps of your Agent will be streamed to your running Phoenix for observability and evaluation.
Sign up for an Arize Phoenix account at
Your Phoenix API key can be found on the Keys section of your .
For details on customizing a local terminal deployment, see .
See for more details
Pull latest Phoenix image from :
For more info on using Phoenix with Docker, see .
By default, notebook instances do not have persistent storage, so your traces will disappear after the notebook is closed. See or use one of the other deployment options to retain traces.