Repository avatar
Other Tools
v0.2.1
active

spingi

io.github.ceccode/spingi

Plan, simulate and inspect tasks for legged robots: scenes, plans, runs, episodes. Simulation only.

Documentation

spingi

ci PyPI license: Apache-2.0

Spingi is Italian for "push!", the word you shout at someone who should keep going. Pronounced speen-jee.

The Spingi Viewer replaying a Unitree Go2 on its patrol of an outdoor yard: the 3D scene with the robot on a dirt track, what its head camera sees, the event timeline and the frames it analysed

Spingi is a Physical Agent Runtime for legged robots, humanoids and quadrupeds: it turns a robot into a reliable executor of simple physical tasks (go there, look at this, fetch that, put it here), with safety limits, retries and human escalation built in. It is developed sim-first: everything runs and is tested in MuJoCo with the Unitree G1 humanoid and the Unitree Go2 quadruped before any real robot is involved. Every run produces an episode that the Spingi Viewer replays in the browser.

This repository is a neutral open-source toolkit. Applications built on top of it live elsewhere; this repo keeps sample plans and scenes that show how to use the system.

Status: runtime 0.2.1: two robots that walk in simulation, indoors and outdoors (M4.0 in progress), installable from PyPI and usable from a coding agent · viewer v0.5 · 2026-11-24

What is in the box

FolderProjectWhat it does
runtime/Spingi runtime (Python)Executes a declarative plan made of skills on a robot adapter. Ships with a fake adapter for unit tests and a MuJoCo adapter that drives the Unitree G1 or the Unitree Go2, either gliding along the path (fast, exactly repeatable) or walking with learned controllers on indoor floors and outdoor ground, where it can drift, get stuck and fall. Writes an episode for every run.
viewer/Spingi Viewer (web, Three.js)Loads an episode .zip and replays it: robot and objects moving in the 3D scene, legs included when the robot walked, outdoor ground, what the head camera saw as a video in step with the replay, event timeline, the frames the robot analysed, safety and operator events. Live at spingi-viewer.netlify.app.
docs/episode-format.mdEpisode formatThe contract between the two: a folder with manifest.json, scene.yaml, plan.yaml, events.jsonl, trajectory.jsonl, frames/ and, optionally, the head camera's video head.mp4. JSON schemas in docs/schemas/.

Quick start

Requirements: Python 3.11+ with uv. No GPU, no robot.

1. Run a plan in simulation

uv tool install "spingi[mcp]"
spingi run demo_inspection_round --adapter sim --zip

This installs the spingi command with the simulator, runs the inspection round on the G1 in MuJoCo as fast as the CPU allows and leaves an episode in runs/<run_id>/ of the folder you are in, with a .zip to replay. spingi plans and spingi scenes list the samples the package carries.

The rest of this page uses a clone of the repository, where the samples are files you can read and change, and commands run from runtime/ with uv run (with the installed command, drop uv run; a sample's path names it there too):

git clone https://github.com/ceccode/spingi.git
cd spingi/runtime && make setup
make demo-sim

runs the same round and leaves its episode in runtime/runs/<run_id>/. make demo-sim-go2 runs it on the Go2 quadruped. To watch it live in the MuJoCo viewer (macOS uses mjpython, already included):

make demo-sim-view

To fetch a box from a shelf and deliver it to a workstation, routing through the aisle of a small warehouse:

uv run spingi run plans/demo_material_runner.yaml --scene sim/scenes/warehouse_small.yaml --adapter sim --record --zip

--record adds a third-person video, --zip packs the episode for sharing.

By default the robot's base glides along the path with its legs still: fast and exactly repeatable. With --physics the robot walks, with learned walking controllers standing in for the vendor's (ADR-0015): it drifts, an obstacle in the way is a real contact, a kerb it cannot climb stops it, and it can fall. The Go2 patrolling an industrial yard over asphalt, gravel and dirt, up a ramp onto a loading dock and up a kerb:

uv run spingi run plans/yard_patrol.yaml --scene sim/scenes/yard_outdoor.yaml --adapter sim --robot go2 --physics --zip

A walking robot does not know exactly where it is either. With --realistic it also gets drifting odometry, a camera with a real camera's noise and AprilTags read from its frames (ADR-0016): its pose estimate drifts by a few per cent of the distance walked, and navigate corrects it with tags placed at known spots along the route (the scene's landmarks). Without the tags, drift alone makes most yard patrols fail (37 % succeed in 30 runs); with them the Go2 finished all 30, and the viewer shows where it believed it was next to where it was:

uv run spingi run plans/yard_patrol.yaml --scene sim/scenes/yard_outdoor.yaml --robot go2 --realistic --zip

