Documentation Index
Fetch the complete documentation index at: https://docs.worldflux.ai/llms.txt
Use this file to discover all available pages before exploring further.
Module path
The runtime package isworldflux.runtime (singular). Sources:
The Protocol
doctor returns a list of human-readable diagnostic lines. build_env materialises the venv (or vendor equivalent) for an adapter. run actually launches the command. teardown cleans up.
Context and result
cost_estimate_usd is filled by the AWS plugin when the run uses paid instances. metadata carries free-form key/value pairs that end up in the manifest.
Built-in plugins
name | Module | When |
|---|---|---|
local | local_plugin.LocalPlugin | Anything you can run on the local box. |
modal | modal_plugin.ModalPlugin | Modal sandbox. Requires modal and a Modal token. |
aws-ec2 | aws_ec2_plugin.AwsEc2Plugin | Spin up an EC2 host, run, collect artifacts, terminate. |
replicate | replicate_plugin.ReplicatePlugin | Replicate-hosted models. Requires REPLICATE_API_TOKEN. |
get_runtime("aws-ec2") returns the singleton. list_runtimes() returns the sorted name list. doctor_all() runs every plugin’s doctor() and returns a dict[str, list[str]].
Runtime CLI
Theruntime sub-tree exposes the dispatcher to the CLI:
worldflux runtime list prints registered plugin names. worldflux runtime doctor runs every plugin’s doctor() and prints the result. The same diagnostics also surface in worldflux doctor.
Writing a plugin
Drop the file
Create
src/worldflux/runtime/<name>_plugin.py. Define a class with the four Protocol methods and a name: str class attribute.Register it
In
src/worldflux/runtime/dispatcher.py, import the class and call _register(MyPlugin()) at module bottom.Add a doctor probe
doctor() returns one line per check. Lines starting with error: block runs; everything else is informational. Common checks: binary on $PATH, env vars set, GPU visible, vendor SDK importable.Implement run()
Use
RuntimeContext.venv_python (or the equivalent runtime entrypoint) to launch the command. Capture stdout/stderr to RuntimeContext.output_dir / "logs" / f"{run_id}.log" and pass that path back as RuntimeResult.log_path.What lands in the manifest
Anything the plugin writes viaRuntimeResult.metadata becomes a leaf under manifest.runtime. The recipe-level metrics live under manifest.metrics. Logs are referenced by path (the manifest carries the path, the bytes ride the artifact channel).