rose-eval (CLI)¶
The rose-eval CLI tool runs evaluations against Langfuse datasets. It directly invokes ixevaluation evaluators, with Langfuse tracing enabled by default and explicit control over all parameters.
Installation¶
The CLI tool is available after activating the Poetry shell in the backend directory:
Once in the Poetry shell, the rose-eval command is available.
Required Environment Variables¶
Ensure these environment variables are set (typically via .env.test):
| Variable | Description |
|---|---|
LANGFUSE_SECRET_KEY |
Langfuse API secret key |
LANGFUSE_PUBLIC_KEY |
Langfuse API public key |
LANGFUSE_HOST |
Langfuse API host URL |
AZURE_OPENAI_* |
Azure OpenAI configuration (for LLM calls) |
Before running evaluations, load per-CLI secrets in the same shell as the CLI.
Judge calls need a readable
OPENAI_API_KEY_EVAL: from the shell (the per-CLI secrets above) or from Secret Manager (gcloud auth application-default login). When neither works,rose-evalexits at startup (code 2) with that instruction; it never falls back to the sharedOPENAI_API_KEY, which keeps eval spend on its own OpenAI project.features listandfeatures verifycall no model and need no eval key. A run that completes then reportsNo successful evaluations to aggregatescored nothing: either the filter (--item,--suggestion-type) matched no item, or every item failed. Sanity-check with--itemon one item before a full run. That message also covers per-item chat errors (for example a routing rejection such asworkspace host is disabled). Ane2erun lists each errored item's id, query and exception: in--jsonoutput under the top-levelerrorkey when a run (or one of its repeats) scored no item, else undermetrics.error_messages. Other eval kinds hide them in piped output (--json): rerun one item with--item <id> --verbosein a terminal (or underscript -q <log>) to see the error.workspace corpus is not ready in this environmentmeans the workspace the item'spage_urlroutes to is not live, has no ready corpus, or serves it in another environment. Check itsstatus,corpus_statusandcorpus_environmentinpublic.workspaces; a path workspace such as sunday's/en-gbis served only in itscorpus_environment(usuallyproduction): rerun with that--env.
Usage¶
Commands¶
| Command | Description | Metric | Default Threshold |
|---|---|---|---|
e2e |
End-to-end API response accuracy (LLM-as-a-Judge) | Mean accuracy | 0.70 |
intent-classifier |
Intent classification accuracy | Macro F1 | 0.80 |
skill-selector |
Multi-label skill selection | Skill recall + Micro F1 | 0.90 (recall), 0.75 (micro F1) |
suggestion |
Suggestion quality evaluation | Mean quality | 0.60 |
features |
List or run feature-* eval datasets | Per-dataset | Per-dataset |
Shared Options¶
These options are available on all commands:
| Option | Required | Default | Description |
|---|---|---|---|
dataset |
Yes | - | Langfuse dataset name (positional argument) |
--env |
No | test |
Environment for credentials: test, development, staging, production |
--trace |
No | no |
Record the run as a Langfuse experiment with full traces: yes or no. With no, one trace in twenty still reaches Langfuse (tagged service.name = rose-eval) so eval spend can be estimated; see Job and eval cost |
--item |
No | - | Filter items by ID prefix or query substring |
--threshold |
No | Per type | Override pass/fail threshold (0.0-1.0) |
--sample-size |
No | - | Run on N items, the same ones each run (seeded by the dataset name) |
--verbose |
No | false |
Show detailed per-item results |
--json |
No | false |
Output results as JSON (for CI, also auto-activates when stdout is piped) |
--concurrency |
No | 3 |
Number of items to process concurrently |
--eu-residency |
No | false |
Run items with every chat model call on EU (EEA + Switzerland) deployments |
--debug |
No | false |
Enable debug logging to console |
Command-Specific Options¶
skill-selector¶
| Option | Default | Description |
|---|---|---|
--micro-f1-threshold |
0.75 |
Override micro-F1 threshold |
--classifier |
llm |
Classifier implementation: production llm or evaluation-only jev |
intent-classifier¶
| Option | Default | Description |
|---|---|---|
--classifier |
llm |
Classifier implementation: llm, jev, or evaluation-only jev-merged |
suggestion¶
The judge is gpt-5.4 on OpenAI. Before IX-6409 it was Azure gpt-4.1 (model_info
azure/gpt-4.1): never compare suggestion scores across that change.
| Option | Default | Description |
|---|---|---|
--suggestion-type |
- | Filter by type: follow-up or answer |
--regenerate-model |
- | Re-generate suggestions with this model before judging (e.g., gpt-4.1-mini) |
--regenerate-provider |
openai |
Provider for re-generation: azure, openai, google, cerebras, anthropic, groq, groq_direct |
features¶
The features command has two sub-subcommands:
| Sub-command | Description |
|---|---|
list |
List all feature-* evaluation datasets |
run [name] |
Run feature evaluation(s). Omit name to run all. |
Examples¶
E2E evaluation (uses "new" agentic system by default)¶
Quick smoke test on 5 random items¶
Intent classifier evaluation¶
rose-eval intent-classifier intent-classifier
rose-eval intent-classifier intent-classifier --classifier jev
rose-eval intent-classifier intent-classifier --classifier jev-merged
jev-merged folds the dataset's out_of_scope_task golds into offtopic before
scoring and removes that choice from Jev. Its eight-label macro-F1 is useful for
testing the simpler taxonomy, but is not directly comparable to the nine-label
macro-F1 reported by jev.
Skill selector evaluation with custom threshold¶
rose-eval skill-selector skill-selector --threshold 0.85
rose-eval skill-selector skill-selector --classifier jev
Suggestion quality evaluation¶
rose-eval suggestion suggestion-quality
rose-eval suggestion suggestion-quality --suggestion-type follow-up
rose-eval suggestion suggestion-quality --regenerate-model gpt-4.1-mini
Feature eval datasets¶
rose-eval features list # List all feature-* datasets
rose-eval features run content --verbose # Run feature-content
rose-eval features run # Run all feature evals
Feature datasets run on the feature-eval test sites
(testfeatures.com, testfeatures2.com). Their fixtures, such as curated FAQs, exist only in the
test corpus (staging is copied from production): run them with the default --env test.
Filter to specific items¶
Record a Langfuse experiment run¶
Needed to compare runs in the Langfuse UI or get trace links on failing items:
Cost and budget¶
Every run calls the real chat pipeline and the judge with the shared provider keys, outside
Langfuse. On main-dataset, one e2e item costs about $0.03: the gpt-5.4 answer about $0.02,
the Cerebras analysis calls about $0.007, and the judge about $0.004. Eval turns skip the follow-up
and answer suggesters unless the dataset's checker reads their chips (suggested-answers), and every judge runs on OpenAI's flex tier, falling back to the default tier
(create_judge_llm in backend/packages/ixevaluation).
| Run | Cost |
|---|---|
--sample-size 10 |
~$0.30 |
main-dataset, 43 items |
~$1.30 |
pennylane.com-v1, 91 items |
~$2.70 |
| Base vs branch | twice the run |
--repeats 3 |
three times the run |
Each thread (worktree) has a $2 eval budget. rose-eval prices every run from the token usage
it reports, prints Eval LLM cost: $X · thread total $Y of $2.00 budget on stderr, and appends the
run to .context/eval-spend.jsonl at the worktree root. A base worktree under .context/ charges
the same thread. Once the total reaches the budget, rose-eval refuses to start. $2 covers the
iteration (item and 10-item runs) and one full main-dataset run. When a check needs more, such as
a full base-vs-branch comparison, ask the user for it with the run's cost; on their yes, run with
ROSE_EVAL_BUDGET_USD=<usd>. Prices live in
backend/apps/cli/cli/eval_budget.py; a model missing there is priced like gpt-5.4 and named in
the output. The check runs before a run starts, so the run that crosses the budget finishes. Only
LangChain model calls are priced: a --classifier jev run calls TypeSafe directly and records
nothing.
The judge (gpt-5.4 at temperature 0) scores correctness, completeness, flow and format in one call,
and gives the same score to the same answer. Judge version v4-single-call-0to10 scores about 0.03
higher on main-dataset than the four-call v3, mostly on format: never compare a score across
judge versions. A cheaper or newer judge model must pass the labeled calibration set
(packages/ixevaluation/tests/test_answer_quality_calibration.py, RUN_LLM_CALIBRATION=1) and
score the same answer the same way twice; gpt-6.2-sol passed the first and failed the second.
Compare a branch with its base¶
A change on every client's answer path (dialog state, turn instructions, shared prompts) needs a
before/after on main-dataset. Run the base from a second worktree with this worktree's venv:
the base worktree has no .env.* files (gitignored), so link them (.env.local too: it keeps
both runs on the same database target), and PYTHONPATH makes the venv import the base
packages, prompts and the in-process search API. Merge the current base first: commits missing
from your branch show up as regressions.
Each side is a full run against the thread's budget. Spend runs only where they decide something:
- Iterate small:
--itemon the items the change targets, or--sample-size 10for a broad check. The sample is seeded by the dataset name, so the same--sample-sizepicks the same items on both sides and the two runs are comparable. - Run a full dataset rarely: once, at the end of the work, never after each edit.
- One repeat per side by default.
--repeats 3on both sides costs six full runs; keep it for hard problems, such as a fix for the same issue that did not hold before. - Never decide on a small difference: it can be luck. Per-run means of identical code differ by
up to 0.04 on
main-dataset, one item swings by up to 0.3, and on a 10-item sample one item moves the mean by 0.03. Before keeping, reverting or reporting a change on a gap that size, get more data: the full dataset, then--repeats 3per side. If the gap stays inside the noise, report "no measurable difference", not a gain or a regression.
With --repeats N the headline Mean Quality and pass/fail are the average of the N runs; the
Repeats line lists each run's mean, and --json adds them as run_mean_qualities next to the per-item repeat_items. From the repository root:
git worktree add --detach .context/base-wt origin/develop
B=$PWD/.context/base-wt/backend; V=$PWD/backend/.venv/bin/rose-eval
for f in .env.development .env.production .env.staging .env.test .env.local; do
[ -e "backend/$f" ] && ln -s "$PWD/backend/$f" "$B/$f"
done
PP=$(for p in "$B"/packages/* "$B"/apps/cli "$B"/apps/api/search/ixsearch_api; do printf "%s:" "$p"; done)
source backend/scripts/load-dev-secrets.sh
(cd backend && $V e2e main-dataset > /tmp/branch.txt) &
(cd "$B" && PYTHONPATH="$PP" $V e2e main-dataset --base-cache > /tmp/base.txt) &
wait
git worktree remove --force .context/base-wt
Do not edit this worktree while the branch run is going: it reads the files on disk.
--base-cache reuses the base side across comparisons. Each item result is stored under the
main worktree's .context/eval-base-cache/<base commit>/, keyed by base commit, dataset, item id
and content, --env, --eu-residency, the database target (SUPABASE_URL and the retrieval
namespace .env.local can set), judge prompt version (JUDGE_PROMPT_VERSION) and repeat index.
The cache is shared by every worktree of the repository, so threads reuse each other's base
runs. The next comparison against the same base commit runs only the items it has not seen, so
with an unchanged origin/develop it costs the branch side alone. Cached items print
Cached: base <commit>, and the summary adds Base cache: N/M items reused from <commit>
(base_cache in --json). An item edited in Langfuse misses and runs again. Knowledge and client
configs are live data the commit does not pin, so entries expire after 24 hours.
The flag refuses a checkout on a branch, one with uncommitted or untracked files, a run whose
packages or prompts come from another worktree (a missing PYTHONPATH), and --trace yes
(a cached item records no Langfuse experiment item): never pass it to the branch under test. A
base older than the flag (before IX-6400) rejects it: drop --base-cache there. Delete
.context/eval-base-cache/<commit> to free the space.
JSON output for CI¶
Datasets¶
Available Datasets¶
| Dataset | Command | Description |
|---|---|---|
main-dataset |
e2e |
Cross-client set, edited in Langfuse only (no seed script). Items copied from a client dataset (metadata.duplicated_from) don't follow that client's seed: after a rename or fact change, upsert the copy by its item id. |
mayday.fr-v2 |
e2e |
Mayday.fr baseline (40 single-turn + 25 multi-turn) |
intent-classifier |
intent-classifier |
Intent classification dataset |
skill-selector |
skill-selector |
Skill selection dataset |
suggestion-quality |
suggestion |
Suggestion quality dataset |
A client e2e dataset lives in Langfuse: merging a change to its seed_e2e_<client>.py changes
nothing until someone runs rose-langfuse dataset seed e2e_<client>. Before trusting a run after
a fact change, check that an expected answer has the new value.
Creating / Populating Datasets¶
Use rose-chat with the --trace --add-to-dataset flags to add conversations to a dataset:
# Add an E2E conversation to a dataset
rose-chat "What does your product do?" --site mayday.fr --trace --add-to-dataset mayday.fr-v2
# Add to a specific dataset type
rose-chat "I need help" --site mayday.fr --trace --add-to-dataset intent-classifier --dataset-type intent-classifier
Each conversation is traced via Langfuse and the trace is added to the dataset in evaluator-compatible format ({"query": "..."} / {"response": "..."}).
See CLI Chat for full details on dataset population.
Justfile Wrapper¶
A backward-compatible just eval wrapper is available for common targets:
just eval e2e-api # → rose-eval e2e main-dataset
just eval mayday # → rose-eval e2e mayday.fr-v2
just eval intent-classifier # → rose-eval intent-classifier intent-classifier
just eval skill-selector # → rose-eval skill-selector skill-selector
Prefer rose-eval directly
Use rose-eval directly for full control over tracing and all other options.
Architecture¶
Key design decisions:
- In-process ASGI transport: E2E evaluations run the full API stack in-process via
httpx.ASGITransport, avoiding the need for a running server. - LLM-as-a-Judge: E2E evaluation uses an LLM to compare the actual response against the expected baseline from the dataset.
- Classifiers in ixevaluation:
E2EAPIClient,IntentClassifier, andSkillSelectorClassifierlive in theixevaluationpackage alongside their base classes/protocols.
Exit Codes¶
| Code | Meaning |
|---|---|
0 |
Evaluation passed (metrics above threshold) |
1 |
Evaluation failed (metrics below threshold) |
2 |
Error (configuration, runtime, or unknown eval type) |
130 |
Cancelled by user (Ctrl+C) |
Log Files¶
All evaluations are logged to backend/logs/:
eval-{timestamp}.log— Full log for each runeval-latest.log— Symlink to the most recent log file
The log file path is displayed at the start of each run.
Related Documentation¶
- CLI Chat — Interactive chatbot testing and dataset population
- CLI Langfuse — Langfuse datasets, traces, and the prompt backup mirror
- Backend Setup — Environment configuration
- IXChat Package — Chatbot and graph structure details
- Skill System — Skill definitions and registry
Benchmarking routed models¶
A/B a model for a resolver-routed node by changing
CHAT_ROUTING_POLICIES[<USE_CASE>] before bootstrap_ixchat_runtime(), then
exercise a classifier that uses that route. The existing benchmark scripts differ:
backend/scripts/bench_skill_selector_model.pypatches the skill-selector route before bootstrap and evaluates it over the Langfuse dataset.backend/scripts/bench_intent_classifier_model.pydirectly replaces the eval wrapper's model/client. It compares models but does not validate production routing.
Both scripts take <provider> <model> positional arguments, use BENCH_ENV
(default test), and exclude a warm-up call from timing.
- Single-query
rose-chatinvocations include fresh-process and cold-client overhead. Use a warmed persistent runner when comparing latency with a long-running server. rose-eval intent-classifierscores the production route, so changingCHAT_ROUTING_POLICIESchanges what it runs — seebackend/packages/ixevaluation/AGENTS.md.- LightRAG caches query keywords in the shared KV store (
enable_llm_cache), keyed by query text: bypass the cache when A/B-inglightrag_retrieval, or both arms replay one model's keywords. - A route with a fallback answers a primary failure with the fallback model, and the caller
sees no error: at 6 concurrent calls the test-key Cerebras limit (429, tokens per minute)
moved part of an IX-6406 replay to gpt-5.4-mini. Resolve one handle per call
(
resolve_chat_use_case), since its metadata reflects the handle's latest invocation, then checkget_invocation_metadata().fallback_triggeredand retry that arm, or drop the whole pair: dropping one arm leaves the arms on different turns.