Track HuggingFace’s smolagents with AgentOps seamlessly
smolagents is a framework for building and running AI agents from HuggingFace.
Checkout their docs to get started with creating your own agents.
Integrating AgentOps with smolagents
1
Install the AgentOps SDK
pip install agentops
poetry add agentops
2
Install smolagents
pip install smolagents
poetry add smolagents
3
Initialize AgentOps and use LiteLLM in your code
AgentOps tracks calls from smolagents via LiteLLM currently.
import agentopsfrom smolagents import LiteLLMModelagentops.init(<INSERT YOUR API KEY HERE>)model = LiteLLMModel(<model_name>)# Your code here...agentops.end_session('Success')
Set your API key as an .env variable for easy access.