--- 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 ``` #### 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 = [""] 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 ``` #### 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 = [""] 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 ``` #### 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 = [""] 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).