{"slug": "fast-reliable-a2ui-with-swappable-inference-formats", "title": "Fast, reliable A2UI, with swappable inference formats", "summary": "Google's A2UI project released swappable inference formats for its agent-optimized generative UI protocol, with the new A2UI Express format cutting latency by up to 3x and using up to 3x fewer tokens than Direct JSON, while decision models such as Jev can cut latency by up to 80x for layout decisions. A2UI Express ships in the Python agent SDK (a2ui-agent-sdk 0.9.0 on PyPI), the TypeScript agent SDK (@a2ui/agent on npm) and the Dart SDK (a2ui_agent 0.0.1-wip004 on pub.dev), and is set with one argument when creating the generator. The change decouples A2UI from LLM text generation, letting agents emit an intermediate format that deterministic SDK code compiles into validated A2UI JSON transport messages.", "body_md": "We've heard your concerns about the speed of A2UI and generative UI experiences: people wait while the model generates each screen. This release gives you levers to make that faster, so you can choose the trade-off that fits each screen.\n\nWith this release, we’re happy to introduce swappable inference formats and share examples on leveraging decision models with A2UI, which help building faster and more reliable generative UI experiences. Using our new A2UI Express as an inference format you can reduce latency by up to **3x**, and up-to **80x** using decision models like Jev to make layout decisions. Express requires up to 3x fewer tokens to generate the same kinds of UI compared to Direct JSON. We'll dive into the details in this blog post.\n\nA2UI is an agent-optimized protocol for generative UI, where a client advertises a catalog of trusted components as a contract, an agent sends A2UI messages describing a bespoke user interface composed from that catalog, and the client's renderer draws the UI (see [Introducing A2UI](https://developers.googleblog.com/introducing-a2ui-an-open-project-for-agent-driven-interfaces/)).\n\nInitially agents generated A2UI JSON transport messages directly, every curly brace and nested element. It turns out that generating JSON trees constrained by a complex JSON schema is slow and error-prone for LLMs. This coupled A2UI to LLMs, which output text, and made it difficult to integrate faster System One decision models.\n\nNow agents can generate **A2UI Express**, an intermediate format optimized for inference speed and accuracy, and rely on deterministic code in A2UI's Agent SDKs to translate it into the JSON-based transport protocol. Agent builders are also free to swap in any other DSL and its associated compiler for any special use-cases, and our A2UI Agent SDK(s) make it compatible with transports and renders.\n\nThe format the model generates is what we call *inference_format*. You set it with one argument when you create the generator. The SDK generates the prompt instructions for that format and compiles the model's reply into standard A2UI messages. This post covers how the swap works, why we developed A2UI Express as the new default inference format, and how a decision model can build screens from layouts you define in advance.\n\nAn inference format has two parts, and the SDK generates both from your catalog's JSON schema. A prompt section teaches the model the format's syntax, and a compiler compiles the model's reply into validated A2UI messages. Because both come from the schema, a format can't describe a component or property that your catalog lacks.\n\nYou choose the format with one argument when you create the generator:\n\n``` python\nfrom a2ui.processor import A2uiGenerator, CatalogConfig\nfrom a2ui.inference_formats import ExpressFormatFactory\n\ncatalog = CatalogConfig.from_path(\"catalog.json\")\ngenerator = A2uiGenerator(\n    [catalog],\n    examples=few_shot_examples,  # written once as A2UI JSON\n    inference_format_factory=ExpressFormatFactory(),\n)\n\nprocessor = generator.create_processor(renderer_capabilities)\nsystem_prompt = f\"{instructions}\\n\\n{processor.prompt_snippet}\"\nparts = processor.parse_response(model_reply)  # text parts + validated A2UI messages\n```\n\nA2UI Express is available in the Python agent SDK ([a2ui-agent-sdk](https://pypi.org/project/a2ui-agent-sdk/) 0.9.0 on PyPI), in the TypeScript agent SDK ([@a2ui/agent](https://www.npmjs.com/package/@a2ui/agent) on npm), and in the Dart SDK ([a2ui_agent](https://pub.dev/packages/a2ui_agent) 0.0.1-wip004 on pub.dev). In TypeScript, you pass `new ExpressFormatFactory()` as the generator's third argument. The Python and TypeScript SDKs can both stream Direct JSON chunk by chunk, and they compile Express from the complete reply.\n\nExpress writes one statement per line, in a style close to Python. Each line assigns a component to a variable, and the variable name becomes the component ID. Arguments are positional: the compiler maps them to property names in the order your catalog schema declares them, and _ skips one. $/title binds a value to the data model, and `Event(\"accept\")` declares a server action. This is the A2UI gallery's notification card in Express:\n\n```\nsurface(\"gallery-notification-permission\")\n$/description=\"Get alerts for order status changes\"\n$/icon=\"check\"\n$/title=\"Enable notification\"\nroot=Card(main_column)\nmain_column=Column([icon, title, description, actions], _, \"center\")\nicon=Icon($/icon)\ntitle=Text($/title)\ndescription=Text($/description, \"body\")\nactions=Row([yes_btn, no_btn], \"center\")\nyes_btn_text=Text(\"Yes\")\nyes_btn=Button(yes_btn_text, _, Event(\"accept\", {}))\nno_btn_text=Text(\"No\")\nno_btn=Button(no_btn_text, _, Event(\"decline\", {}))\n```\n\nSwappable Inference formats including A2UI Express also work with macros in the Python agent SDK, which help when a screen shows data your systems already hold. The model writes a call with only an ID, such as `OrderStatus(\"ord_42\")`, and your macro fetches the order and fills in the values, so every value on screen comes straight from your data. The [macros README](https://github.com/a2ui-project/a2ui/blob/main/python/a2ui_agent/src/a2ui/transformers/macros/README.md) shows the setup.\n\nCustomer feedback uncovered latency and accuracy issues with direct JSON generation. To fix this, we started devising a new inference format. We experimented with four options:\n\nWe ran all four formats through the same 51-task eval on gemini-3.5-flash and compared them for thinking modes: on and off.\n\nWe observed that Express inference format works just as well even with thinking off; which can give you the fastest inference times when working with A2UI Express.\n\nSome screens have a known shape, such as a settings page, a checkout or a confirmation. For those, the model doesn't need to design a layout. It needs to choose among layouts you have already defined, and a different kind of model is built for that. For this, you would not need the full expressivity provided by A2UI Express.\n\n[Jev](https://docs.typesafe.ai/), from TypeSafe, is what is called a *System One model*, built to make fast, structured decisions that code can use directly. Jev doesn't generate text or JSON. You send it a state and a set of typed questions, and it answers each one with calibrated probabilities. A question can ask whether a statement is true (Noul), which option from a list fits (Choice), or how something scores on a rubric (Score). Jev answers many questions in one request, in roughly 100 to 300 ms.\n\n[Apparite](https://github.com/dglazkov/jev2ui)(jev2ui), an open-source design tool, shows one way to connect a System One model to A2UI. Jev decides the structure of each screen, code builds the A2UI components from those decisions, and a small model, gemini-3.5-flash-lite, writes only the text. The questions live in a Markdown grammar written ahead of time. A blockquote asks a question, and the bullets are its options, each with criteria. This block from `grammar/screen.md` decides which control a settings row gets:\n\n```\n#### row_control (of each row in rows, within each group in groups)\n\nMaterial: a switch for one on/off setting that takes effect at once. HIG: a disclosure indicator for a row that opens another page.\n\n> `{row}` is a row in the supplied screen and section. Grouped rows can represent content, navigation, settings or actions; use their actual text and context to decide.\n>\n> What kind of row is {row}?\n\n- **switch** — A setting that is simply on or off and takes effect at once: notifications, dark mode, autoplay, sync.\n- **value** — A setting with one current value picked from several, changed on another page: language, quality, theme, frequency, units.\n- **nav** — A link to another page: a content item, details, account, privacy, help, about, or managing something. Its text and section identify what it opens.\n- **check** — One of several alternative options listed together, of which one is chosen: the choices of a single setting, such as '10 seconds', '30 seconds', 'High', 'Low'.\n- **danger** — A final or destructive account action: sign out, delete account, clear data, reset.\n```\n\nOn a podcast app's settings screen, Jev answers `Skip forward` → value, `Auto-download` → switch and `Log out` → danger, each at p ≈ 1.00. Apparite builds a whole screen in three steps:\n\n`createSurface` and `updateComponents` at about 200 ms, with placeholders where the text will go.`updateDataModel`. As each part arrives, small follow-up Jev requests settle what depends on it, such as the row controls above.\nIn one run of 11 prompts, the component tree was on screen in 92 to 298 ms and each screen was complete in 0.8 to 1.7 s. The text writer generated 101 to 341 tokens per screen, and both of Apparite's Jev pipelines produced valid A2UI on all 11 prompts. The project treats these numbers as a first look, since the sample is small.\n\nControlled generation can only produce the layouts its grammar describes. Apparite's grammar covers nine screen archetypes and twelve blocks, so screens without a known shape are a better fit for Express. A2UI Agent SDKs, don’t include a decision model inference format yet; [apparite(jev2ui)](https://github.com/dglazkov/jev2ui) project is an example on how A2UI messages could be assembled given a batch of independent decisions from a decision model.\n\nA2UI Express is fast and keeps the full expressivity of A2UI, but a decision model making multiple independent decisions is still faster. Choose by how much of the screen you can define ahead of time:\n\n**Use Express in your agent.** Install the Python SDK with `pip install a2ui-agent-sdk` or the TypeScript SDK with `npm install @a2ui/agent`, pass `ExpressFormatFactory()` when you create the generator, and run the model with thinking off. Your catalog and renderers stay as they are, and the [Express specification](https://a2ui.org/specification/proposals/express/a2ui_express/) documents the syntax.\n\nTo teach Gemini, or any other model that loads skills, to write Express with only your components, generate skills from your catalog with the Python SDK's `SkillGenerator`:\n\n``` python\nimport json\nfrom a2ui.core import Catalog\nfrom a2ui.inference_formats.express import ExpressFormat\nfrom a2ui.skill import SkillGenerator\n\ncatalog = Catalog.from_json(json.load(open(\"catalog.json\")))\nskills = SkillGenerator(ExpressFormat([catalog])).generate_skillset()\nskills.export_to_directory(\"skills\")  # a2ui-core plus one skill per catalog\n```\n\n**Try controlled generation.** Clone the [example jev2ui repository](https://github.com/dglazkov/jev2ui), and follow the instructions there to get started. A hosted version of [Apparite(jev2ui)](https://github.com/dglazkov/jev2ui) runs at [apparite.cnfg.ai](https://apparite.cnfg.ai/).\n\nEarlier A2UI posts: [Introducing A2UI](https://developers.googleblog.com/introducing-a2ui-an-open-project-for-agent-driven-interfaces/) (December 2025), [A2UI v0.9](https://developers.googleblog.com/a2ui-v0-9-generative-ui/) (April 2026) and [A2UI + MCP Apps](https://developers.googleblog.com/en/a2ui-and-mcp-apps/) (June 2026).", "url": "https://wpnews.pro/news/fast-reliable-a2ui-with-swappable-inference-formats", "canonical_source": "https://developers.googleblog.com/fast-reliable-a2ui/", "published_at": "2026-10-27 15:45:57.011063+00:00", "updated_at": "2026-10-27 15:45:59.219269+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "generative-ai", "ai-tools", "developer-tools"], "entities": ["Google", "A2UI", "A2UI Express", "Jev", "a2ui-agent-sdk", "@a2ui/agent", "a2ui_agent"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/fast-reliable-a2ui-with-swappable-inference-formats", "markdown": "https://wpnews.pro/news/fast-reliable-a2ui-with-swappable-inference-formats.md", "text": "https://wpnews.pro/news/fast-reliable-a2ui-with-swappable-inference-formats.txt", "jsonld": "https://wpnews.pro/news/fast-reliable-a2ui-with-swappable-inference-formats.jsonld"}}