Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Reader activity
0 Useful 4 Views 5 min Read — No ratings
Artificial Intelligence
5 min read

Baidu Unlimited-SVG: 0.5B Active Params, Editable SVG Generation — Mac Local Run via MLX

Baidu's open-source Unlimited-SVG model uses 0.5B active parameters from a 3.34B MoE architecture to convert images into layered, editable SVG code up to 10K tokens; while officially Linux+NVIDIA only, a community MLX port achieves 78 tokens/sec on 16GB M5 Macs, enabling local runs with temperature tuning for different image types.

Model Specifications and Memory Footprint

Baidu released Unlimited-SVG on December 1 under MIT license. The model has 3.34B total parameters with 704 routed experts comprising 72.6% of weights . It uses a Mixture-of-Experts (MoE) architecture where each token activates only ~0.5B parameters (6 experts), but all 704 experts must reside in memory simultaneously — sparse activation saves compute, not memory. The BF16 weight file is 6.67 GB . KV cache is estimated at ~60 KiB per token (10 attention heads × 128 dimensions), so a maximum 30K-token generation plus 1024-token prefix requires ~1.78 GiB KV cache. Total memory footprint is roughly 8 GB , fitting within a 16 GB unified-memory Mac.

Architecture: From Pixels to Structured SVG

Unlimited-SVG builds on the DeepSeek-OCR architecture. The encoder ( DeepEncoder ) compresses a 2048×2048 input image into 1024 visual tokens while preserving small text, fine lines, and coordinates. The decoder uses MoE for sparse activation. This two-sided efficiency — cheap input encoding, sparse output decoding — enables streaming generation of >10K-token SVG code.

The output is a semantic, layered redraw : third-party inspection of official samples shows 164 paths organized into 17 named groups (e.g., tree, house, lake as separate groups), with text retained as editable text elements rather than outlines. This allows selecting and recoloring a group like "house" individually. However, it is a redraw, not pixel-perfect replication : city skylines become editable illustrations, photos turn into vector paintings with repeated brush strokes, and occluded digits in tables (e.g., "158") may be misread as "135". Human verification remains necessary for precision tasks.

Official Support: Linux + NVIDIA Only

The official README explicitly supports only x86-64 Linux + NVIDIA BF16 GPUs + Python 3.12 . Both provided examples (Transformers and vLLM) hardcode

.cuda()</strong> calls. There is <strong>no official Mac build, no GGUF quantization, no Ollama integration, and no CPU-only support</strong>. Mac users following the official path must acquire a Linux machine with an NVIDIA card.</p><h2>Community MLX Port: Apple Silicon Support</h2><p>On December 2, the community released <strong>unlimited-svg-mlx</strong>, porting the original BF16 weights to Apple MLX + Metal. Reported benchmarks (community self-tests, not officially verified):</p><ul><li><strong>16 GB Apple M5</strong>, strawberry-hamster sample: <strong>3431 tokens at 78.04 tok/s</strong>, total 66.8 seconds including image processing. Greedy decoding missed pink blush; sampling (temperature 0.25) preserved it.</li><li>Shortlist optimization (Q4 index shortlist + BF16 rescoring): small badge 78.04 → <strong>101.58 tok/s</strong> (521 tokens), small icon 74.95 → <strong>105.19 tok/s</strong> (154 tokens) — note these are different images, not strict before/after on the same image.</li><li>Quantized variants: <strong>3.19 GB router-only quantized</strong> (rest BF16) at <strong>48.6 tok/s</strong>; <strong>4-bit quantized</strong> at <strong>72.3 tok/s</strong> — 4-bit quality varies.</li><li>Usage: download, unzip, double-click <code>Run.command

→ keep terminal open → browser to 127.0.0.1:7861 to upload images; also supports CLI: bash Run.command input.png output.svg. First run installs Python environment and downloads 6.67 GB weights; reserve 16 GB disk space. Temperature is the biggest pitfall on this port. Official guidance: CAD/charts/line art use 0–0.3, photos use 0.5–0.8. Community testing found temperature 0 causes some images to repeat the same digit sequence until the 30K token limit (~3 minutes wait). If truncation occurs, increase temperature first rather than raising max_tokens .

Mac Studio 256 GB: Overkill, Bottleneck Is Patience

For a Mac Studio 256 GB, running Unlimited-SVG is "using a sledgehammer to crack a nut." Model weights (6.21 GiB) + peak KV cache (~1.78 GiB) ≈ 8 GB — a 16 GB Mac suffices. The 256 GB unified memory does not accelerate this workload because it is an autoregressive language model generating SVG token-by-token with only 0.5B active parameters per step, not a diffusion model requiring hundreds of GB of latent intermediates. Extrapolating from the M5's 78 tok/s, a complex 18K-token photo would take ~3.8 minutes (estimate; M5 Ultra bandwidth may improve this). The same image on a 24 GB NVIDIA card reportedly takes 83 seconds. Local Mac execution makes sense for data sovereignty and zero API cost , not speed.

Practical Decision Guide

1. Just want to test: Use the Hugging Face Space demo ( akhaliq/Unlimited-SVG-ZeroGPU ) — zero deployment. Do not upload sensitive images. 2. Want long-term local use: Adopt the community MLX port; do not wait for official Mac support (no timeline). 16 GB RAM is enough, but ensure 6.67 GB weights + 16 GB install space. For photos, set temperature to 0.5. 3. Need production integration or batch processing: Weights are MIT-licensed, no commercial restriction. However, official maintenance targets Linux+NVIDIA only; Mac deployment means self-supporting compatibility. For stable throughput, reference third-party hosted solutions: 24 GB NVIDIA card running 8 concurrent streams achieves ~65 charts/minute — no comparable Mac concurrency data exists yet.

Closing Summary

0.5B governs compute per token, 3.34B governs memory footprint, 10K tokens governs generation latency — three distinct numbers, each ruling a different dimension. Do not assume a 0.5B "small model" runs on a phone. Mac can run it thanks to community MLX port, not official support; 256 GB provides headroom but the scarce resource this time is patience, not memory.

For attribution, corrections or content rights, contactadmin@besthub.dev

Report an issue with this article

Discussion 0

Write a comment

Sign in to join the discussion

No public comments on this page. Sign in to comment