Key takeaways

  • Unlimited SVG converts 2048x2048 images into structured, editable SVG code and runs locally on a single BF16 NVIDIA GPU.
  • MoE decoding activates about 0.5B parameters per token, sustaining generation past 10,000 output tokens, while total BF16 weights are about 3.3B (6.7 GB on disk).
  • Use temperature 0 to 0.3 for CAD, diagrams and charts; 0.5 to 0.8 for photos.
  • Treat output as untrusted XML: validate, sanitize and render in a sandbox before use.
  • The model infers hidden geometry behind occlusions, so measurements and labels need independent verification.

Baidu's ERNIE multimodal team has released Unlimited SVG, an open-source model that converts raster images into structured SVG code. The output is real vector markup with shapes, paths, colors, text, coordinates and drawing order, all editable in standard vector tools, rather than a traced bitmap. The release targets exactly the inputs makers struggle with, including CAD drawings, blueprints, floor plans, charts and scanned documents.

The interesting part for hardware work is deployment. The model uses a mixture-of-experts design that activates about 0.5 billion parameters per token, so it sustains real-time generation well past 10,000 output tokens. That long-sequence regime is where dense autoregressive models slow down badly, and complex drawings routinely need more than 10,000 tokens because every path, attribute and text element eats part of the sequence. The weights are on Hugging Face under an MIT license, at about 3.3B BF16 parameters sharded into roughly 6.7 GB.

Why SVG instead of captions or autotrace

The project's core argument is that language descriptions of an image are unverifiable. A caption names objects and broad relationships but discards the geometry. SVG, by contrast, encodes object boundaries, dimensions, colors, text and spatial relationships in a machine-readable format that renders directly into an image.

That gives you a practical evaluation loop. You can render the generated SVG, compare it against the source image, inspect individual element coordinates, and edit specific paths or text nodes. This is what separates it from autotrace tools, which produce flat curves with no notion of layers, text or drawing order.

The model also separates content into editable elements and preserves drawing order through the sequence of SVG nodes, so foreground and background come out as distinct groups rather than one tangled outline. The release materials describe occlusion-aware reconstruction, where the model infers complete shapes hidden behind other objects. That produces cleaner geometry, but it is inferred content that may not match the source, which matters for drawings where dimensions are the point.

How the two bottlenecks are handled

Complex images blow up both sides of the generation. The input image becomes a long visual prefix, and the SVG output becomes a long token sequence. Unlimited SVG, built on DeepSeek-OCR, attacks each side differently.

On input, the DeepEncoder compresses a full 2048 x 2048 image into just 1024 vision tokens while reportedly preserving small text, thin strokes and exact spatial coordinates. That shrinks the prefix the decoder has to attend to before writing a single path.

On output, the mixture-of-experts architecture routes each token through a subset of the network, activating about 0.5 billion parameters per token. Sparse decoding is what keeps long generations cheap. The 0.5B figure describes compute per token; deployment memory depends on total weights, runtime, precision and cache. The documented configuration runs on x86-64 Linux with a compatible NVIDIA driver and a free BF16-capable GPU, and the repository should be checked for current memory and software requirements before you commit hardware.

Setting up the Transformers path

The repository ships two inference paths. Use the Transformers script for local tests, batch jobs and pipeline integration.

Install with uv on Python 3.12, pinning the documented versions, including torch==2.6.0, torchvision==0.21.0, transformers==4.46.3, safetensors==0.8.0, pillow==13.0.0 and huggingface_hub==0.36.0. Load the model with trust_remote_code=True, torch_dtype=torch.bfloat16 and attn_implementation="eager", then run on a single GPU.

Image prep is handled for you in the example: ImageOps.pad resizes the long edge to 2048 pixels preserving aspect ratio, centers the image on a gray 2048 x 2048 canvas without tiling, and composites transparent pixels onto white so alpha images do not turn black. A minimal call looks like:

raw = model.infer( tokenizer, prompt="<image> SVG:", image_file="input.png", base_size=2048, image_size=2048, crop_mode=False, eval_mode=True, )

The example script extracts the <svg>...</svg> block, parses it with ElementTree.fromstring and writes validated XML to disk. Its default cap of 30,000 new tokens accommodates large outputs, with corresponding effects on latency and memory use.

Setting up the vLLM path

For long-running services and repeated requests, the repository provides an infer_vllm.py client against a vLLM server, with vllm==0.33.0, torch==2.14.0 and openai==3.60.0.

One setup step is unusual: you patch the installed vLLM DeepSeek-OCR processor file to set BASE_SIZE=2048, IMAGE_SIZE=2048 and CROP_MODE=False, so the server matches the documented global-image configuration without tiling. The server then starts with flags worth copying exactly: --max-model-len 32768, --max-num-seqs 1, --limit-mm-per-prompt with one image, --no-enable-prefix-caching, --mm-processor-cache-gb 0, --gpu-memory-utilization 0.8, and a compilation config with cudagraph_mode "FULL_DECODE_ONLY" and capture sizes 1, 2, 4 and 8.

