Models and runners

Public model metadata, construction, execution protocols, and the shared pipeline surface.

On this page

WorldFoundry exposes two related extension boundaries. WorldModelRunner is the evaluation-facing protocol: it accepts normalized requests and returns normalized results. PipelineABC is the model-facing convenience layer: it owns loading and native inference behavior. An integration may implement both, or use an adapter between them.

WorldModelManifest

The public manifest is a compact DTO for model identity and capability. It is not the full catalog YAML and it is not runtime proof; it carries the fields that runner resolution and evaluation need after catalog loading.

class

WorldModelManifest

Source
class WorldModelManifest(model_id: str,name: str = '',aliases: tuple[str, ...] = (),version: str = '',provider: str = '',capabilities: tuple[str, ...] = (),supported_tasks: tuple[str, ...] = (),required_artifacts: tuple[str, ...] = (),output_artifacts: tuple[str, ...] = (),tags: tuple[str, ...] = (),metadata: Mapping[str, Any] = <dict factory>,schema_version: str = WORLD_MODEL_MANIFEST_SCHEMA_VERSION)
worldfoundry.evaluation.apifrom worldfoundry.evaluation.api import WorldModelManifest

Compact public DTO for model identity and capabilities after catalog resolution. Not a full YAML dump and not proof that a checkpoint loaded.

Attributes

model_idstr
namestrdefault ''
aliasestuple[str, ...]default ()
versionstrdefault ''
providerstrdefault ''
capabilitiestuple[str, ...]default ()
supported_taskstuple[str, ...]default ()
required_artifactstuple[str, ...]default ()
output_artifactstuple[str, ...]default ()
tagstuple[str, ...]default ()
metadataMapping[str, Any]default <dict factory>
schema_versionstrdefault WORLD_MODEL_MANIFEST_SCHEMA_VERSION

Methods

cmethfrom_dict(data: Mapping[str, Any]) -> 'WorldModelManifest'Source

Public classmethod on this type.

Parameters

dataMapping[str, Any]

WorldModelConfig

WorldModelConfig is the construction payload passed to a runner. Put model-native knobs in parameters, execution placement or endpoint settings in runtime, and preserve the resolved public manifest when one is available.

from worldfoundry.evaluation.api import WorldModelConfig

config = WorldModelConfig(
    model_id="matrix-game-2",
    runner="worldfoundry.evaluation.models.runners.pipeline:WorldFoundryPipelineRunner",
    variant="matrix-game-2-universal-action-validation",
    parameters={"num_output_frames": 15, "fps": 12},
    runtime={"device": "cuda:0"},
    seed=42,
)

The target above is the current Matrix-Game 2 catalog binding. Runtime bindings can evolve, so production code should still resolve the current model manifest rather than hard-coding a documentation example.

class

WorldModelConfig

Source
class WorldModelConfig(model_id: str,runner: str,variant: str = '',parameters: Mapping[str, Any] = <dict factory>,runtime: Mapping[str, Any] = <dict factory>,seed: int | None = None,manifest: WorldModelManifest | None = None,metadata: Mapping[str, Any] = <dict factory>,schema_version: str = WORLD_MODEL_CONFIG_SCHEMA_VERSION)
worldfoundry.evaluation.apifrom worldfoundry.evaluation.api import WorldModelConfig

Construction payload for a runner: model id, runner target, variant, parameters, and runtime placement. Keep model-native knobs in parameters.

Attributes

model_idstr
runnerstr
variantstrdefault ''
parametersMapping[str, Any]default <dict factory>
runtimeMapping[str, Any]default <dict factory>
seedint | Nonedefault None
manifestWorldModelManifest | Nonedefault None
metadataMapping[str, Any]default <dict factory>
schema_versionstrdefault WORLD_MODEL_CONFIG_SCHEMA_VERSION

Methods

cmethfrom_dict(data: Mapping[str, Any]) -> 'WorldModelConfig'Source

Public classmethod on this type.

Parameters

dataMapping[str, Any]

WorldModelRunner

This runtime-checkable protocol is intentionally small. A local checkpoint class, hosted API client, simulator policy, or subprocess bridge can all satisfy it without sharing an inheritance hierarchy.

from worldfoundry.evaluation.api import GenerationResult, WorldModelRunner

