--- license: mit language: - en - zh library_name: peft pipeline_tag: text-generation base_model_relation: adapter tags: - macaron - a2ui - a2ui-v0.8 - lora - peft - dynamic-ui - structured-generation - json-generation - grpo - glm5.1 base_model: - zai-org/GLM-5.1 --- # Macaron-A2UI: A Model for Generative UI in Personal Agents
📰 Technical Report | 📄 Paper
> This repository contains the LoRA adapter weights for **Macaron A2UI Venti**. Macaron A2UI Venti is a LoRA adapter trained to generate valid **A2UI v0.8** cards from user context. It is designed for dynamic UI generation in personal-agent scenarios, where a model converts conversation context, product state, and available actions into one structured UI card. This release corresponds to **Macaron A2UI Venti**. ## Highlights - **A2UI v0.8 card generation**: generates structured UI cards that can be consumed by an A2UI-compatible renderer. - **LoRA adapter release**: lightweight adapter weights for continued training, inspection, and adaptation. - **Context-aware UI generation**: takes user intent, conversation context, product state, and available actions as input. - **GRPO post-training**: this release is produced with GRPO on top of a GLM-5.1 A2UI initialization. - **Validation-first design**: outputs should be checked by the provided A2UI v0.8 validator before rendering. ## Model Overview | Field | Value | | --- | --- | | Model family | Macaron A2UI | | Variant | Tall | | Release name | `Macaron A2UI Venti` | | Release type | LoRA adapter | | Foundation checkpoint | `zai-org/GLM-5.1` | | Target protocol | A2UI v0.8 | | Output format | JSON object with `text_response` and `a2ui` fields | | Training method | GRPO with LoRA | | Library | PEFT / Transformers | | Recommended dtype | bfloat16 | | Tokenizer | Same as foundation checkpoint | ### Adapter Details | Field | Value | | --- | --- | | LoRA rank | `16` | | LoRA alpha | `32` | | LoRA dropout | `0.0` | | Target modules | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` | | LM head adapted | `No` | | Training max response | `4096` | ## Model Variants | Variant | Release Name | Foundation Checkpoint | Release Type | | --- | --- | --- | --- | | Tall | Macaron A2UI Venti | `Qwen/Qwen3-30B-A3B-Instruct-2507` | LoRA adapter | | Grande | Macaron A2UI Grande | `Qwen/Qwen3-235B-A22B-Instruct-2507` | LoRA adapter | | Venti | Macaron A2UI Venti | `GLM 5.1` | LoRA adapter | You are currently viewing the **Tall** release. ## Quickstart This repository contains adapter weights only. Load the corresponding foundation checkpoint first, then attach this adapter with PEFT. ```python from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel import torch base_model_id = "zai-org/GLM-5.1" adapter_id = "mindlab-research/Macaron-A2UI-Venti" tokenizer = AutoTokenizer.from_pretrained( base_model_id, trust_remote_code=True, ) base_model = AutoModelForCausalLM.from_pretrained( base_model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True, ) model = PeftModel.from_pretrained(base_model, adapter_id) model.eval() messages = [ { "role": "system", "content": "You are an A2UI v0.8 card generation model. Output exactly one valid A2UI JSON card." }, { "role": "user", "content": "