Tracing Providers
OpenInference Integration
Export OpenInference traces to the Judgment platform.
OpenInference integration sends traces from your OpenInference-instrumented applications to Judgment. If you're already using OpenInference for observability, this integration forwards those traces to Judgment without requiring additional instrumentation.
Quickstart
Install Dependencies
uv add openinference-instrumentation-openai judgeval openaipip install openinference-instrumentation-openai judgeval openaiInitialize Integration
from judgeval.tracer import Tracer
from openinference.instrumentation.openai import OpenAIInstrumentor
tracer = Tracer(project_name="openinference_project")
OpenAIInstrumentor().instrument()Add to Existing Code
Add these lines to your existing OpenInference-instrumented application:
from openai import OpenAI
from judgeval.tracer import Tracer
from openinference.instrumentation.openai import OpenAIInstrumentor
tracer = Tracer(project_name="openinference-app")
OpenAIInstrumentor().instrument()
client = OpenAI()
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[{"role": "user", "content": "Hello, world!"}]
)
print(response.choices[0].message.content)All OpenInference traces are exported to the Judgment platform.
Example: Multi-Workflow Application
from judgeval.tracer import Tracer
from openinference.instrumentation.openai import OpenAIInstrumentor
from openai import OpenAI
tracer = Tracer(project_name="multi_workflow_app")
OpenAIInstrumentor().instrument()
client = OpenAI()
def analyze_sentiment(text: str) -> str:
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[
{"role": "system", "content": "You are a sentiment analysis expert."},
{"role": "user", "content": f"Analyze the sentiment of: {text}"}
]
)
return response.choices[0].message.content
def extract_entities(text: str) -> str:
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[
{"role": "system", "content": "You are an entity extraction expert."},
{"role": "user", "content": f"Extract entities from: {text}"}
]
)
return response.choices[0].message.content
def summarize_text(text: str) -> str:
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[
{"role": "system", "content": "You are a summarization expert."},
{"role": "user", "content": f"Summarize: {text}"}
]
)
return response.choices[0].message.content
@tracer.observe(span_type="function")
def main():
text = "Apple Inc. announced today that their new iPhone will be released next month. The market reacted positively to this news."
sentiment = analyze_sentiment(text)
entities = extract_entities(text)
summary = summarize_text(text)
print(f"Sentiment: {sentiment}")
print(f"Entities: {entities}")
print(f"Summary: {summary}")
if __name__ == "__main__":
main()Available Instrumentors
OpenInference provides instrumentors for various frameworks and libraries:
OpenAI
from openinference.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument()Anthropic
from openinference.instrumentation.anthropic import AnthropicInstrumentor
AnthropicInstrumentor().instrument()OpenAI Agents SDK
from openinference.instrumentation.openai_agents import OpenAIAgentsInstrumentor
OpenAIAgentsInstrumentor().instrument()PydanticAI
from openinference.instrumentation.pydanticai import PydanticAIInstrumentor
PydanticAIInstrumentor().instrument()Other
Next Steps
- OpenAI Agents SDK - Trace OpenAI Agents SDK executions and handoffs.
- Agent Behavior Monitoring - Monitor your AI applications in production with behavioral scoring.
- All Integrations - View the list of all integrations that Judgment supports.