class ExistingArtifactRunner:
    model_id = "existing-artifact"
    capabilities = {"video_generation"}

    @classmethod
    def from_config(cls, config):
        return cls()

    def generate(self, requests):
        return [
            GenerationResult(
                sample_id=request.sample_id,
                model_id=self.model_id,
                status="failed",
                error="No generation implementation was configured.",
            )
            for request in requests
        ]

    def cleanup(self):
        pass

assert isinstance(ExistingArtifactRunner(), WorldModelRunner)

The example returns explicit failures to demonstrate the contract; a real runner must materialize artifacts and populate them in each successful result.

protocol

WorldModelRunner

Source
class WorldModelRunner(model_id: str,capabilities: Collection[str])
worldfoundry.evaluation.apifrom worldfoundry.evaluation.api import WorldModelRunner

Minimal runtime-checkable protocol: accept GenerationRequest(s) and return GenerationResult(s). Local checkpoints, APIs, and simulators can all implement it.

Attributes

model_idstr
capabilitiesCollection[str]

Methods

cmethfrom_config(config: WorldModelConfig) -> 'WorldModelRunner'Source

Public classmethod on this type.

Parameters

methgenerate(requests: Sequence[GenerationRequest]) -> Sequence[GenerationResult]Source

Public method on this type.

Parameters

requestsSequence[GenerationRequest]

Returns

methcleanup() -> NoneSource

Public method on this type.

Returns

None

PipelineABC

PipelineABC gives model integrations a shared loading and call shape while preserving native behavior. from_pretrained constructs components, process normalizes inputs, __call__ runs one inference, and stream exposes the same operation to interactive surfaces. Production pipelines may override any of these methods.

class

PipelineABC

Source
class PipelineABC(model_id: str | None = None,operators: Any = None,operator: Any = None,synthesis_model: Any = None,memory_module: Any = None,device: str = 'cuda',**kwargs: Any)
worldfoundry.pipelines.pipeline_utilsfrom worldfoundry.pipelines.pipeline_utils import PipelineABC

Overview

Model-facing pipeline base that owns load and native inference helpers. Pair with WorldModelRunner when evaluation needs a normalized boundary.

Source docstring

Shared, non-strict base for WorldFoundry pipelines.

The class intentionally avoids abstract methods because many existing pipelines predate this contract. Subclasses can override any method while still sharing a stable framework surface.

Parameters

model_idstr | Nonedefault None
operatorsAnydefault None
operatorAnydefault None
synthesis_modelAnydefault None
memory_moduleAnydefault None
devicestrdefault 'cuda'
kwargsAny

Methods

cmethfrom_pretrained(model_path: Any = None,required_components: dict[str, Any] | None = None,device: str = 'cuda',model_id: str | None = None,**kwargs: Any) -> 'PipelineABC'Source

Overview

Create a pipeline with the unified loading signature.

Source docstring

Create a pipeline with the unified loading signature.

This default is a compatibility implementation for lightweight or test pipelines. Production pipelines are expected to override it when they need to load model components.

Parameters

model_pathAnydefault None
required_componentsdict[str, Any] | Nonedefault None
devicestrdefault 'cuda'
model_idstr | Nonedefault None
kwargsAny

Returns

methprocess(*args: Any,**kwargs: Any) -> AnySource

Overview

Normalize inputs before inference.

Source docstring

Normalize inputs before inference.

Pipelines with operators should override this. The fallback preserves all caller data in a predictable shape for simple passthrough pipelines.

Parameters

argsAny
kwargsAny

Returns

Any
meth__call__(*args: Any,**kwargs: Any) -> AnySource

Run the pipeline by delegating to :meth:process by default.

Parameters

argsAny
kwargsAny

Returns

Any
methstream(*args: Any,**kwargs: Any) -> AnySource

Yield pipeline outputs using the same call semantics as `__call__`.

Parameters

argsAny
kwargsAny

Returns

Any
methget_operator() -> AnySource

Get operator for PipelineABC.

Returns

Any
methget_synthesis_model() -> AnySource

Get synthesis model for PipelineABC.

Returns

Any

Which boundary should an integration implement?

Implement WorldModelRunner when the goal is benchmark execution, batching normalized samples, caching, or producing evaluation ledgers. Implement or subclass PipelineABC when the goal is a reusable model-native inference object for scripts or Studio. If both are needed, keep checkpoint loading and native calls in the pipeline, then let the runner/operator translate GenerationRequest into pipeline inputs and pipeline output into GenerationResult.

For a complete repository integration, API conformance is only one step. The add a model guide also covers catalog identity, assets, runtime binding, bounded validation, and documentation.