Views
No views yet
qwen3_5
vision-language model for structured extraction (PDF / image → schema-constrained JSON).| Repo | Method | ≈bpw | Size | Peak RAM* | Gen* |
|---|---|---|---|---|---|
| lift-bf16 | full bf16 | 16 | 18 GB | 19.9 GB | 31 t/s |
| lift-oQ8 | oQ | ≈8.6 | 9.7 GB | 12.3 GB | 58 t/s |
| lift-oQ6 (this repo) | oQ | ≈6 | 7.7 GB | 9.4 GB | 73 t/s |
| lift-oQ5 | oQ | ≈5 | 6.7 GB | 8.4 GB | 83 t/s |
| lift-oQ4 | oQ | ≈4.6 | 5.6 GB | 7.2 GB | 100 t/s |
| lift-oQ3.5 | oQ | ≈4.0 | 4.9 GB | 6.5 GB | 109 t/s |
| lift-oQ3 | oQ | ≈3.5 | 4.6 GB | 6.2 GB | 119 t/s |
1uvx --from mlx-vlm mlx_vlm.generate \
2 --model mlx-community/lift-oQ6 \
3 --image invoice.png \
4 --prompt "Extract the invoice as JSON." \
5 --max-tokens 800mlx_vlm.server enforces a JSON Schema at decode
time (via llguidance), so output is guaranteed valid and well-typed.uvx --from mlx-vlm mlx_vlm.server --model mlx-community/lift-oQ6 --port 80801import base64, json
2from openai import OpenAI
3
4client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="local")
5img = base64.b64encode(open("invoice.png", "rb").read()).decode()
6
7schema = {
8 "type": "object",
9 "properties": {
10 "invoice_number": {"type": "string"},
11 "total": {"type": "number"},
12 "line_items": {"type": "array", "items": {"type": "object", "properties": {
13 "description": {"type": "string"}, "amount": {"type": "number"}}}},
14 },
15 "required": ["invoice_number", "total"],
16}
17
18resp = client.chat.completions.create(
19 model="mlx-community/lift-oQ6", # the server lists your whole HF cache — name the model explicitly
20 messages=[{"role": "user", "content": [
21 {"type": "text", "text": "Extract this invoice."},
22 {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}},
23 ]}],
24 response_format={"type": "json_schema", "json_schema": {"name": "invoice", "schema": schema}},
25 temperature=0.0, max_tokens=800,
26)
27print(json.loads(resp.choices[0].message.content))generation_config.json here sets eos_token_id: [248044, 248046]. Upstream
only sets 248044, but the chat turn closes with <|im_end|> = 248046; without this, MLX servers
reading generation_config never stop and flood <|im_end|>. If you re-convert from the source, reapply this.lift (9B) scores 90.2% field / 20.9% full-document on Datalab's 225-doc
benchmark. Every variant in this set extracted a simple test invoice correctly — that only rules out
collapse, it does not rank them. Lower bit-widths may degrade on harder/adversarial documents; these
were not re-benchmarked at scale.