Skip to content
zero2vibecodelearn vibe coding
Google DevelopersBy zero2vibecode

A2UI gets faster with swappable formats and decision models

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

Based on the original announcement — written by AI, not reviewed before publishing. How this blog is made

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.

Speedometer showing three inference format speeds

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

Tip

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:

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:

FeatureDirect JSONExpress
SyntaxNested braces, quotes, commasFlat, Python-like assignments
Component IDsManually specified in JSONVariable names become IDs
Required tokens~300 for this example~100 for the same UI
Error rateHigher (schema constraints)Lower (positional args only)

Note

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:
    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:
    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

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.

Want to try all of this hands-on? Start with the free Claude Code from Zero course.

Source

Read next

Try it hands-on

Free interactive courses on this topic — in your browser, from zero.