DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to serve a Code as World model behind an OpenAI-style API with Code as World

Expose the 4B or 9B checkpoint through vLLM so other tools can send video requests to it.

Short answer: Clone the repo with git clone https://github.com/MirroS-Lab/Code-as-World.git, run cd Code-as-World, create a environment with python -m venv .venv, activate it with source .venv/bin/activate, and run pip install -r requirements/inference.txt; then download the checkpoint with hf download MirroS-Lab/Code-as-World-VL-4B --local-dir weights/4b. All steps.

  • Research
  • Advanced
  • 1 hour
  • From the README
  • Any agent

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

  1. Clone the repo with git clone https://github.com/MirroS-Lab/Code-as-World.git, run cd Code-as-World, create a environment with python -m venv .venv, activate it with source .venv/bin/activate, and run pip install -r requirements/inference.txt.
  2. Download the checkpoint with hf download MirroS-Lab/Code-as-World-VL-4B --local-dir weights/4b.
  3. 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)
  4. For the 9B checkpoint, swap weights/4b and code-as-world-4b for weights/9b and code-as-world-9b, and download it with hf 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer