Integrations
OpenLit Integration
Export OpenLit traces to the Judgment platform.
OpenLit integration sends traces from your OpenLit-instrumented applications to Judgment. If you're already using OpenLit for observability, this integration forwards those traces to Judgment without requiring additional instrumentation.
Quickstart
Install Dependencies
uv add openlit judgeval openai
pip install openlit judgeval openai
Initialize Integration
from judgeval.tracer import Tracer
from judgeval.integrations.openlit import Openlit
tracer = Tracer(project_name="openlit_project")
Openlit.initialize()
Add to Existing Code
Add these lines to your existing OpenLit-instrumented application:
from openai import OpenAI
from judgeval.tracer import Tracer
from judgeval.integrations.openlit import Openlit
tracer = Tracer(project_name="openlit-agent")
Openlit.initialize()
client = OpenAI()
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[{"role": "user", "content": "Hello, world!"}]
)
print(response.choices[0].message.content)
All OpenLit traces are exported to the Judgment platform.
Example: Multi-Workflow Application
from judgeval.tracer import Tracer
from judgeval.integrations.openlit import Openlit
from openai import OpenAI
tracer = Tracer(project_name="multi_workflow_app")
Openlit.initialize()
client = OpenAI()
def analyze_text(text: str) -> str:
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": f"Analyze: {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 helpful AI assistant."},
{"role": "user", "content": f"Summarize: {text}"}
]
)
return response.choices[0].message.content
def generate_content(prompt: str) -> str:
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[
{"role": "system", "content": "You are a creative AI assistant."},
{"role": "user", "content": prompt}
]
)
return response.choices[0].message.content
@tracer.observe(span_type="function")
def main():
text = "The future of artificial intelligence is bright and full of possibilities."
analysis = analyze_text(text)
summary = summarize_text(text)
story = generate_content(f"Create a story about: {text}")
print(f"Analysis: {analysis}")
print(f"Summary: {summary}")
print(f"Story: {story}")
if __name__ == "__main__":
main()