# A2UI gets faster with swappable formats and decision models

Canonical URL: https://zero2vibecode.com/blog/a2ui-swappable-inference-formats
Date: 2026-10-28
Tags: agents, models, tools, comparison
Source: https://developers.googleblog.com/fast-reliable-a2ui/

A2UI now lets you choose how models generate UI layouts, with new formats that cut latency by up to 80x for common screens.

A2UI, Google's protocol for generating user interfaces with AI, just got faster and more flexible. Instead of forcing models to output complex JSON directly, you can now choose how they describe the UI. Two new options—A2UI Express and decision models like Jev—let you trade off between speed and flexibility depending on what each screen needs.  

## Why this matters for your projects  

When you use AI to generate interfaces, every millisecond counts. The old way required models to produce perfectly formatted JSON with all the brackets and nested structures. This was slow—models had to "think harder" to get it right—and prone to errors. Now:  

- **Express format** cuts token count by 3x by using a Python-like syntax  
- **Decision models** like Jev can reduce latency by up to 80x for screens with predictable layouts  
- You keep using the same component catalog and renderer—only the generation step changes  

If your screens follow set patterns (settings, checkouts, forms), try a decision model first. For one-off or highly dynamic UIs, stick with Express.  

## How swappable formats work  

An inference format has two parts that the A2UI SDK generates from your component catalog:  

1. **Prompt instructions** that teach the model how to write in this format  
2. A **compiler** that converts the model's output into standard A2UI messages  

You choose the format when creating the generator:  

```python
from a2ui.processor import A2uiGenerator, CatalogConfig
from a2ui.inference_formats import ExpressFormatFactory

generator = A2uiGenerator(
  [catalog],
  inference_format_factory=ExpressFormatFactory(),  # ← The switch
)
```

The same pattern works in TypeScript (`new ExpressFormatFactory()`) and Dart.  

## A2UI Express: the new default  

Express looks like Python with one statement per line. Here's a notification card:  

```
surface("gallery-notification-permission")
$/description="Get alerts for order status changes"
root=Card(main_column)
main_column=Column([icon, title, description, actions], _, "center")
icon=Icon($/icon)
```

Key differences from JSON:  

| Feature          | Direct JSON                           | Express                          |
|------------------|---------------------------------------|----------------------------------|
| Syntax           | Nested braces, quotes, commas         | Flat, Python-like assignments    |
| Component IDs    | Manually specified in JSON            | Variable names become IDs        |
| Required tokens  | ~300 for this example                 | ~100 for the same UI             |
| Error rate       | Higher (schema constraints)            | Lower (positional args only)     |

Express works well even with "thinking mode" off in Gemini 3.5 Flash, which further speeds up generation.  

## When to use decision models  

For screens where you know the structure ahead of time—like settings pages or checkout flows—a System One model like Jev is faster. Instead of generating UI markup, it answers questions like:  

- "What type of control does this row need?" (switch/value/nav)  
- "How should these items be grouped?"  

Apparite (jev2ui), an open-source tool, shows how this works:  

1. Jev answers ~30 layout questions in 100-300ms  
2. Code builds the component tree in ~200ms  
3. A small model like Gemini 3.5 Flash Lite fills in text  

In tests, this pipeline produced valid A2UI for all 11 test prompts, with screens completing in 0.8-1.7 seconds.  

## Choosing your format  

Three paths, depending on your screen types:  

1. **Controlled generation** (Jev)  
   - Best for: Settings, forms, checkouts  
   - Speed: Up to 80x faster than original JSON  
   - Limitation: Only works with predefined layouts  

2. **A2UI Express**  
   - Best for: Dynamic or one-off screens  
   - Speed: 3x fewer tokens than JSON  
   - Flexibility: Full access to your component catalog  

3. **Custom formats**  
   - For: Specialized use cases  
   - Requires: Writing a prompt generator + compiler  

## Getting started  

To try Express:  

1. Update your SDK:  
   ```bash
   pip install a2ui-agent-sdk==0.9.0  # or npm install @a2ui/agent
   ```  
2. Pass `ExpressFormatFactory()` when creating your generator  
3. For Gemini, generate skills from your catalog:  
   ```python
   from a2ui.skill import SkillGenerator
   skills = SkillGenerator(ExpressFormat([catalog])).generate_skillset()
   ```  

For decision models, clone the jev2ui example or try the hosted Apparite demo.  

**Limitations.**   
Decision models can't create novel layouts—they only choose among options you define. For completely custom UIs, you'll still need Express or another generative format.  

## Frequently asked questions  

**Can I mix formats in one app?**

Yes. Generate simpler screens with Jev and others with Express. The renderer doesn't know the difference—it only sees standard A2UI messages.

**Do I need to rewrite my component catalog?**

No. All formats use the same catalog.json. The SDK generates format-specific prompts from it automatically.

## Read next

- [Agents CLI Adds Framework Flexibility with Extension System](https://zero2vibecode.com/blog/agents-cli-extension-system-framework-flexibility)
- [API Gateway adds streaming for real-time and AI APIs](https://zero2vibecode.com/blog/google-api-gateway-streaming)

Want to try all of this hands-on? Start with the free [Claude Code from Zero](https://zero2vibecode.com/learn/claude-code) course.

**Source.**   
Based on Google's announcement, "Fast, reliable A2UI, with swappable inference formats". Written for people learning to build with these tools.