To see what the robot saw, add --camera-video: the head camera is recorded at 10 frames per second as head.mp4 in the episode (ADR-0017), and the viewer plays it in a corner of the 3D view, in step with the replay. The run takes 3 to 5 times longer, because every frame is rendered; make demo-yard runs the patrol above with it.

plans/test_track.yaml on sim/scenes/test_track.yaml walks a robot over concrete, asphalt, gravel, grass, dirt, rough dirt, a 15 degree ramp and two steps, and stops where it fails: the Go2 usually finishes, the G1, whose controller was trained on flat floors only, falls early.

Or let your coding agent do it

Spingi has an MCP server, so an agent in Claude Code, Codex, OpenCode or any other MCP client can model your place as a scene, write a plan, check both, run it in simulation and tell you how often it works (docs/agents.md has Codex, OpenCode and the others). In Claude Code:

claude mcp add spingi -- spingi mcp

Then ask: "Here is my warehouse: 8 by 6 metres, two shelves along the north wall with a box on each, a bench by the east wall. Make a scene of it and check both boxes are in place." The agent writes the scene, the checks tell it what its first draft gets wrong, it shows you a map and runs the round. Everything stays in simulation and on your machine; the agent never moves the robot outside a validated plan (ADR-0030).

2. Replay the episode in the browser

Open https://spingi-viewer.netlify.app and drop the .zip onto the page, or pick one of the bundled samples. Nothing is uploaded: the episode is read in your browser. To run the viewer locally (Node 20+), from the repository root:

cd viewer && npm install && npm run dev

Then open http://localhost:5173. Space plays and pauses, the arrow keys step one second, clicking an event jumps to it. An episode recorded with --camera-video shows the head camera's view in the bottom right corner ("robot's view" in the bar below turns it off, a click enlarges it): the yard patrol sample has one, so you can see the Go2 find the tags by the pump while the orange outline shows where it believed it was.

3. Supervise a run, measure it, export it

From runtime/ again. Answer the robot's requests yourself instead of a fixed policy, with Ctrl+C as the stop button:

uv run spingi run plans/demo_material_runner.yaml --scene sim/scenes/warehouse_small.yaml --adapter sim --operator console

Run the same plan 100 times with noisy perception and check the sim-to-real gate (success rate, operator requests, fatal runs, safety violations):

uv run spingi bench plans/demo_material_runner.yaml --scene sim/scenes/warehouse_small.yaml --adapter sim --runs 100 --noise 0.2 --gate

Turn episodes into a LeRobotDataset v3.0 for training tools:

uv run spingi export lerobot runs/r-*/ --out runs/dataset

4. Ask in plain language

With an Anthropic API key in runtime/.env (copy runtime/.env.example; the file is ignored by git), Claude turns a request into a plan that is validated against the skills and the scene's locations before anything moves, and can run it straight away under your supervision once you confirm it (--yes skips the question):

uv run spingi plan "Bring the red box from shelf A to workstation B" --scene sim/scenes/warehouse_small.yaml --run --adapter sim

spingi eval-planner measures the planner on ten golden requests. The model never controls the robot: it can only write steps made of whitelisted skills, and a plan that does not validate is never executed.

5. Write your own plan

A plan is a YAML list of skills with a failure policy per step. No branches, no loops: when a decision is needed, a new plan is generated. The tutorial writes a first patrol for the Go2 step by step, from the scene to the viewer and the benchmark.

id: fetch_box
description: "Fetch the red box from shelf A and bring it to workstation B"
steps:
  - skill: navigate
    params: { to: shelf_A, via: [aisle_in] }
    on_failure: { retry: 2, then: needs_human }
  - skill: detect
    params: { cls: red_box, expect: 1 }
  - skill: pick
    params: { object_id: "$detect.objects[0].id" }   # reference to the previous step's evidence
  - skill: navigate
    params: { to: workstation_B, via: [aisle_out] }
  - skill: place
    params: { at: workstation_B }

Skills available today: navigate, detect, pick, place, inspect, wait_for_human, say. uv run spingi skills prints their parameters. Each run stands for one robot profile (--robot g1, the default, or --robot go2): a skill the robot cannot run, pick or place on a Go2 without an arm, makes the plan invalid before anything moves, and the LLM planner never sees it (ADR-0012). A scene is a YAML file too: named locations, obstacles, objects, safety limits (geofence, speed cap, battery minimum) and, outdoors, the ground: surfaces with their grip and roughness, ramps, kerbs and raised areas. See runtime/sim/scenes/.

A scene is checked like a plan (ADR-0028): a key nobody declares is an error, so a misspelled obstacles: cannot leave a wall out of the world. Before running anything, spingi check says what a robot would meet, a leg that crosses a shelf, a stop from which the camera sees nothing, and spingi map draws the scene from above:

