New to SURE-EVAL? Start with the complete user manual:
- π Markdown Manual (read in repo)
- π HTML Manual (browser-friendly)
- π₯ PDF Manual (print / offline)
The manual uses Qwen3-ASR as a running example and covers installation, data preparation, model onboarding, evaluation execution, and Agent Flow in detail.
SURE-EVAL is an automated evaluation framework for audio tools and models, built around a simple principle:
π― Agent decides scope, scripts enforce execution.
Who this is for: audio ML researchers and engineers who want reproducible, auditable benchmark evaluation without hand-rolling a new pipeline for every model.
flowchart LR
U[User request] --> Q{Choose workflow}
Q -- Existing model evaluation --> M[main_flow_agent]
Q -- New model onboarding / repair --> T[model_tool_agent]
Q -- Unsure --> R[Readiness gate]
R -- ready --> M
R -- not ready --> T
T --> Ready[Callable SURE tool]
Ready --> M
M --> Run[Evaluation run<br/>scores + reports + manifest]
| Layer | Role | Key docs |
|---|---|---|
| π€ Main Flow Agent | Decides what should be run | docs/agents/main_flow_agent/README.md |
| π§ Model Tool Agent | Makes models callable in reproducible ways | docs/agents/model_tool_agent/README.md |
| π Deterministic Script Layer | Prepares, validates, scores, records | scripts/ |
| Goal | How |
|---|---|
| π Onboard a new audio model | Turn raw repositories into stable local tools |
| π Run controlled evaluations | Select datasets β Generate predictions β Validate β Score β Record |
π‘ Key Insight: Model integration is high-uncertainty, but evaluation execution should be low-uncertainty. SURE-EVAL separates these concerns.
Role: Orchestration layer
Responsibilities:
- Understanding user goals
- Task classification
- Tool readiness verification
- Dataset scope selection
- Script routing
- Outcome assessment
π Documentation:
Location: docs/agents/model_tool_agent/
Responsibilities:
- Backend selection
- Environment isolation
- Import / Load / Infer / Contract validation
- Wrapper generation
- Artifact management
π Documentation:
Core Scripts:
| Script | Purpose |
|---|---|
prepare_sure_dataset.py |
Canonical dataset preparation |
materialize_predictions_template.py |
Prediction template generation |
validate_prediction_files.py |
Prediction validation |
evaluate_predictions.py |
Metric & RPS computation |
refresh_report_snapshot.py |
Result recording & reports |
Deterministic Metric CLI:
sure-eval metric describe asr --language zh --metric cer --output /tmp/asr_pipeline.json --json
sure-eval metric run --pipeline /tmp/asr_pipeline.json --ref-file ref.txt --hyp-file hyp.txt --output-dir /tmp/sure_eval/asr_eval --jsonThe CLI calls sure_eval.evaluation.scripts.run_task(...); route selection,
executor loading, pipeline-id validation, and output writing stay in the script
layer. It reports node-local environment hints but does not validate uv or
node dependencies.
Start Here
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Do you have a model under src/sure_eval/models/<model>? β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββ β No β Use Model Tool Agent
β β Build model-local server first
β β Then use Main Flow Agent
β
βββ β
Yes β Check config.yaml for server/tool path
β
βββ β No server path
β β Use Model Tool Agent
β
βββ β
Server path exists
β Run TOOL_READINESS_AND_ROUTING_UNIT
β
βββ π’ server_ready
β β Continue to evaluation
β
βββ π‘ server_declared_but_unverified
β β Run smoke test first
β
βββ π΄ tool_broken_needs_repair
β Hand off to Model Tool Agent
Use when: Model is not yet in src/sure_eval/models/
Steps:
- Go to Model Tool Agent README
- Use the model tool agent prompt template
- Let the workflow produce a callable model
- Switch to Main Flow Agent for evaluation
Use when: Model already has a directory in src/sure_eval/models/
Steps:
- Use prompt from Agent README
- Let agent execute:
TASK_CLASSIFICATION_UNITTOOL_READINESS_AND_ROUTING_UNITPLAN_UNITDATASET_SCOPE_UNITSCRIPT_ROUTING_UNITEXECUTION_SURFACE_UNITEXECUTION_READINESS_UNITSMOKE_TEST_UNIT
- Continue to prediction generation and scoring
Recommended artifact root:
src/sure_eval/models/<model>/eval_runs/<run_id>/
Layout contract:
- Python: 3.10+ for the main environment; some models require 3.11.
- System packages:
ffmpeg,libsndfile1(for audio I/O). - Storage: at least 20 GB for model weights and datasets.
- GPU: optional but recommended; Qwen3-ASR can run on CPU, slowly.
- Network: ModelScope access from mainland China; HuggingFace is often blocked.
# Clone repository
git clone https://github.com/PigeonDan1/sure.git
cd sure
# Create and activate main environment (Python 3.12 recommended)
uv venv --python 3.12
source .venv/bin/activate
# Install the framework
uv pip install -e .
# Verify
python -m sure_eval.models.registryEach model also has its own isolated environment under src/sure_eval/models/<model>/.venv/. See the model's setup.sh for details.
Dataset payloads are local-only. The top-level data/ directory is reserved for local mounts, symlinks, caches, and smoke data; tracked dataset registry updates should live under config/ or docs instead.
π‘ Tip: The minimal prompts in the agent READMEs are copy-paste templates for a Chinese-speaking agent runtime. You can translate the instructions to English if your agent runtime prefers it.
Execute evaluation without agents (requires an already-onboarded model such as asr_qwen3):
# 1οΈβ£ Prepare datasets
python scripts/prepare_sure_dataset.py \
--dataset aishell1
# 2οΈβ£ Generate predictions via the model's MCP server
python scripts/generate_predictions_via_server.py \
--model-dir src/sure_eval/models/asr_qwen3 \
--dataset aishell1 \
--run-dir /tmp/eval_run \
--tool-name asr_transcribe \
--language auto \
--resume
# 3οΈβ£ Validate predictions
python scripts/validate_prediction_files.py \
--dataset aishell1 \
--pred-dir /tmp/eval_run/predictions \
--require-nonempty
# 4οΈβ£ Evaluate and record
python scripts/evaluate_predictions.py \
--dataset aishell1 \
--pred-dir /tmp/eval_run/predictions \
--tool-name asr_qwen3 \
--record \
--output /tmp/eval_payload.json
# 5οΈβ£ Refresh report snapshot
python scripts/refresh_report_snapshot.py \
--markdown reports/asr_qwen3.md \
--json reports/asr_qwen3_summary.jsonTASK_CLASSIFICATION_UNIT
β
TOOL_READINESS_AND_ROUTING_UNIT
β
PLAN_UNIT
β
DATASET_SCOPE_UNIT
β
SCRIPT_ROUTING_UNIT
β
EXECUTION_SURFACE_UNIT
β
EXECUTION_READINESS_UNIT
β
EXECUTE / WAIT
β
ASSESSMENT_UNIT
β
RUN_REPORT_UNIT
β οΈ Critical Rule: Never skip tool readiness routing!
If a model declares a server path:
- Prefer server-first smoke test
- Confirm
server_readystatus - Only then proceed to evaluation
π¦ Adapt first, evaluate second.
SURE-EVAL treats model onboarding and evaluation as two distinct stages:
- Stage 1 β Model Tool Agent: turn a raw model into a callable SURE tool.
- Stage 2 β Main Flow Agent: run benchmark evaluation on that tool.
If the main flow sees
not_tool_readyortool_broken_needs_repair, stop evaluation routing and hand off to the Model Tool Agent. Do not improvise evaluation-time fixes.For new models, provide onboarding-oriented inputs early: upstream repo, checkpoint source, expected task/IO contract, and environment hints.
π Example: Qwen3 ASR Case Study
Prediction generation should follow a hard contract rather than an implicit "wait until files appear" step:
For human-operated background runs, prefer a single-model single-dataset shell:
Before handing that shell to a user, the main flow should first materialize the execution surface and then run a bounded execution-readiness validation:
- docs/agents/main_flow_agent/contracts/main_agent_execution_surface_unit.md
- docs/agents/main_flow_agent/contracts/main_agent_execution_readiness_unit.md
Use the prompt template from Agent README, then provide:
MAIN_FLOW_INPUT:
user_goal: evaluate_existing_model
target:
model_name: asr_qwen3
model_dir: src/sure_eval/models/asr_qwen3
tool_workflow_ready: true
constraints:
allow_tool_workflow: true
allowed_tasks: [ASR]
allowed_datasets: null
blocked_datasets: []
dry_run: false
evidence:
readme_path: src/sure_eval/models/asr_qwen3/README.md
config_path: src/sure_eval/models/asr_qwen3/config.yaml
artifacts_dir: src/sure_eval/models/asr_qwen3/artifacts
model_spec_path: src/sure_eval/models/asr_qwen3/model.spec.yaml
runtime_context:
available_scripts:
- scripts/prepare_sure_dataset.py
- scripts/materialize_predictions_template.py
- scripts/validate_prediction_files.py
- scripts/evaluate_predictions.py
output_dir: src/sure_eval/models/asr_qwen3/eval_runs/main_agent_asr_qwen3_001task_classification.jsontool_readiness_routing.jsonmain_agent_plan.jsondataset_decision.jsonscript_routing.jsonexecution_surface.jsonexecution_readiness_report.jsonassessment_report.jsonmain_agent_run_report.jsonmodel_eval_manifest.json
sure-eval/
βββ data/ # π Local dataset mounts and caches; ignored by Git
βββ src/sure_eval/
β βββ core/ # βοΈ Core utilities
β βββ datasets/ # π Dataset management
β βββ evaluation/ # π Metrics and RPS
β βββ models/ # π§ Model registry & onboarded models
β βββ reports/ # π Reporting and baselines
βββ scripts/ # π Deterministic evaluation scripts
βββ config/ # βοΈ Configuration files
βββ fixtures/tasks/ # π§ͺ Shared task fixtures
βββ docs/agents/ # π Agent-scoped harness docs and templates
βββ main_flow_agent/
βββ model_tool_agent/
| Task | Description |
|---|---|
| ASR | Automatic Speech Recognition |
| S2TT | Speech-to-Text Translation |
| SD | Speaker Diarization |
| SA-ASR | Speaker-Aware ASR |
| SER | Speech Emotion Recognition |
| Speech Enhancement | Noise suppression, enhancement |
| Music IR | Music information retrieval |
Q: What do server_declared_but_unverified and tool_broken_needs_repair mean?
| Status | Meaning | Next step |
|---|---|---|
server_ready |
The model server passed the smoke test | Continue to evaluation |
server_declared_but_unverified |
config.yaml declares a server, but it hasn't been smoke-tested |
Run scripts/generate_predictions_via_server.py --max-samples 1 manually |
not_tool_ready |
The model directory is missing required files | Start with the Model Tool Agent |
tool_broken_needs_repair |
The environment or wrapper is broken | Hand off to the Model Tool Agent; do not continue evaluation |
Q: Where are evaluation artifacts stored?
Each run writes structured outputs under src/sure_eval/models/<model>/eval_runs/<run_id>/. See the eval run layout contract.
Q: Can I run evaluation without agents?
Yes. Use the deterministic script pipeline shown in π Deterministic Evaluation Pipeline.
| Document | Purpose |
|---|---|
| User Manual | Complete Chinese user manual (also available as HTML / PDF) |
| Workflow Gallery | Visual overview of both agent workflows |
| Main Flow Agent | Agent system prompt & examples |
| Agent Routing | Main flow routing guide |
| Model Tool Agent | Model integration workflow |
| Onboarded Models | Clean model directory set and local artifact policy |
| Architecture | System architecture details |
| Evaluation Run Layout | Model-local artifact layout per run |
| Prediction Generation Contract | Hard contract for wait_for_predictions |
| Single Model Single Dataset Shell | One-command execution contract for human operators |
| Execution Readiness Unit | Preflight shell validation before background runs |
| Model Eval Manifest | One-file index for a model evaluation run |
| Qwen3 Case Study | Real replay case |
MIT License. See LICENSE.

