Runs and benchmarks

Canonical in-process dispatch for existing artifacts, model inference, benchmark cells, and suites.

On this page

run_worldfoundry is the broad public entrypoint. It examines one typed request and dispatches to the narrow existing-results, model-generation, single model × benchmark, or suite runner. Use the narrower benchmark facade when the generated artifacts already exist and only an official evaluator or normalizer should run.

Import the symbols on this page from worldfoundry.evaluation.public.

A complete no-GPU run

This example creates one small trajectory artifact, writes request and result ledgers, and evaluates the existing result with the built-in artifact_count metric. It exercises the real run/reporting path without loading a model.

from pathlib import Path

from worldfoundry.evaluation.api import ArtifactRef, GenerationRequest, GenerationResult
from worldfoundry.evaluation.public import WorldFoundryRunRequest, run_worldfoundry

root = Path("tmp/python_api_example")
trace_path = root / "artifacts" / "trajectory.json"
trace_path.parent.mkdir(parents=True, exist_ok=True)
trace_path.write_text('{"actions":["forward","left"]}\n', encoding="utf-8")

request = GenerationRequest(sample_id="nav-0001", task_name="navigation-trace")
result = GenerationResult(
    sample_id=request.sample_id,
    model_id="existing-trace",
    artifacts={
        "trajectory": ArtifactRef.from_path(trace_path, kind="trajectory"),
    },
)

requests_path = root / "requests.jsonl"
results_path = root / "results.jsonl"
requests_path.write_text(request.to_json() + "\n", encoding="utf-8")
results_path.write_text(result.to_json() + "\n", encoding="utf-8")

outcome = run_worldfoundry(
    WorldFoundryRunRequest(
        output_dir=root / "evaluation",
        requests_path=requests_path,
        results_path=results_path,
        metrics=("artifact_count",),
    )
)

assert outcome.ok
print(outcome.to_dict()["scorecard_path"])

The output directory contains aligned ledgers, an execution plan, metric rows, run_manifest.json, summary.json, report.md, and scorecard.json. The run is valid as an existing-results artifact check; it does not become an official benchmark or leaderboard result.

WorldFoundryRunRequest

The request intentionally covers several modes. results_path selects existing-results evaluation. A model ID without benchmark IDs selects model execution. Model and benchmark IDs together select a benchmark cell; multiple selections or suite IDs select the matrix runner. execute=False plans compatible cells without spending compute.

class

WorldFoundryRunRequest

Source
class WorldFoundryRunRequest(output_dir: str | Path,model_ids: Sequence[str] = (),benchmark_ids: Sequence[str] = (),suite_ids: Sequence[str] = (),all_benchmarks: bool = False,benchmark_id: str | None = None,benchmark_manifest_dir: str | Path = BENCHMARK_ZOO_DIR,model_manifest_dir: str | Path | None = MODEL_ZOO_DIR,suite_preset_path: str | Path | None = None,engine: str = 'auto',benchmark_mode: str = 'official-run',execute: bool = True,model_workers: int = 1,worker_cuda_devices: Sequence[str] = (),resume: bool = False,skip_incompatible: bool = True,fail_on_skipped: bool = False,model_runner: str | None = None,model_variant_id: str | None = None,model_parameters: Mapping[str, Any] | None = None,model_runtime: Mapping[str, Any] | None = None,model_config: Mapping[str, Any] | Any | None = None,requests_path: str | Path | None = None,results_path: str | Path | None = None,task_name: str | None = None,task_roots: Sequence[str | Path] | None = None,task_benchmark: str | None = None,task_recursive: bool = False,task_root_dir: str | Path | None = None,dataset_root: str | Path | None = None,dataset_id: str | None = None,split: str = 'default',num_samples: int | None = None,generated_artifact_dir: str | Path | None = None,output_artifact: str | None = None,required_artifacts: Sequence[str] | None = None,metrics: Sequence[str] = ('artifact_count', 'required_artifacts_present'),generation_cache_dir: str | Path | None = None,generation_cache_mode: str = 'off',generation_cache_namespace: str = 'worldfoundry_run',benchmark_timeout_seconds: float | None = None,benchmark_workdir: str | Path | None = None,benchmark_env: Mapping[str, Any] | None = None,benchmark_parameters: Mapping[str, Any] | None = None,materialize_placeholders: bool | None = None,contract_fixture: bool = False,fail_on_generation_error: bool = False,run_id: str | None = None,fail_on_sample_error: bool = False,write_artifacts_index: bool = True)
worldfoundry.evaluation.publicfrom worldfoundry.evaluation.public import WorldFoundryRunRequest