The client streams the completion to a text file, applies the same regex extraction and XML parse, and writes output-vllm.svg. It uses an OpenAI-compatible endpoint on 127.0.0.1:10000 with temperature 0, top_p 1, max_tokens 30000, top_k 0 and repetition_penalty 1.

There is also a hosted demo: the repo notes that as of the 2026-12-01 release, a demo is available on Hugging Face Spaces, and the model is also on ModelScope.

Picking the right temperature

Both example paths default to greedy decoding for deterministic output: do_sample=False in Transformers, temperature=0 in vLLM. The project recommends tuning by image type.

  • CAD, diagrams, charts and other images needing exact detail consistency: keep temperature low, 0 to 0.3, to preserve precise geometry, labels and repeated structure.
  • Natural scenes and photographs: raise it to 0.5 to 0.8 to avoid repetitive loops and encourage varied strokes.

To sample in Transformers, pass do_sample=True plus a temperature instead of the greedy override. With vLLM, set temperature in the request.

For hardware drawings the guidance is clear: stay near zero. Sampling variation is fine when you are re-illustrating a photo, but not when a dimension line or repeated hole pattern has to come out identical every run.

Guardrails for production pipelines

Generated SVGs can contain malformed paths, incorrect text, misplaced elements or unnecessary complexity. XML validation only confirms the document parses; visual fidelity requires rendering and comparing against the input. Treat the output as untrusted structured data and wrap the model in checks:

  • Prepare the input: rasterize PDF pages and other unsupported formats at a resolution that preserves small labels and thin lines before feeding them in.
  • Validate the XML: reject truncated output, malformed elements, invalid attributes and documents without a usable viewBox.
  • Sanitize the SVG: remove scripts, event handlers, external references and unsupported embedded content before displaying or distributing the file.
  • Render in isolation: use a sandboxed renderer with limits on file size, path count, dimensions and processing time.
  • Compare with the source: render the SVG to a bitmap and measure visual similarity, text accuracy and geometry-specific checks relevant to your application.
  • Preserve review paths: route low-confidence results and technical drawings to human inspection before publication or operational use.

The occlusion point deserves emphasis for CAD use. Because the model infers shapes hidden behind other objects, measurements, labels and safety-critical diagrams require independent verification against the source, not just a visual similarity score.

Where it saves real work

The release fits workflows that currently rely on manual tracing or brittle autotrace tools:

  • Converting scanned floor plans and blueprints into editable vector files.
  • Recovering CAD-style line art from flattened images.
  • Extracting reusable graphics from rasterized documents.
  • Reconstructing icons, diagrams and charts from image-only sources.
  • Creating structured scene representations for editing, search or measurement.

The MIT license plus the local inference path also makes it a fit for document-processing systems that must keep source images inside an organization's infrastructure, since inference runs locally without per-image fees or external API calls.

One caution on the supply chain: the model uses custom code loaded via trust_remote_code=True, and the transformers config references a custom class, modeling_unlimitedsvg.UnlimitedSVGForCausalLM. Review that code before putting it in a production pipeline.

Beyond conversion: SVG as a training signal

Baidu proposes SVG generation as a pretraining task for broader vision-language models. Producing renderable code forces a model to account for detailed geometry, object relationships, text, color and occlusion order, and every prediction can be checked by rendering it and comparing with the original. The project page frames this as a way for general VLMs to learn complete scene geometry that text annotations cannot provide.

The team also describes potential robotics applications, since the output encodes coordinates, part relationships and occlusion. An agent could sketch a scene as structured SVG before planning an action. That use remains speculative and would need calibrated uncertainty, physical-scale estimation and task-specific safety checks beyond visual reconstruction.

For now, the concrete contribution is a compact, locally deployable image-to-vector model with editable output and a permissive license. Its practical value in a hardware pipeline will come down to reconstruction quality on your real documents, generation latency, and the strength of the validation you build around it.

Questions readers ask

Can I use Unlimited SVG for real CAD files?

It targets CAD drawings, blueprints and floor plans, and its output separates content into editable SVG elements. But it can produce malformed paths, wrong text and inferred geometry behind occlusions, so anything measurement-critical needs manual verification.

What hardware do I need?

The docs say x86-64 Linux with a compatible NVIDIA driver and a free BF16-capable GPU. The weights are about 3.3B BF16 parameters, roughly 6.7 GB sharded, so the 0.5B activated figure is compute per token, not memory.

Is it free to use commercially?

The model is released under the MIT license through GitHub, Hugging Face and ModelScope. Note it uses custom code loaded with trust_remote_code=True, so review that code before deployment.

Transformers or vLLM?

The Transformers script suits local tests, batch jobs and pipeline integration. The vLLM server suits long-running services with repeated requests. Both use 2048 x 2048 global-image inference in the documented configuration.

The AI Hardware Prototyping Stack is a free checklist of tools and prompts.

Circuit Owl Lab wrote this with AI from public sources, and a separate review pass checked its claims against them. Nothing here comes from first-hand testing.