Unlimited-SVG MLX
Convert an image to editable SVG locally on an Apple Silicon Mac. The Python API and CLI run Baidu's Unlimited-SVG vision encoder and mixture-of-experts decoder on the Metal GPU with MLX.
Fastest tested MLX engine on our four-image Apple M5 Pro benchmark in BF16 and Q8. With a warm model and fresh image encoding, the four images took 12.86 s in BF16 and 10.10 s in Q8. The next-fastest implementations took 14.87 s and 10.40 s, respectively. Median decode speed was 192.0 and 278.4 tokens/s. All 32 measured Anionex outputs parsed as SVG. Hardware, comparison engines, image quality and raw timings
Quick start
Use an Apple Silicon Mac and Python 3.11 or later (tested with Python 3.12).
python3 -m pip install https://github.com/Anionex/unlimited-svg-mlx/releases/download/v0.1.0/unlimited_svg_mlx-0.1.0-py3-none-any.whl
unlimited-svg-mlx generate input.png -o output.svg
unlimited-svg-mlx generate input.png -o output-q8.svg --precision q8
The first invocation downloads the selected native MLX checkpoint from Hugging Face. BF16 weights occupy 6.67 GB and Q8 weights occupy 3.56 GB. Download ahead of time with unlimited-svg-mlx fetch --precision q8. For offline inference, add --model-dir /path/to/checkpoint. The loader also accepts the original Baidu checkpoint directory.
| Precision | Hugging Face | ModelScope |
|---|---|---|
| BF16 | anionex/Unlimited-SVG-MLX-BF16 | Anionex/Unlimited-SVG-MLX-BF16 |
| Q8 | anionex/Unlimited-SVG-MLX-Q8 | Anionex/Unlimited-SVG-MLX-Q8 |
For a direct ModelScope download, use --source modelscope on the fetch, generate or batch command, or pass source="modelscope" to the Python constructor. The downloader bypasses proxies in its own process. Both hubs are pinned to published checkpoint revisions.
unlimited-svg-mlx generate input.png -o output.svg --precision q8 --source modelscope
The demo input produces this editable Q8 example with the default greedy settings.
Python
from pathlib import Path
from unlimited_svg_mlx import UnlimitedSVG
model = UnlimitedSVG(precision="q8")
svg = model.generate("input.png", temperature=0)
Path("output.svg").write_text(svg, encoding="utf-8")
Pass a path or a Pillow image. Keep one model instance for sequential requests. Repeated inputs reuse vision embeddings. Greedy decoding is the default. For sampling, set temperature and optionally seed. The default output budget is 30,000 tokens. Completed SVGs are also archived individually under ~/.local/share/unlimited-svg-mlx/generations/ (or $XDG_DATA_HOME/unlimited-svg-mlx/generations/). To choose another directory, pass archive_dir= to the constructor. Press Ctrl-C during generation to save a viewable .partial.svg and its exact raw prefix as .partial.txt. Reaching the token limit with an incomplete SVG also saves both files and raises an error. Python callers can read model.last_saved_path after generation or interruption.
Batch inference
For several inputs, the decoder shares weight reads across active images on the GPU. Finished rows leave the batch, and each result is saved immediately. The command prints each input and its archived SVG path in input order.
unlimited-svg-mlx batch diagrams/*.png --precision q8 --batch-size 4 --output-dir results
In Python, model.generate_batch([image_a, image_b]) returns a list of paths. A truncated item gets a .partial.svg and the generated text. A batch can produce different paths from individual greedy runs due to floating-point reductions.
Precision and coordinates
- BF16 uses the original model weights. Routing scores and the weighted expert reduction use FP32, matching the upstream routing precision.
- Q8 uses 8-bit MLX affine weights (groups of 64) for eligible linear projections, routed experts and the token embedding. Activations, convolutions and positional embeddings retain their floating-point precision. Q8 can change the generated paths.
- Both modes use a single 2048 × 2048 global view. Images are EXIF-oriented, composited onto white, resized to fit and centered on gray. The exported SVG uses the coordinates emitted by the model, which can include the padded area.
Single-image greedy decoding computes a Q4 score estimate and uses per-row weight residual norms to screen vocabulary candidates. Metal then rescores the surviving rows with the selected BF16 or Q8 weights. The Q4 table is an auxiliary index built in memory. Sampling uses the full vocabulary projection. To use the standard MLX projection for greedy decoding, pass --full-head or UnlimitedSVG(screened_head=False).
The runtime reuses MLX-VLM's DeepSeek-OCR components, applies the checkpoint-specific routing and image layout, chunks global SAM attention, and overlaps next-token GPU execution with CPU readback.
Official checkpoint and model license · Baidu reference implementation
Metadata
Release files for unlimited-svg-mlx 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unlimited_svg_mlx-0.1.0.tar.gz | 18.2 kB | With provenance | Details for unlimited_svg_mlx-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unlimited_svg_mlx-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for unlimited_svg_mlx-0.1.0-py3-none-any.whl |
Total release size: 35.0 kB
Release files / unlimited_svg_mlx-0.1.0.tar.gz
| Download URL | unlimited_svg_mlx-0.1.0.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
118fff1b997a3705fbc5c589ac5a8e6d5632516c8b3587ef1f0a5e9e04a68b35
|
|
BLAKE2b-256 checksum How to use checksums |
10328196549f6b8bad36730e15a37462819e0082001e636890a0b471b37626be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / unlimited_svg_mlx-0.1.0-py3-none-any.whl
| Download URL | unlimited_svg_mlx-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bcde70d441d6fcfd1c922e4c59304f86d1c13e6d263e3af3b3810e38043f911
|
|
BLAKE2b-256 checksum How to use checksums |
2ddad81cae2406aa74836caa3c952575766d44fdf5a7074c67a1a863a56336ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for unlimited-svg-mlx 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for unlimited_svg_mlx-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.