Youtu-Parsing-Omni — MLX (bf16)
This is an unofficial MLX conversion of tencent/Youtu-Parsing-Omni for Apple silicon, in bf16 (no quantization). It is not made or endorsed by Tencent. See the original model card for the model's capabilities, benchmarks and intended use.
License / territory: the weights are distributed under Tencent's Youtu-Parsing license, which states that Youtu-Parsing is not intended for use within the European Union. By using these files you agree to that license.
Requirements
youtu_vita support is not in a released mlx-vlm yet (upstream PR pending).
Install the branch from the fork (macOS on Apple silicon, Python ≥ 3.10):
pip install "mlx-vlm @ git+https://github.com/cguldogan/mlx-vlm@youtu-vita-v1"
pip install av # only needed for video input
Usage
Use Tencent's task prompts verbatim (they are included here as
prompts/youtu_parsing_omni.json; whitespace matters — e.g. the
document prompt ends with a newline). Decode greedily (temperature 0) and keep special tokens: bounding
boxes are emitted as special tokens such as <x_68>.
Bounding boxes use a 0–1000 grid over the processor's canvas, which is the input image padded
right/bottom to a multiple of 32 px (after any min/max-pixel resize). To get pixels in the original
image, use x_px = x / 1000 * ceil32(W) and y_px = y / 1000 * ceil32(H). Scaling by the original
W/H instead shifts the boxes slightly, e.g. by 2.4% on an 800×1000 page.
import json
from huggingface_hub import hf_hub_download
from mlx_vlm import load
from mlx_vlm.generate import stream_generate
from mlx_vlm.prompt_utils import apply_chat_template
repo = "cguldogan/Youtu-Parsing-Omni-mlx-bf16"
model, processor = load(repo)
prompts = json.load(open(hf_hub_download(repo, "prompts/youtu_parsing_omni.json")))["prompts"]
def run(prompt, **media):
text = ""
for r in stream_generate(model, processor, prompt, max_tokens=32768, temperature=0.0, **media):
text += r.text
return text
# Document / image parsing (other image tasks: graphics_chart, graphics_flowchart, graphics_geometric, natural_image)
p = apply_chat_template(processor, model.config, prompts["document"], num_images=1)
print(run(p, image=["page.png"]))
# Audio parsing (wav / mp3)
p = apply_chat_template(processor, model.config, prompts["audio"], num_audios=1)
print(run(p, audio=["speech.wav"]))
# Video parsing (needs `av`; tasks: natural_video, textrich_video)
p = apply_chat_template(processor, model.config, prompts["natural_video"], video="clip.mp4")
print(run(p, video=["clip.mp4"]))
OpenAI-compatible server
python -m mlx_vlm.server --model cguldogan/Youtu-Parsing-Omni-mlx-bf16 --host 127.0.0.1 --port 8080 --max-tokens 32768
Send "model": "cguldogan/Youtu-Parsing-Omni-mlx-bf16", "temperature": 0, and the media as image_url (data URI or URL),
input_audio (base64 wav/mp3) or video_url (local file path only; base64 video is not supported).
The server trims leading/trailing whitespace from the output.
Web UI
youtu-parsing-omni-mlx-ui is a small local web UI for this server: drop in an image, audio clip or video, pick a task, and see the parse rendered with bounding-box overlays or clickable time segments.
Variants
| Variant | Size | Decode (M4 Pro, measured) | Peak memory | Quality vs bf16 |
|---|---|---|---|---|
| 8bit | 5.7 GB | ~40 tok/s | ~9 GB | Near-identical to bf16: on the test pages every element's category and content matched; bounding boxes shift by ~1 unit (0-1000 scale), rarely more. Recommended. |
| 4bit | 3.5 GB | ~64 tok/s | ~6.6 GB | Fastest/smallest. Bounding boxes drift by up to ~6 units; on one test page a formula element was labelled as plain text. |
| bf16 | 9.9 GB | ~24 tok/s | ~13.6 GB | Unquantized reference (bf16 language model, fp32 encoder at load). |
The omni encoder always runs in float32 (its activations reach ~4e5 and overflow fp16); only the language model is bf16/quantized. Quantized variants quantize only the language model; the omni encoder and its vision/audio projectors are kept unquantized.
Validation
The MLX implementation was checked against Tencent's PyTorch code (fp32, CPU): with everything in fp32, the first 256 generated tokens are identical for a document image, an audio clip and videos with and without audio. In the default precision (bf16 LM + fp32 encoder) image and 11 s video still match 256/256; audio and a 4 s video diverge late (tokens 122 / 214) at near-tied logits.
Known limitations
- Video is always sampled at 1 fps, at most 128 frames (Tencent's settings); mlx-vlm's
--fps/--video-max-framesCLI flags are ignored. - Concurrent server requests are batched; results stay valid but can differ slightly from single requests (Tencent serves one request at a time).
- Prompts mixing image and audio were not validated against the reference.
- Long or silent 640×480 videos are slow to encode (~2 min before the first token for 65 s of video).
Changes from the original files
Per the license, modified files are noted here:
- weights converted to MLX layout (bf16, no quantization);
config.json,processor_config.json,tokenizer_config.json: removed the transformersauto_map/trust_remote_codeentries, since Tencent's*.pyremote code is not shipped (mlx-vlm has its own implementation);generation_config.json: greedy by default (do_sample: false,temperature: 0), matching Tencent's recommended serving settings; the original sampled (temperature 1.0, top_k 20, top_p 0.95);prompts/youtu_parsing_omni.json: Tencent's task prompts, unchanged;- this README replaces the original model card.
Original model: Copyright (C) 2026 Tencent. All rights reserved. Licensed under the Youtu-Parsing license (see LICENSE).