Overview
The OpenLIT SDK provides server-side evaluations viaopenlit.eval() (Python) and openlit.eval() (JS/TS). Evaluations use the same engine, rules, contexts, and custom eval types configured in the OpenLIT dashboard — working identically for development (offline) and production (online) stages.
Quick Start
Run your first offline evaluation in 3 lines of code.
Batch Evaluation
Evaluate multiple prompt/response pairs concurrently.
Attributes & Rules
Auto-resolve OTel attributes for context-aware evaluations.
Offline Evaluations
Offline evaluations run on the OpenLIT server using the same evaluation engine as online/auto evaluations. The SDK sends your prompt and response to the server, which runs LLM-as-judge evaluation and returns structured results.Prerequisites
- A running OpenLIT instance with evaluation configured in the dashboard.
- An OpenLIT API key (create one in the dashboard under Settings > API Keys).
Quick Start
- Python
- TypeScript / JavaScript
openlit.eval() / openlit.eval({}) Parameters
- Python
- TypeScript / JavaScript
Result Object
openlit.eval() returns an OfflineEvalResult with these properties:
Each
OfflineEvaluation contains:
Selecting Evaluation Types
Run specific evaluation types instead of all enabled ones:- Python
- TypeScript / JavaScript
Discover Available Types
- Python
- TypeScript / JavaScript
Batch Evaluation
Evaluate multiple prompt/response pairs concurrently:- Python
- TypeScript / JavaScript
openlit.eval_batch() Parameters
Automatic Attribute Resolution
The SDK automatically resolves trace attributes for rule engine matching, enabling context-aware evaluations without extra configuration. The resolution order (last wins):OTEL_RESOURCE_ATTRIBUTESenvironment variableOTEL_SERVICE_NAMEenvironment variableOPENLIT_ENVIRONMENT/OTEL_DEPLOYMENT_ENVIRONMENTenvironment variableopenlit.init()configuration (application_name,environment)- Explicit
attributesparameter (highest priority)
- Python
- TypeScript / JavaScript
CI/CD Integration
Use offline evaluations in your test suite or CI pipeline:- Python
- TypeScript / JavaScript
Configuration Precedence
Foropenlit_api_key and openlit_url, the resolution order is:
- Explicit function parameter (highest priority)
openlit.init()configurationOPENLIT_API_KEY/OPENLIT_URLenvironment variables
Deploy OpenLIT
Deployment options for scalable LLM monitoring infrastructure
Online Evaluations
Get started with evaluating your LLM responses in 2 simple steps on OpenLIT
Destinations
Send telemetry to Datadog, Grafana, New Relic, and other observability stacks
Zero-code observability with the OpenLIT Controller
Discover and instrument LLM traffic across Kubernetes, Docker, and Linux using eBPF — no code changes required.

