Skip to main content
The stack runs a goal-directed perceive → reason → act loop that turns a natural-language goal into robot actions using a pluggable world model (your VLA / policy). It lives under cadenza.stack. The world model never touches motors. It reads an observation and proposes named actions from the action vocabulary. The stack validates, times, and executes them, then feeds the next observation back.

Run with a world model

StackResult carries .done, .total_actions, .executed, .notes, and .final_observation.

Choosing the model

register_world_model pins the auto-detected model. After calling it, run with world_model=None. To address an adapter by name string, register the class with cadenza.stack.adapters.base.register_adapter first.

Implement a world model

Subclass WorldModelAdapter and implement propose_actions.
propose_actions is called with keyword arguments. The first parameter must be named exactly observation (then goal, vocabulary, history), and it must return an AdapterReply, not a bare list. Set done=True to end the loop.
In ProposedAction(name, params={}, rationale=""), name must be in the vocabulary and params accepts distance_m, rotation_rad, speed, and so on. Wrap them in AdapterReply(actions=[], done=False, note="").

Modalities

A Modality computes extra observation keys each tick (depth, vision, distance to target, …). It’s how the model “sees” more than raw proprioception.
The keys merge into the dict your adapter receives. summary is printed each tick when verbose=True. compute takes an Observation.
Pass instances/classes/names to run(..., modalities=[Proximity()]).

Demo: drive a goal headless

This runs with no model on disk and no display. It is a self-contained heuristic adapter plus a modality, the exact pattern used in the full project.