Skip to main content

Overview

The OpenLIT SDK provides server-side evaluations via openlit.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

  1. A running OpenLIT instance with evaluation configured in the dashboard.
  2. An OpenLIT API key (create one in the dashboard under Settings > API Keys).

Quick Start

You can also configure via environment variables:

openlit.eval() / openlit.eval({}) Parameters

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:

Discover Available Types

Batch Evaluation

Evaluate multiple prompt/response pairs concurrently:

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):
  1. OTEL_RESOURCE_ATTRIBUTES environment variable
  2. OTEL_SERVICE_NAME environment variable
  3. OPENLIT_ENVIRONMENT / OTEL_DEPLOYMENT_ENVIRONMENT environment variable
  4. openlit.init() configuration (application_name, environment)
  5. Explicit attributes parameter (highest priority)

CI/CD Integration

Use offline evaluations in your test suite or CI pipeline:

Configuration Precedence

For openlit_api_key and openlit_url, the resolution order is:
  1. Explicit function parameter (highest priority)
  2. openlit.init() configuration
  3. OPENLIT_API_KEY / OPENLIT_URL environment 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.