Top-level request to launch an in-process WorldFoundry evaluation run (model, task, limits, output dirs).

Attributes

output_dirstr | Path
model_idsSequence[str]default ()
benchmark_idsSequence[str]default ()
suite_idsSequence[str]default ()
all_benchmarksbooldefault False
benchmark_idstr | Nonedefault None
benchmark_manifest_dirstr | Pathdefault BENCHMARK_ZOO_DIR
model_manifest_dirstr | Path | Nonedefault MODEL_ZOO_DIR
suite_preset_pathstr | Path | Nonedefault None
enginestrdefault 'auto'
benchmark_modestrdefault 'official-run'
executebooldefault True
model_workersintdefault 1
worker_cuda_devicesSequence[str]default ()
resumebooldefault False
skip_incompatiblebooldefault True
fail_on_skippedbooldefault False
model_runnerstr | Nonedefault None
model_variant_idstr | Nonedefault None
model_parametersMapping[str, Any] | Nonedefault None
model_runtimeMapping[str, Any] | Nonedefault None
model_configMapping[str, Any] | Any | Nonedefault None
requests_pathstr | Path | Nonedefault None
results_pathstr | Path | Nonedefault None
task_namestr | Nonedefault None
task_rootsSequence[str | Path] | Nonedefault None
task_benchmarkstr | Nonedefault None
task_recursivebooldefault False
task_root_dirstr | Path | Nonedefault None
dataset_rootstr | Path | Nonedefault None
dataset_idstr | Nonedefault None
splitstrdefault 'default'
num_samplesint | Nonedefault None
generated_artifact_dirstr | Path | Nonedefault None
output_artifactstr | Nonedefault None
required_artifactsSequence[str] | Nonedefault None
metricsSequence[str]default ('artifact_count', 'required_artifacts_present')
generation_cache_dirstr | Path | Nonedefault None
generation_cache_modestrdefault 'off'
generation_cache_namespacestrdefault 'worldfoundry_run'
benchmark_timeout_secondsfloat | Nonedefault None
benchmark_workdirstr | Path | Nonedefault None
benchmark_envMapping[str, Any] | Nonedefault None
benchmark_parametersMapping[str, Any] | Nonedefault None
materialize_placeholdersbool | Nonedefault None
contract_fixturebooldefault False
fail_on_generation_errorbooldefault False
run_idstr | Nonedefault None
fail_on_sample_errorbooldefault False
write_artifacts_indexbooldefault True

WorldFoundryRunResult

The wrapper exposes common status, exit code, output directory, and a mode-specific delegate. to_dict() lifts commonly needed manifest and scorecard paths from that delegate so automation does not need a branch for every run kind.

class

WorldFoundryRunResult

Source
class WorldFoundryRunResult(schema_version: str,kind: str,status: str,exit_code: int,output_dir: Path,delegate: Any)
worldfoundry.evaluation.publicfrom worldfoundry.evaluation.public import WorldFoundryRunResult

Structured result of run_worldfoundry: paths to manifests, scorecards, and per-sample ledgers.

Attributes

schema_versionstr
kindstr
statusstr
exit_codeint
output_dirPath
delegateAny

Methods

propok -> boolSource

Return True if the run completed successfully with exit code 0.

Parameters

self

Returns

bool
methto_dict() -> dict[str, Any]Source

Convert the run result and its delegate details into a serializable dictionary.

Returns

dict[str, Any]

run_worldfoundry

Pass either a typed request, a mapping, or keyword arguments. A typed request is preferred for editor support and for catching misspelled fields before execution.

function

run_worldfoundry

