For the complete documentation index, see llms.txt. This page is also available as Markdown.

Creating Evaluations

Create evaluations — sync, async, parallel, comparison, error handling.

Examples for creating evaluations on the Stratix platform using the LayerLens Python SDK.

Before running the below examples ensure the model and benchmark being run are present on your organization.

Basic Evaluation

Using Synchronous Client

Source: samples/core/benchmark_evaluation.py in the stratix-python repo.

from layerlens import Stratix

# Construct sync client (API key from env or inline)
client = Stratix()

# --- Models
models = client.models.get()
print(f"Found {len(models)} models")

# --- Benchmarks
benchmarks = client.benchmarks.get()
print(f"Found {len(benchmarks)} benchmarks")

# --- Create evaluation
evaluation = client.evaluations.create(
 model=models[0],
 benchmark=benchmarks[0],
)
print(f"Created evaluation {evaluation.id}, status={evaluation.status}")

# --- Wait for completion
evaluation = client.evaluations.wait_for_completion(
 evaluation,
 interval_seconds=10,
 timeout_seconds=600, # 10 minutes
)
print(f"Evaluation {evaluation.id} finished with status={evaluation.status}")

# --- Results
if evaluation.is_success:
 results = client.results.get(evaluation=evaluation)
 print("Results:", results)
else:
 print("Evaluation did not succeed, no results to show.")

Minimal Sync Example

Using Async Client

Sorting and Filtering Evaluations

Comparing Evaluations

Running Multiple Evaluations in Parallel

Fetching Results

See Retrieving Results for paginated and concurrent result fetching patterns.

Error Handling

Last updated

Was this helpful?