EvalForge Maestro

Evaluate. Compare. Verify.
"EvalForge Maestro is an independent evaluation and regression verification engine — never an LLM runtime, RAG indexer, or agent framework."
EvalForge Maestro provides deterministic evaluation metrics, retrieval/RAG diagnostics, agent trace verification, OpenTelemetry span ingestion, statistical multi-trial cohort comparison, model-based judge calibration, and CI/CD quality gating behind a strict Pydantic v2 schema contract (evalforge-maestro CLI and evalforge_maestro Python SDK).
Key Architecture & Guarantees
- Strict Domain Isolation: Zero coupling to document chunkers, runtime RAG stores, or agent orchestration loops. Target systems plug in via thin protocol adapters (
CallableAdapter, RAGAdapter, lazy DocpipeAdapter, AgentAdapter) or completely offline (ReplayAdapter, ingest_otel_spans, load_otel_executions).
- Cold-Start Purity: Importing
evalforge_maestro or invoking evalforge-maestro --help never loads heavy or runtime-specific modules (litellm, docpipe_maestro, numpy, scipy, opentelemetry, opentelemetry_sdk, sqlite3, http.server) unless explicitly requested.
- Deterministic & Immutable Artifacts: Canonical JSON hashing (
SHA-256) of datasets and redacted configurations paired with atomic 0o700/0o600 run records under .evalforge/runs/ and append-only manifest.jsonl.
- Defence-in-Depth Security: Pre-network
--local-only endpoint validation (loopback-only enforcement and LITELLM_LOCAL_MODEL_COST_MAP), opt-in pre-network --block-pii egress blocking (detect_pii_categories for selected patterns such as email, US SSN, phone number, Luhn payment card, and secret tokens), prompt-injection XML/nonce delimiting in model-based judges, and automatic credential/API-key/Bearer masking ([REDACTED] via redact_secrets and scrub_secret_text) across logs, traces, resolved configs, and reports without mutating persisted evaluation text.
- Separation of Concerns: Every run and report strictly separates Evaluation (metric outcomes + retrieval-vs-answer/trace decoupling diagnostics), Regression (baseline cohort deltas, $p$-values, sliding OLS trends, anomaly flags, drift warnings), and Acceptance / Quality Gate (policy pass/fail verdict and POSIX exit code).
How EvalForge Maestro Works (Visual Guide)
EvalForge Maestro follows a strict, deterministic six-stage pipeline that separates executing your AI system from scoring quality, checking regressions, and enforcing release gates:
flowchart TD
S1["1. Define Golden Dataset (JSONL / JSON / Docpipe Fixture)"]
S2A["Live Target: CallableAdapter / RAGAdapter / DocpipeAdapter / AgentAdapter"]
S2B["Offline Replay: ReplayAdapter (Captured JSONL or OpenTelemetry Spans)"]
S3["3. Pre-Network Security Preflight (--local-only / --block-pii / Secret Scrubbing)"]
S4["4. Bounded EvaluationOrchestrator + 4 Metric Families"]
S5["5. Three-Way Engine: Evaluation | Regression (vs Baseline / Cohort) | QualityGate"]
S6["6. Immutable Artifacts (.evalforge/runs/*.json + manifest.jsonl)"]
S7["Optional Layers: SQLiteRunIndex (index/query) | HTTP Service (serve)"]
S1 --> S2A
S1 --> S2B
S2A --> S3
S2B --> S3
S3 --> S4
S4 --> S5
S5 --> S6
S6 --> S7
Step-by-Step Pipeline Walkthrough
| Step |
What Happens & Why It Matters |
Concrete Components & Commands |
| 1. Define |
Stream versioned test cases (EvaluationCase: input, reference, expected_context, expected_tool_calls, criteria.mandatory) and lock a canonical SHA-256 dataset_fingerprint so baseline comparisons never silently drift when test cases change. |
DatasetEngine, load_docpipe_fixture, --dataset |
| 2. Adapt / Ingest |
Capture what your system actually produced (ExecutionResult: final output, retrieved_chunks, tool_calls, trace, tokens, latency). Run live against Python/RAG/Agent/Docpipe code or completely offline from pre-recorded executions or OTel spans. |
CallableAdapter, RAGAdapter, DocpipeAdapter, AgentAdapter, ReplayAdapter, ingest_otel_spans |
| 3. Security Preflight |
Before any non-mock network call is attempted, --local-only rejects non-loopback judge/embedding endpoints and --block-pii scans payloads for emails, tokens, and credentials (exiting cleanly with POSIX 4). |
validate_local_only_target, validate_pii_egress, redact_secrets |
| 4. Orchestrate & Score |
EvaluationOrchestrator runs cases under bounded concurrency (--max-concurrency), checkpoints per-case progress atomically, truncates oversized persisted traces after scoring (--max-context-chars), and evaluates up to 4 metric families simultaneously. |
Deterministic text/JSON, Retrieval IR (100% branch), Agent Trace (100% branch), LLM Judges & Dense Embeddings |
| 5. Three-Way Evaluate & Gate |
Never collapses metrics into a single opaque average. Produces (a) raw Evaluation scores + decoupling diagnostics, (b) Regression deltas, Student's/Welch's $t$-test $p$-values (--repeats), OLS trend slopes, & anomaly flags (>0.3 spread), and (c) deterministic Quality Gate verdicts (PASS / FAIL / WARNING / INCONCLUSIVE). |
compare_runs, compare_run_cohorts, analyze_trend, QualityGate, --strict |
| 6. Persist, Index & Serve |
Writes immutable 0o600 JSON RunRecord artifacts + append-only manifest.jsonl and pinned baselines.json. Optionally builds a rebuildable SQLite index (SQLiteRunIndex) for fast queries or exposes everything behind Bearer-authenticated HTTP (ServiceApplication / serve). |
LocalRunStore, SQLiteRunIndex, evalforge-maestro index / query / serve |
Inside the Metric Families & Three-Way Diagnosis
Rather than hiding failures behind a macro average, EvalForge Maestro isolates where a RAG or agent pipeline broke:
flowchart LR
EX["Captured ExecutionResult (output + retrieved_chunks + tool_calls/trace)"]
M1["Deterministic Text & Schema (exact_match, normalized_match, json_schema_validation)"]
M2["Retrieval IR Ranking (precision_at_k, recall_at_k, mrr, ndcg_at_k, hit_rate_at_k)"]
M3["Agent Tool & Trace (tool_selection, argument_correctness, execution_sequence, efficiency, policy, recovery)"]
M4["Semantic & Judge Scoring (--mock offline OR local/remote LiteLLM: groundedness, relevance, correctness, embeddings)"]
DEC{"Three-Way & Decoupling Diagnostics"}
G1["PASS / FAIL / WARNING / INCONCLUSIVE (POSIX Exit 0..4)"]
EX --> M1
EX --> M2
EX --> M3
EX --> M4
M1 --> DEC
M2 --> DEC
M3 --> DEC
M4 --> DEC
DEC -->|"Retrieval OK + Generation Failed -> Fix Prompt / LLM"| G1
DEC -->|"Retrieval Failed -> Fix Chunking / Hybrid / Reranker"| G1
DEC -->|"Trace Violation / Policy Breach -> Fix Agent Guardrails"| G1
Calibrating Small & Local Judges First: Before letting a local model (such as Ollama/vLLM) gate pull requests, run evalforge-maestro calibrate --samples ... --metric groundedness --min-agreement 80.0 to measure exact_agreement_rate, directional bias (too_generous_rate vs. too_harsh_rate), mean_score_delta, and recommended_pass_threshold (docs/calibration-and-ci.md).
Minimal Core vs. Lazy Optional Extras
Core installation keeps dependencies minimal and cold-start instant; optional runtimes are only imported when invoked:
flowchart LR
CORE["evalforge-maestro Core (pydantic + jsonschema only): CLI, Datasets, Deterministic/IR/Agent Metrics, Statistical t-tests, OTel Ingestion, SQLite Index, HTTP Service"]
E1["[docpipe-maestro]: DocpipeAdapter (FTS5 hybrid + cross-encoder rerank + answer_detailed)"]
E2["[judges]: LiteLLM Gateway (Groundedness, Answer/Context Relevance, Custom Rubric, Calibration)"]
E3["[embeddings]: numpy + LiteLLM (EmbeddingSimilarityMetric, ContextEmbeddingSimilarityMetric)"]
CORE -.->|"lazy import -> MissingExtraError if absent"| E1
CORE -.->|"lazy import -> MissingExtraError if absent"| E2
CORE -.->|"lazy import -> MissingExtraError if absent"| E3
Installation
Install core evaluation, deterministic/retrieval/agent metrics, offline replay, and zero-dependency OpenTelemetry ingestion:
pip install evalforge-maestro
Optional capability extras (lazy-loaded on demand; never required at import time):
# Docpipe Maestro retrieval and RAG target adapter
pip install "evalforge-maestro[docpipe-maestro]"
# LiteLLM-backed model-as-judge evaluation and calibration
pip install "evalforge-maestro[judges]"
# Dense embedding similarity metrics (numpy + litellm)
pip install "evalforge-maestro[embeddings]"
For contributor development using uv:
uv sync --extra dev
CLI Quickstart Reference
Both evalforge-maestro and evalforge_maestro console commands expose eleven subcommands: run, ingest-otel, index, query, compare, trend, calibrate, baseline, report, config, and serve.
1. Offline CI / Local Regression Evaluation
evalforge-maestro run \
--config examples/ci/evalforge.toml \
--mock \
--local-only \
--strict \
--json \
--json-out report.json \
--markdown-out report.md
2. Multi-Trial Statistical Cohorts & Regression Gating
Evaluate stochastic LLM targets across N repeatable seeded runs and enforce Student's / Welch's $t$-test regression gates:
evalforge-maestro run \
--config examples/ci/evalforge.toml \
--repeats 3 \
--seed 10 \
--baseline release-v1 \
--fail-on-significant-regression \
--json
3. OpenTelemetry Trace Ingestion & Replay (ingest-otel / run --otel-traces)
Evaluate OTLP JSON envelopes, flat span arrays, or JSONL span streams directly (or normalize them into replayable ExecutionResult JSONL artifacts) with zero OTel SDK dependencies:
# Normalize an OTel span export into replayable ExecutionResult JSONL
evalforge-maestro ingest-otel examples/ci/otel-traces-sample.json \
--dataset examples/ci/golden-sample.jsonl \
--output replays.jsonl \
--system-version agent-v2.4.0 \
--json
# Evaluate OTel traces directly with agent + retrieval metrics and strict quality gating
evalforge-maestro run \
--config examples/ci/evalforge-otel.toml \
--strict \
--max-context-chars 4000 \
--json
See the full OpenTelemetry Trace Ingestion Guide for GenAI / OpenInference / Traceloop attribute precedence, tool call deduplication, clock-skew clamping, token anti-double-counting, and correlation rules.
4. Dense Embedding Similarity Evaluation
evalforge-maestro run \
--config examples/ci/evalforge.toml \
--metric embedding_similarity \
--metric context_embedding_similarity:aggregation=mean \
--mock \
--local-only \
--json
5. Baseline Pinning, Pairwise / Cohort Comparison, Trends & Calibration
# Pin a trusted baseline without mutating immutable run artifacts
evalforge-maestro baseline set <RUN_ID> --name release-v1 --json
# Compare single candidate or multi-trial candidate cohort against baseline(s)
evalforge-maestro compare <CANDIDATE_RUN_ID> --baseline release-v1 --strict --json
evalforge-maestro compare <CAND_R01> <CAND_R02> \
--baseline release-v1 --baseline-run <BASE_R02> \
--fail-on-significant-regression --json
# Inspect sliding-window OLS metric trend slopes
evalforge-maestro trend --window 5 --json
# Calibrate a judge metric against labeled human samples with minimum agreement gate
evalforge-maestro calibrate \
--samples examples/ci/calibration-samples.jsonl \
--metric groundedness \
--min-agreement 80.0 \
--mock \
--local-only \
--json
# Render Three-Way Markdown/JSON diagnostic reports from stored artifacts
evalforge-maestro report --run <RUN_ID> --baseline release-v1 > diagnostic-report.md
# Audit effective resolved configuration with provenance tiers (secrets always masked)
evalforge-maestro config validate --config evalforge.toml --json
evalforge-maestro config show --resolved
6. Local SQLite Query Index (index & query)
Build or sync an optional derived SQLite query index (.evalforge/index.sqlite3) from canonical JSON artifacts and query runs or failing cases cleanly—deleting or corrupting the DB never loses data and rebuilds atomically:
# Inspect sync parity or atomically rebuild from .evalforge/runs/*.json + manifest.jsonl
evalforge-maestro index status --storage-dir .evalforge --json
evalforge-maestro index rebuild --storage-dir .evalforge --json
# Query historical runs and triage mandatory/failing cases
evalforge-maestro query runs --storage-dir .evalforge --dataset-id support-qa --metric exact_match --min-score 0.8 --json
evalforge-maestro query cases --storage-dir .evalforge --status FAIL --mandatory-only --json
See the Rebuildable SQLite Query Index Guide for full recovery guarantees, normalized DDL tables, and filter references.
7. Optional Remote Evaluation HTTP Service (serve)
Serve canonical storage queries, SQLite index lifecycle, OTel trace ingestion, offline/trace evaluation, comparison gates, and report rendering over a typed stdlib HTTP/1.1 JSON API (safe loopback default 127.0.0.1:8787, local_only=True, pre-bind remote auth guard, and constant-time Bearer authentication):