Unlimited-SVG: 0.5B Active MoE Multimodal Vector Graphics Pipeline

Baidu Unlimited-SVG (baidu/Unlimited-SVG) is an MIT-licensed multimodal Mixture-of-Experts model built on DeepSeek-OCR that compresses 2048x2048 images into 1,024 vision tokens and activates ~0.5B parameters per token (top-6 of 64 routed experts) to stream editable 10,000+ token SVGs across a 32,768-token context window.
Unlimited-SVG: 0.5B Active MoE Multimodal Vector Graphics Pipeline: Baidu Unlimited-SVG (baidu/Unlimited-SVG) is an MIT-licensed multimodal Mixture-of-Experts model built on DeepSeek-OCR that compresses 2048x2048 images into 1,024 vision tokens and activates ~0.5B parameters per token (top-6 of 64 routed experts) to stream editable 10,000+ token SVGs across a 32,768-token context window. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 1,024-Token Visual Prefix: DeepEncoder pads any 2048x2048 input without tiling into 1,024 vision tokens while retaining thin strokes and small text.
- 0.5B Active Compute: DeepSeekV2 MoE activates top-6 of 64 routed experts (896 intermediate dim) plus 2 shared experts per generated SVG token.
- Long-Horizon 32K Context: Supports max_position_embeddings=32,768 and max_new_tokens=30,000 for dense CAD diagrams, UI mocks, and illustrations.
- MIT Open Weights & vLLM Ready: Runs locally on a single BF16 GPU with deterministic greedy decoding (temperature=0) or stochastic stroke sampling.
import { createAgent } from '@smoke-monkey/harness';const svgVectorAgent = createAgent({agentId: 'unlimited-svg-vector-compiler',provider: 'openai-compatible',model: 'Unlimited-SVG',baseUrl: 'http://127.0.0.1:10000/v1',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},mcpServers: {svgValidator: {command: 'npx',args: ['-y', '@modelcontextprotocol/server-filesystem', process.cwd()],},},});async function vectorizeDiagram(rasterPath: string) {const result = await svgVectorAgent.run(`Pad ${rasterPath} onto a 2048x2048 gray (127,127,127) canvas after alpha white-compositing, call Unlimited-SVG at temperature=0.0, validate XML well-formedness via ElementTree, and save output.svg.`);console.log('Vectorized SVG artifact:', result.summary);}vectorizeDiagram('./assets/architecture-sketch.png').catch(console.error);
Watch: Related Video Guides
VecGlypher: SVG Vector Font Generation with LLMs
LLM for SVG? Quiver Generates Vector Graphics from Prompts (20 Free SVGs)
What Is Baidu Unlimited-SVG? Architecture & Active Parameter Budget
Unlimited-SVG (baidu/Unlimited-SVG) is an MIT-licensed vision-language Mixture-of-Experts model built on DeepSeek-OCR that converts raster images into editable SVG markup. By pairing a DeepEncoder frontend that compresses 2048x2048 images into 1,024 tokens with a 0.5B-active MoE decoder, it sustains 10,000+ token vector generation without dense-model latency.
From the verified config.json (UnlimitedSVGForCausalLM), the language backbone uses a 12-layer DeepseekV2ForCausalLM configuration with hidden size 1,280, 10 attention heads, 129,280 vocabulary tokens, and max_position_embeddings=32768. Layer 0 stays dense (first_k_dense_replace=1, intermediate size 6,848), while layers 1–11 route each token across 64 routed experts (moe_intermediate_size=896, num_experts_per_tok=6, greedy top-k) plus 2 shared experts.
| Subsystem | Verified config.json Specification | Engineering Effect |
|---|---|---|
| Vision Backbone | deeplip_b_l (clip-l-14-224 24L + sam_vit_b 1024px) | Preserves thin CAD lines and small labels |
| Visual Token Prefix | 2048x2048 padded canvas -> 1,024 vision tokens | Eliminates multi-tile prefix bloat before decode |
| MLP Projector | Linear projection (2048 -> 1280 hidden dim) | Aligns spatial patch embeddings to MoE decoder |
| MoE Language Decoder | 12L, 10 heads, 64 routed (top-6) + 2 shared experts | ~0.5B active params/token (~3.34B total BF16) |
| Context & Output Budget | 32,768 max positions (max_new_tokens=30000) | Completes complex multi-layer <path> trees |
2048x2048 Global Padding & Domain Temperature Regimes
Unlike OCR models that split high-resolution inputs into overlapping tiles, Unlimited-SVG enforces CROP_MODE=False with a single global 2048x2048 pass. Both the Hugging Face Transformers reference script and the vLLM client must composite transparent PNG alpha channels onto pure white (255, 255, 255), EXIF-transpose the bitmap, and bicubic-pad the longest edge to 2048 pixels on a neutral (127, 127, 127) canvas.
| Input Workload | Recommended temperature | Decoding Strategy | Behavioral Outcome |
|---|---|---|---|
| CAD, Schematics & Charts | 0.0 (greedy) to 0.3 | do_sample=False, repetition_penalty=1 | Preserves exact coordinates, axis ticks, and label alignment |
| UI Mockups & Vector Logos | 0.0 to 0.2 | Greedy default with XML validation | Avoids jittery Bezier control points on straight edges |
| Natural Photos & Paintings | 0.5 to 0.8 | Stochastic sampling | Breaks repetitive <path> fill loops and diversifies strokes |
Skipping alpha flattening turns transparent icon backgrounds pitch black before encoding, corrupting foreground-background contrast inside DeepEncoder.
Patch vLLM DeepSeek-OCR Processor Before Serving
Before launching `vllm serve baidu/Unlimited-SVG`, update `vllm/transformers_utils/processors/deepseek_ocr.py` so `BASE_SIZE = 2048`, `IMAGE_SIZE = 2048`, and `CROP_MODE = False`, and pass `--no-enable-prefix-caching --mm-processor-cache-gb 0`.
Reproducible vLLM Serving & Transformers Quickstart Commands
On x86-64 Linux with a BF16-capable NVIDIA GPU, install the pinned vllm==0.33.0 and torch==2.14.0 environment with uv, patch the image processor dimensions, and expose an OpenAI-compatible server on port 10000.
# 1. Create isolated vLLM environment and patch DeepEncoder resolution
uv venv .venv-svg-vllm --python 3.12
uv pip install --python .venv-svg-vllm/bin/python \
vllm==0.33.0 torch==2.14.0 nvidia-cudnn-cu13==9.24.0.43 \
openai==3.60.0 pillow==13.0.0
.venv-svg-vllm/bin/python - <<'PY'
import re, sysconfig
from pathlib import Path
p = Path(sysconfig.get_path("purelib")) / "vllm/transformers_utils/processors/deepseek_ocr.py"
src = p.read_text()
for k, v in {"BASE_SIZE": 2048, "IMAGE_SIZE": 2048, "CROP_MODE": False}.items():
src, n = re.subn(rf"^{k} = .+$", f"{k} = {v}", src, flags=re.M)
assert n == 1, f"Failed patching {k}"
p.write_text(src)
PY
# 2. Launch vLLM with FULL_DECODE_ONLY CUDA graphs
CUDA_VISIBLE_DEVICES=0 VLLM_USE_V2_MODEL_RUNNER=0 TRITON_ALLOW_NON_CONSTEXPR_GLOBALS=1 \
.venv-svg-vllm/bin/vllm serve baidu/Unlimited-SVG \
--served-model-name Unlimited-SVG --trust-remote-code \
--no-enable-prefix-caching --mm-processor-cache-gb 0 \
--limit-mm-per-prompt '{"image":1}' --max-model-len 32768 --max-num-seqs 1 \
--gpu-memory-utilization 0.8 \
--compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY","cudagraph_capture_sizes":[1,2,4,8]}' \
--host 127.0.0.1 --port 10000Building Autonomous Design-to-Code Loops in Smoke Monkey
Inside Smoke Monkey Harness, Unlimited-SVG acts as a dedicated local vector-compiler subagent. A frontend agent captures screenshots via Playwright or reads UI assets, routes raster diagrams to the local port 10000 OpenAI-compatible endpoint, verifies valid <svg> XML parsing, and injects clean inline Bezier components into React or Next.js workspaces without paying frontier API token rates for 15,000-token SVG streams.
Frequently Asked Questions
Q:How many parameters does Baidu Unlimited-SVG activate during generation?
While total BF16 weights are ~3.34B, Unlimited-SVG uses a DeepSeekV2 Mixture-of-Experts decoder with 64 routed experts and 2 shared experts, activating top-6 routed experts (~0.5B active parameters per token) for fast long-horizon SVG decoding.
Q:Why does Unlimited-SVG require a 2048x2048 gray canvas instead of image tiling?
DeepEncoder compresses the entire 2048x2048 padded frame into 1,024 vision tokens in a single global pass (`CROP_MODE=False`), preserving continuous coordinates across thin strokes and typography without seam artifacts.
Q:Which temperature setting should I use for technical diagrams versus photos?
Use greedy decoding (`temperature=0.0` to `0.3`) for CAD drawings, UI wireframes, charts, and diagrams where exact coordinate fidelity matters. Increase `temperature` to `0.5`–`0.8` for natural photographs to prevent repetitive path loops.
Q:What license and context length does baidu/Unlimited-SVG use?
Unlimited-SVG is released under the permissive MIT license with a 32,768-token context window (`max_position_embeddings=32768`) and a default generation cap of 30,000 new tokens.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.