Registry / ai-ml / openinference-instrumentation-smolagents

openinference-instrumentation-smolagents

JSON →
library0.1.32pypypi✓ verified 79d ago

OpenInference instrumentation for smolagents, enabling tracing and observability of AI agent workflows. Current version 0.1.32, released under the OpenInference project by Arize AI. Regular releases aligned with OpenInference ecosystem.

pip install openinference-instrumentation-smolagents
INSTALL
IMPORT
SIG · OPENINFERENCE-INST
O
openinference-instrumentation-smolagents
ai-mlpythonv0.1.32
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SmolagentsInstrumentor
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
from openinference_instrumentation_smolagents import SmolagentsInstrumentor

Minimal setup to instrument smolagents with OpenInference and OpenTelemetry.

from openinference_instrumentation_smolagents import SmolagentsInstrumentor from opentelemetry import trace as trace_api from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import SimpleSpanProcessor import os # Configure OpenTelemetry (example with OTLP HTTP exporter) provider = TracerProvider() processor = SimpleSpanProcessor( OTLPSpanExporter(endpoint=os.environ.get("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4318/v1/traces")) ) provider.add_span_processor(processor) trace_api.set_tracer_provider(provider) # Instrument smolagents SmolagentsInstrumentor().instrument() # Now use smolagents normally - traces are automatically captured
Debug
Known issues
gotchaThe instrumentation only works with smolagents version >= 0.1.0. Older versions are not supported.
fix
Upgrade smolagents to >=0.1.0
affects: <0.1.0 of smolagents
deprecatedThe old import path `openinference.instrumentation.smolagents` is deprecated. Use `openinference_instrumentation_smolagents`.
fix
Change imports to the underscore-based package name.
affects: >=0.1.0
gotchaIf you are using multiple OpenInference instrumentors, ensure they are all instrumented before creating any spans to avoid missing context.
fix
Call instrument() on all instrumentors before any agent execution.
affects: all
Upgrade
Version history
0.1.32latest on PyPI · released May 22, 2026
Audit
Dependencies
openinference-instrumentationrequiredCore OpenInference instrumentation APIs
opentelemetry-apirequiredOpenTelemetry API for tracing
smolagentsrequiredInstrumentation target library
Agent activity
7 hits · last 30 days
node
5
Amazon
1
Resources
openinference-instrumentation-smolagents — pip install openinference-instrumentation-smolagents · libregistry