File size: 6,410 Bytes
321e43f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
license: apache-2.0
base_model: microsoft/AesCode-8B
tags:
  - mlx
  - mlx-vlm
  - vision
  - multimodal
  - image-text-to-text
  - code-generation
  - html
  - design
  - reinforcement-learning
  - 4-bit
pipeline_tag: image-text-to-text
library_name: mlx-vlm
---

# AesCode-8B — Vision + Code (4-bit, MLX)

4-bit MLX quantization of Microsoft's **AesCode-8B**, with the **vision tower kept intact** so
it reads a design or screenshot and writes the HTML/CSS back on Apple Silicon. **5.256 bits
per weight** (mixed; sensitive layers kept higher), 5.4 GB, two shards, group size 64.

**4-bit is the smallest build, for 8 GB machines; the
[bf16 version](https://huggingface.co/divinetribe/AesCode-8B-MLX-bf16) is the full-quality
one and the [8-bit version](https://huggingface.co/divinetribe/AesCode-8B-MLX-8bit) is the
middle.** This 4-bit build was put through the same pose-reading vision check as the others
before publishing and still read the figure correctly, so the shrink held its sight.

AesCode generates information-rich visual artifacts (slides, posters, dashboards, reports)
as structured, editable, verifiable HTML/CSS. It starts from
[Qwen3-VL-8B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct) and is trained with
cold-start SFT followed by GDPO across seven reward channels, separating semantic
requirements from visual cues through graph-structured supervision and decoupled cross-modal
rewards.

## What it is

- **Base:** [`Qwen/Qwen3-VL-8B-Instruct`](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct) (Qwen team).
- **Source checkpoint:** [`microsoft/AesCode-8B`](https://huggingface.co/microsoft/AesCode-8B) (Apache-2.0).
- **Architecture:** `Qwen3VLForConditionalGeneration` — a `qwen3_vl` vision tower feeding the
  `qwen3_vl_text` decoder. 8.8B parameters.
- **This repo:** 4-bit MLX weights (group size 64, mixed precision), vision kept, for [`mlx-vlm`](https://github.com/Blaizzy/mlx-vlm).
- **Other sizes:** [bf16 (full quality)](https://huggingface.co/divinetribe/AesCode-8B-MLX-bf16) · [8-bit](https://huggingface.co/divinetribe/AesCode-8B-MLX-8bit).

## Running it (MLX)

```python
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template

model, processor = load("divinetribe/AesCode-8B-MLX-4bit")
prompt = apply_chat_template(processor, model.config,
                             "Rebuild this screenshot as a single HTML file.", num_images=1)
print(generate(model, processor, prompt, image=["design.png"], max_tokens=1024))
```

Text-only works with `num_images=0` and no `image=` argument.

## Worked vision example — pose-match QC

A real frame from a motion game (a translucent target avatar drawn over a live camera
scene) was fed to this 4-bit model, asking whether the drawn figure is a correct human pose
and whether any limbs are extra or wrong. The model's unedited on-device answer:

> The translucent figure shows a humanoid pose. Arms are down by the sides, slightly bent at
> the elbows. Legs are straight with knees slightly bent, feet flat. The torso is upright. I
> don't see any extra limbs, crossed knees, or reversed joints. Overall, it resembles a
> neutral standing pose appropriate for a motion game target.

Even at 4-bit it is grounded in the actual pixels: it reads the translucency of the overlay,
the single humanoid figure, the bent knees and flat feet, and it correctly answers the full
QC question — no extra limbs, no crossed knees, no reversed joints — and even frames it as a
motion-game target. Like the bf16 and 8-bit builds it placed the arms low rather than up in a
full guard, so that is a trait of the model, not of the quantization. The same vision path
that reads this frame also reads a design or screenshot and writes **alt-text** and the
**HTML/CSS** back, which is what AesCode is built for.

## Benchmarks

The single most reputable benchmark that genuinely applies is **AesCode's own evaluation**
from the paper (*AesCode: Aesthetic Code Generation with Decoupled Cross-Modal Rewards*,
[arXiv:2610.18860](https://arxiv.org/abs/2610.18860)): 300 infographic prompts scored on a
programmatic `Rule` track (Text, Bound, Chart) and a `Visual` checklist (Content, Layout,
Style), with `Overall` the mean of the two, averaged over three generations with no
selection. AesCode-8B reaches **Overall 82.94** and **Rule 90.07**, improving Visual over its
reference-conditioned Qwen3-VL-8B backbone by **31.1 points**; the paper reports this 8B
result exceeding the reference-conditioned GPT-5.5 (81.28) and Claude Opus 4.8 (80.39) rows
in the same table. 4-bit trades more accuracy for size, so expect the exact scores to move;
all numbers here are quoted from the AesCode paper and model card, not invented.

## Credits

Enormous thanks to the people whose work this conversion simply repackages:

- **The Microsoft AesCode authors** — Xin Gao, Yifan Yang, Xin Li, Pan Wang, Yan Li, Muzhao
  Tian, Mingxi Cheng, Bei Liu, Kai Qiu, Qi Dai, Dong Chen, Yue Dong, Leandros Tassiulas, Rex
  Ying, Ji Li, and Chong Luo — who built and released AesCode-8B under Apache-2.0:
  [model](https://huggingface.co/microsoft/AesCode-8B) ·
  [paper](https://arxiv.org/abs/2610.18860) ·
  [project page](https://microsoft.github.io/AesCode/) ·
  [code](https://github.com/microsoft/AesCode).
- **The Qwen team** at Alibaba — for the
  [Qwen3-VL-8B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct) base and the
  Qwen3-VL vision-language architecture.
- **Prince Canuma and the [mlx-vlm](https://github.com/Blaizzy/mlx-vlm) project**, and the
  **Apple MLX team**, for the tooling that makes vision-language models run natively on
  Apple Silicon.

The quantization to 4-bit MLX is the only work done here. All model quality is theirs.

---
<!-- ccl-frontdoor -->
## Part of Claude Code Local

This model is one of the fighters in **[Claude Code Local](https://github.com/nicedreamzapp/claude-code-local)** (3.2k★), which runs Claude Code 100% on-device on Apple Silicon through an MLX-native Anthropic-API server. Not sure which local model to run as an agent? Check the **[Agent-12 local agent leaderboard](https://nicedreamzapp.github.io/agent12/)**: real agent tasks, judged by the filesystem, same hardware for every row.

Built by [Matt Macosko](https://github.com/nicedreamzapp) in Humboldt, CA. Open to work on local-AI and Apple Silicon inference: matt@ineedhemp.com.