Source
def run_worldfoundry(request: WorldFoundryRunRequest | Mapping[str, Any] | None = None,**kwargs: Any) -> WorldFoundryRunResult
worldfoundry.evaluation.publicfrom worldfoundry.evaluation.public import run_worldfoundry

Canonical in-process entrypoint: execute a WorldFoundryRunRequest and return evidence artifacts.

Parameters

requestWorldFoundryRunRequest | Mapping[str, Any] | Nonedefault None
kwargsAny

list_video_benchmarks

This discovery helper returns IDs from the checked-in video benchmark catalog. It does not claim that every returned benchmark is locally runnable; inspect readiness and assets separately.

function

list_video_benchmarks

Source
def list_video_benchmarks(catalog_dir: str | Path | None = None) -> list[str]
worldfoundry.evaluation.publicfrom worldfoundry.evaluation.public import list_video_benchmarks

List registered video benchmarks available to the public evaluation facade.

Parameters

catalog_dirstr | Path | Nonedefault None

Returns

list[str]

run_benchmark

Use this facade when artifacts are already materialized and a benchmark-specific path should run. official-run invokes the configured official runtime, official-validation executes its bounded validation path, and normalizer imports caller-provided official-shaped results.

result = run_benchmark(
    "vbench",
    output_dir="tmp/vbench_run",
    generated_artifact_dir="runs/generated_videos",
    mode="official-run",
)

The call above is a real API shape, but it requires the assets, dependencies, generated prompt coverage, and environment reported by the current VBench manifest. Runner availability alone does not guarantee leaderboard readiness.

function

run_benchmark

Source
def run_benchmark(benchmark_id: str,output_dir: str | Path,mode: str = 'official-run',generated_artifact_dir: str | Path | None = None,manifest_path: str | Path = BENCHMARK_ZOO_DIR,**kwargs: Any) -> Any
worldfoundry.evaluation.publicfrom worldfoundry.evaluation.public import run_benchmark

Overview

Run a named benchmark through the public facade with normalized inputs and outputs.

Source docstring

Run a benchmark through the unified official runner stack.

Modes mirror `worldfoundry-eval zoo benchmark-run`:

  • `normalizer`: normalize caller-provided official results
  • `official-validation`: run the benchmark's bounded validation command
  • `official-run`: invoke upstream official runtime when assets are available

Parameters

benchmark_idstr
output_dirstr | Path
modestrdefault 'official-run'
generated_artifact_dirstr | Path | Nonedefault None
manifest_pathstr | Pathdefault BENCHMARK_ZOO_DIR
kwargsAny

Returns

Any

normalize_upstream_results

Use this function when the upstream evaluator has already produced a result file. It creates WorldFoundry evidence around that file; it does not retroactively prove that WorldFoundry executed the official evaluator.

function

normalize_upstream_results

Source
def normalize_upstream_results(benchmark_id: str,results_path: str | Path,output_dir: str | Path,generated_artifact_dir: str | Path | None = None,manifest_path: str | Path = BENCHMARK_ZOO_DIR,**kwargs: Any) -> Any
worldfoundry.evaluation.publicfrom worldfoundry.evaluation.public import normalize_upstream_results

Adapt upstream/vendor result payloads into WorldFoundry GenerationResult records.

Parameters

benchmark_idstr
results_pathstr | Path
output_dirstr | Path
generated_artifact_dirstr | Path | Nonedefault None
manifest_pathstr | Pathdefault BENCHMARK_ZOO_DIR
kwargsAny

Returns

Any

benchmark_integration_spec

This lookup returns the registered in-tree integration specification when one exists. A catalog entry can exist without a corresponding integration spec, so None is a normal discovery result.

function

benchmark_integration_spec

Source
def benchmark_integration_spec(benchmark_id: str) -> BenchmarkIntegrationSpec | None
worldfoundry.evaluation.publicfrom worldfoundry.evaluation.public import benchmark_integration_spec

Describe how an upstream benchmark integrates (entrypoints, artifacts, env needs).

Parameters

benchmark_idstr

Returns

BenchmarkIntegrationSpec | None

Use the Benchmark Hub to understand protocol-specific inputs and blockers before calling an official runtime.