Skip to main content

Factory Functions

The main entry points for creating and managing world models.

For docstring-derived details, see Factory API (Autogenerated).

create_world_model

Create a world model from a preset, alias, or saved path.

from worldflux import create_world_model

model = create_world_model(
model="dreamerv3:size12m",
obs_shape=(3, 64, 64),
action_dim=4,
device="cpu",
)

If you request a non-native backend via backend=..., create_world_model() returns an OfficialBackendHandle instead of instantiating a local PyTorch model. Pass that handle to Trainer(...).submit() or execution/parity flows.

Parameters

ParameterTypeDefaultDescription
modelstrrequiredModel preset, alias, or path to a saved model
obs_shapetuple[int, ...]NoneOptional observation-shape override for the selected preset/config
action_dimintNoneOptional action-dimension override (defaults to config value, typically 6)
devicestr"cpu"Device to place model on
api_versionstr"v3"API compatibility mode
**kwargsConfig overrides for the selected model family

Model Specifiers

Presets (type:size)

model = create_world_model("dreamerv3:size12m", ...)
model = create_world_model("tdmpc2:5m", ...)

CI Presets (*:ci)

model = create_world_model("dreamer:ci", ...)
model = create_world_model("tdmpc2:ci", ...)

Aliases

# DreamerV3 aliases
model = create_world_model("dreamer", ...) # dreamerv3:size12m
model = create_world_model("dreamer-ci", ...) # dreamer:ci
model = create_world_model("dreamer-small", ...) # dreamerv3:size12m
model = create_world_model("dreamer-medium", ...) # dreamerv3:size50m
model = create_world_model("dreamer-large", ...) # dreamerv3:size200m

# TD-MPC2 aliases
model = create_world_model("tdmpc", ...) # tdmpc2:5m
model = create_world_model("tdmpc2-ci", ...) # tdmpc2:ci
model = create_world_model("tdmpc-small", ...) # tdmpc2:5m
model = create_world_model("tdmpc-medium", ...) # tdmpc2:48m
model = create_world_model("tdmpc-large", ...) # tdmpc2:317m

The list above shows common aliases. For the current full alias map in your runtime:

from worldflux import MODEL_ALIASES
print(MODEL_ALIASES)

In the current implementation, dreamer family aliases resolve to DreamerV3 presets.

Load from Path

model = create_world_model("./my_saved_model")
model = create_world_model("/path/to/checkpoint")

Config Overrides

model = create_world_model(
"tdmpc2:19m",
obs_shape=(39,),
action_dim=6,
hidden_dim=768, # Valid TDMPC2Config field
num_q_networks=7, # Valid TDMPC2Config field
)

Use config-field names that exist on the selected config class.

Returns

  • backend="native_torch": a local model implementing the WorldModel protocol
  • backend!="native_torch": an OfficialBackendHandle for delegated execution

Delegated Backend Example

from worldflux import create_world_model
from worldflux.training import Trainer, TrainingConfig

handle = create_world_model(
"dreamerv3:official_xl",
backend="worldflux_dreamerv3_jax_subprocess",
device="cuda",
)

trainer = Trainer(
handle,
TrainingConfig(
backend="worldflux_dreamerv3_jax_subprocess",
backend_profile="official_xl",
device="cuda",
),
)
job = trainer.submit()

list_models

List available model presets.

from worldflux import list_models

# Supported MVP presets only
models = list_models()

# Supported MVP presets with descriptions
models = list_models(verbose=True)

# Include advanced proof-oriented presets explicitly
models = list_models(verbose=True, surface="public")

# Include experimental / internal families explicitly
models = list_models(verbose=True, surface="all")

Parameters

ParameterTypeDefaultDescription
verboseboolFalseReturn detailed metadata instead of only names
maturitystr | NoneNoneOptional maturity filter (reference, experimental, skeleton)
surfacestr"supported"Public surface filter. One of "supported", "public", or "all"

Returns

  • verbose=False: list[str] of model names
  • verbose=True: dict[str, dict] with catalog metadata

Reference Presets

DreamerV3

PresetApprox Paramsdeter_dimstoch_discretestoch_classes
dreamer:ci~0.1M6444
dreamerv3:size12m~12M20481616
dreamerv3:size25m~25M40963216
dreamerv3:size50m~50M40963232
dreamerv3:size100m~100M81923232
dreamerv3:size200m~200M81923232
dreamerv3:official_xl~200-300M81923264

TD-MPC2

PresetApprox Paramslatent_dimhidden_dimnum_q_networks
tdmpc2:ci~0.1M32322
tdmpc2:5m~5M2562565
tdmpc2:proof_5m~5M2562565
tdmpc2:5m_legacy~5M2562565
tdmpc2:19m~19M5125125
tdmpc2:48m~48M51210245
tdmpc2:317m~317M102420485

Parity Roles

  • dreamer:ci, tdmpc2:ci: CI / quick validation / scaffold presets. Do not use them for proof-grade parity.
  • dreamerv3:official_xl: Dreamer proof-canonical preset.
  • tdmpc2:proof_5m: TD-MPC2 proof-canonical preset.
  • tdmpc2:5m: TD-MPC2 compatibility preset.
  • tdmpc2:5m_legacy: TD-MPC2 legacy compatibility preset.
  • The remaining reference-family presets are for experimentation and capacity tuning.

For advanced proof-oriented presets, use:

worldflux models list --surface public --verbose

For the complete catalog (including experimental/skeleton families), use:

worldflux models list --surface all --verbose