Who it is forA developer building an app or agent workflow that needs a physical reasoning model reachable through a standard chat API on their own GPU.
The problemCalling the checkpoints directly from custom Python code is awkward when the rest of the stack already speaks the OpenAI chat format.
The outcomeA running vLLM server that hosts code-as-world-4b (or code-as-world-9b) through the OpenAI-compatible API.
What you need first
- Python 3.10 or 3.11
- A CUDA host for the checkpoints
- git and the hf CLI to clone repos and download weights
- Disk space and network access for the 4B and 9B weights and the QuantiPhy validation videos
Steps
- Clone the repo with
git clone https://github.com/MirroS-Lab/Code-as-World.git, runcd Code-as-World, create a environment withpython -m venv .venv, activate it withsource .venv/bin/activate, and runpip install -r requirements/inference.txt. - Download the checkpoint with
hf download MirroS-Lab/Code-as-World-VL-4B --local-dir weights/4b. - Start the server with
CUDA_VISIBLE_DEVICES=0 vllm serve weights/4b --served-model-name code-as-world-4b --chat-template code_as_world/templates/qwen3_5_no_think.jinja, adding the remaining flags from the README's OpenAI-compatible serving block (including--media-io-kwargs,--mm-processor-kwargs, and--generation-config vllm). (inferred, check the README) - For the 9B checkpoint, swap
weights/4bandcode-as-world-4bforweights/9bandcode-as-world-9b, and download it withhf download MirroS-Lab/Code-as-World-VL-9B --local-dir weights/9b.
Prompt for your agent
In the Code-as-World repo at <repo_path>, start the vLLM server for weights/4b with the served model name code-as-world-4b using the flags in the README's OpenAI-compatible serving section. Then send one chat request containing <video_or_frames> and return the model's text reply. Verify that the server lists code-as-world-4b as an available model before sending the request.
Caveat. The README gives the serve command for a CUDA host and a specific chat template, so the server will not run as documented on other setups.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for MirroS-Lab/Code-as-World and "Serve a Code as World model behind an OpenAI-style API"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer