Image-Text-to-Text
MLX
Safetensors
English
qwen3_vl
text-generation-inference
apple-silicon
4-bit precision
8-bit precision
mlx-vlm
code-generation
html
multimodal
reinforcement-learning
design
conversational
Instructions to use prithivMLmods/microsoft-AesCode-8B-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use prithivMLmods/microsoft-AesCode-8B-MLX with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("prithivMLmods/microsoft-AesCode-8B-MLX") config = load_config("prithivMLmods/microsoft-AesCode-8B-MLX") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use prithivMLmods/microsoft-AesCode-8B-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/microsoft-AesCode-8B-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prithivMLmods/microsoft-AesCode-8B-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use prithivMLmods/microsoft-AesCode-8B-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/microsoft-AesCode-8B-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default prithivMLmods/microsoft-AesCode-8B-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use prithivMLmods/microsoft-AesCode-8B-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/microsoft-AesCode-8B-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "prithivMLmods/microsoft-AesCode-8B-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
File size: 6,709 Bytes
10d8e88 0df755e 10d8e88 0df755e fc5162c 0df755e 216ef6f fe2227a 216ef6f fe2227a 216ef6f db5b2fe 216ef6f 3833f07 | 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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | ---
base_model_relation: quantized
language: en
library_name: mlx
pipeline_tag: image-text-to-text
tags:
- mlx
- text-generation-inference
- apple-silicon
- 4-bit
- 8-bit
- mlx-vlm
- code-generation
- html
- multimodal
- reinforcement-learning
- design
base_model:
- microsoft/AesCode-8B
license: apache-2.0
---
# **microsoft-AesCode-8B-MLX**
> **AesCode-8B** is Microsoft's 8B vision-language model, built on Qwen3-VL-8B-Instruct, for generating information-rich visual artifacts such as slides, posters, dashboards and reports as structured, editable HTML/CSS. It addresses a gap between two kinds of generator: code models can't see how layout, hierarchy and color come together on the canvas, while image generators compose attractive pages but misrender text, numbers and logical relationships. AesCode therefore takes an image generated from the same prompt as an aesthetic reference and follows the prompt for the required content. Tables come out as HTML table structures and charts as ECharts specifications, so both stay inspectable and verifiable. Training was cold-start SFT on 3,000 demonstrations, followed by GDPO reinforcement learning for 400 steps over 7,408 prompts, using verl and no separately trained reward model. Each target is represented as a design graph, and the reward is split into seven decoupled channels: execution, text, boundary, tablechart, layout, whitespace and design. Deterministic verifiers score what can be parsed from the code and its rendering, and a VLM judge scores the rest against a sample-specific Visual Graph Rubric. On the card's 300 infographic samples, AesCode-8B scores 82.94 Overall (Rule 90.07, Visual 75.80). That is above the reference-conditioned GPT-5.5 (81.28) and Claude Opus 4.8 (80.39), and 31.0 points above its reference-conditioned Qwen3-VL-8B backbone. The 32B companion model leads at 85.89. Style is a ceiling for every system, with no model above 60. The reference image is optional, since withholding it costs AesCode-8B only 1.00 Visual point, versus 19.55 for the base model, though quality is highest with it. The model loads through standard Transformers or vLLM, with the training code, verifier stack and rubric builder released on GitHub. The paper is still listed as under review. It is released under Apache 2.0.
## Directory Structure
```
prithivMLmods/microsoft-AesCode-8B-MLX/
βββ 4bit/
βββ 8bit/
βββ (root: bf16 base model mlx)
```
## Use with mlx
Install the required library:
```bash
pip install -U mlx-vlm
```
> **Usage Note:** `AesCode-8B` produces clean, standalone HTML/CSS with embedded inline ECharts or tables. Feeding an aesthetic reference image alongside your content specification prompt yields the highest-fidelity page styling and layouts. Supplying the reference image is optional.
### BF16 Variant (Base Weights)
The unquantized BF16 `mlx` weights reside directly in the root repository path:
#### CLI (Terminal)
```bash
python -m mlx_vlm generate \
--model prithivMLmods/microsoft-AesCode-8B-MLX \
--max-tokens 2048 \
--temperature 0.7 \
--prompt "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS." \
--image <path_to_reference_image>
```
#### Python API
```python
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/microsoft-AesCode-8B-MLX"
model, processor = load(model_path)
config = load_config(model_path)
# Reference image is optional
image = ["<path_to_reference_image>"]
prompt = "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(
model,
processor,
formatted_prompt,
image=image,
max_tokens=2048,
temperature=0.7
)
print(output.text)
```
### 8-bit Variant
Access the 8-bit quantized files using `--subfolder 8bit`:
#### CLI (Terminal)
```bash
python -m mlx_vlm generate \
--model prithivMLmods/microsoft-AesCode-8B-MLX \
--subfolder 8bit \
--max-tokens 2048 \
--temperature 0.7 \
--prompt "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS." \
--image <path_to_reference_image>
```
#### Python API
```python
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/microsoft-AesCode-8B-MLX"
model, processor = load(model_path, subfolder="8bit")
config = load_config(model_path, subfolder="8bit")
image = ["<path_to_reference_image>"]
prompt = "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(
model,
processor,
formatted_prompt,
image=image,
max_tokens=2048,
temperature=0.7
)
print(output.text)
```
### 4-bit Variant
Access the 4-bit quantized files using `--subfolder 4bit`:
#### CLI (Terminal)
```bash
python -m mlx_vlm generate \
--model prithivMLmods/microsoft-AesCode-8B-MLX \
--subfolder 4bit \
--max-tokens 2048 \
--temperature 0.7 \
--prompt "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS." \
--image <path_to_reference_image>
```
#### Python API
```python
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/microsoft-AesCode-8B-MLX"
model, processor = load(model_path, subfolder="4bit")
config = load_config(model_path, subfolder="4bit")
image = ["<path_to_reference_image>"]
prompt = "Generate a modern responsive dashboard for tracking cloud compute usage and GPU cluster health in structured HTML/CSS."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(
model,
processor,
formatted_prompt,
image=image,
max_tokens=2048,
temperature=0.7
)
print(output.text)
```
## License and Attribution
This model is based on and/or incorporates the following open-source projects and models:
* **AesCode-8B:** https://huggingface.co/microsoft/AesCode-8B
* **mlx-vlm:** https://github.com/Blaizzy/mlx-vlm
* **MLX:** https://github.com/ml-explore/mlx
This model is released under the [Apache License 2.0](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md). |