uv run spingi check yard_outdoor --plan yard_patrol --robot go2
uv run spingi map yard_outdoor

The yard scene drawn from above: surfaces, obstacles, the geofence, named locations with their heading, objects, AprilTag landmarks and routes

How it works

request ──► LLMPlanner ──► plan.yaml ──► Executor ──► skills ──► RobotAdapter ──► FakeAdapter | SimAdapter (MuJoCo) | real robot (M4)
                                             │             │
                                             │             └── Perceiver (ground truth in simulation; markers and detector later)
                                             ├── SafetyMonitor: independent task on robot time, geofence (e-stop), speed cap, battery, watchdog
                                             └── EventLog ──► console · metrics · episode (events, trajectory, frames) ──► Viewer, LeRobot

Eight principles drive the design, written down in docs/runtime-spec.md and in the ADRs. The two that matter most: a language model may propose a plan but never controls the robot directly, and every component is testable without hardware.

Safety layers run on the robot's own clock (simulated time in MuJoCo), so a simulation faster than real time is checked as often as the real robot would be. An e-stop ends the run (status estop), leaving the geofence e-stops the robot, and any failure inside the runtime stops the robot and still records the episode (ADR-0011).

Documentation

DocumentContent
docs/agents.mdSpingi from Claude Code, Codex, OpenCode and other MCP clients: install, connect, what to ask, the tools, what the server will not do
docs/tutorial.mdStep by step: read a scene, write a plan, run it from the fake adapter up to realistic sensors, replay it in the viewer, place landmarks, measure it with bench, model your own place
docs/runtime-spec.mdPrinciples, architecture, contracts, execution model, safety layers, testing strategy, milestones
docs/episode-format.mdThe episode folder, manifest, trajectory, frames, compatibility rules
adr/Architecture decisions 0001–0031 and the ones still open
runtime/README.mdCLI reference, scenes, plans, skills, episodes, tests, how to add a skill or an adapter
viewer/README.mdRunning, loading episodes, deploying
SECURITY.mdThreat model and how to report a security or safety problem
CONTRIBUTING.mdSet up, the checks before a pull request, the rules of the house
CHANGELOG.mdWhat changed, version by version
docs/releasing.mdHow a version is released: a tag, PyPI, the MCP Registry

Development

make test

runs the runtime suite (unit, adapter contract on every adapter and robot, MuJoCo scenarios kinematic and walking, golden episodes, architecture, licensing and release rules, the public API and the MCP server through a client): about 600 tests in about a minute. The viewer has npm test (73 tests), npm run e2e (the samples replayed in Chromium) and npm run build. How to contribute is in CONTRIBUTING.md. CI is GitHub Actions (.github/workflows/ci.yml), on every push to main and every pull request, without a GPU: runtime lint, format check and tests (with offscreen MuJoCo rendering through EGL), viewer install, audit of the production dependencies, tests and build.

Conventions: every architectural decision is an ADR, changed by writing a new one; the runtime never imports the viewer and the viewer never imports the runtime, they only share the episode format; spingi.core imports nothing from adapters, skills, planner or perception, and a test enforces it.

Roadmap

  • M2 (done): operator console, spingi bench with the sim-to-real gate, LeRobot v3.0 export, wait_for_human.
  • M3 (done): LLM planner with structured output, golden episodes replayed on every commit. On the ten golden requests claude-opus-5-5 scored 10/10, nine at the first attempt.
  • M4.0 (in progress, no robot needed): perception on real images (AprilTag markers, exercised on MuJoCo frames), the lab safety checklist, the remaining decisions as ADRs, the p95 check of the gate, and a simulator where the robots walk with learned controllers on indoor floors and outdoor ground, with drifting odometry corrected by AprilTag landmarks and a noisy camera, so that plans meet drift, blocked paths and falls before a robot does; episodes can keep what the head camera saw, as a video the viewer plays with the replay.
  • M4.1 (needs a Go2 and a fenced area): one Unitree adapter on unitree_sdk2_python, parametrized by the robot profile, contract tests with the robot connected, sim-to-real gate on navigate and inspect.
  • M4.2 (needs a G1): the same adapter and gate on the humanoid, then pick and place in M5.

License

Apache License 2.0, see LICENSE. The Unitree G1 and Go2 models in runtime/sim/models/, and the viewer's g1.glb and go2.glb derived from them, are redistributed under their own BSD 3-Clause license; the walking policies in runtime/sim/policies/ come from unitree_rl_mjlab and rl_sar under the Apache License 2.0; see NOTICE. The viewer serves the license texts at /NOTICE.txt, and the Python package ships copies of LICENSE and NOTICE.

PYPI
spingi
Install Command
pip install spingi
Runtime: uvx