Model Providers

HuggingFace

If you use HuggingFace Transformers within your application, you can trace, monitor, and analyze them with Judgment using TransformersInstrumentor.

OpenTelemetry

pip install opentelemetry-instrumentation-transformers
from judgeval.tracer import Tracer
# Make sure you installed the dependency: opentelemetry-instrumentation-transformers
from opentelemetry.instrumentation.transformers import TransformersInstrumentor


tracer = Tracer(project_name="huggingface_project")
TransformersInstrumentor().instrument()

Always initialize the Tracer before calling TransformersInstrumentor().instrument() to ensure proper trace routing.

This instrumentation automatically traces text generation calls sent with the HuggingFace Transformers library.

On this page