How to Run Baidu Unlimited-SVG Locally (vLLM, SGLang & VRAM Guide)

Because baidu/Unlimited-SVG is open-sourced under the MIT License, anyone can self-host an OpenAI-compatible image-to-SVG endpoint. Here are the real hardware specs, common MoE memory pitfalls, and exact vLLM and SGLang serving commands.

Hardware & VRAM Requirements (Avoid the 0.5B MoE Trap)

A common misconception when deploying Unlimited-SVG is assuming that "0.5B active parameters" means the model fits in 1–2 GB of RAM. Unlimited-SVG is a Mixture-of-Experts (MoE) architecture: only ~0.5B parameters compute per token, but all ~3.3B total parameters must reside in GPU memory.

  • Checkpoint size on disk: ~6.67 GB (BF16 safetensors).
  • KV cache overhead: Complex diagrams routinely generate 10,000+ output tokens alongside 1,024 vision tokens, requiring substantial VRAM headroom.
  • Recommended GPU: An x86-64 Linux machine with a BF16-capable NVIDIA GPU carrying 16GB to 24GB VRAM (such as NVIDIA L4, A10G, RTX 3090, or RTX 4090).
  • Why cheap CPU VPS servers fail: A standard 2-core 4GB RAM server cannot even load the 6.67 GB checkpoint (instant OOM), and CPU decoding over 10,000 tokens takes tens of minutes per image.

Option 1: Serve an OpenAI-Compatible API with vLLM

The fastest path to turn Unlimited-SVG into a production API is vLLM. On a Linux GPU host with CUDA and vLLM installed:

vllm serve "baidu/Unlimited-SVG" \
  --dtype bfloat16 \
  --trust-remote-code \
  --port 8000

Once running, you can send base64-encoded images padded to 2048 × 2048 with the minimal prompt prefix (such as <image> SVG:) to http://localhost:8000/v1/chat/completions.

Option 2: Launch with SGLang

If your inference stack already uses SGLang for structured or long-horizon decoding, launch the server with:

python3 -m sglang.launch_server \
  --model-path "baidu/Unlimited-SVG" \
  --trust-remote-code \
  --host 0.0.0.0 \
  --port 30000

Option 3: Serverless GPU Hosting (Scale-to-Zero)

Renting a dedicated 24/7 cloud GPU costs roughly $500–$800 per month. If you have bursty workloads or are building a side project, consider packaging the vLLM container on a per-second serverless GPU provider:

  • Modal: Python-native deployment with NVIDIA L4 (~$0.80/hr billed per second) and short idle scaledown windows (30–60 seconds).
  • RunPod Serverless: Cost-effective custom Docker workers for batch or API traffic.
  • Hugging Face Inference Endpoints: One-click UI deployment from baidu/Unlimited-SVG (note the 15-minute minimum idle timeout before scaling to zero).

Recommended Decoding Parameters

  • CAD drawings, charts, UI mockups, and text-heavy graphics: Use greedy decoding (temperature = 0 or do_sample = False) so coordinates and straight lines remain exact.
  • Artistic illustrations and organic shapes: Set temperature = 0.2 to 0.4 for smoother curve generalization.

Need a Quick Test Without Setting Up a GPU?

If you just want to evaluate output quality first, use Baidu's official Hugging Face Space or check our comparison against Vectorizer.AI and Recraft and our PNG to SVG workflow guide.