thesysdev/openui
The Open Standard for Generative UI
OpenUI – Generative UI Framework
OpenUI is a full‑stack, framework‑agnostic library that lets you build user interfaces that are generated by large language models (LLMs) and streamed to the client token‑by‑token. It introduces OpenUI Lang, a compact, streaming‑first language that describes UI components more efficiently than JSON (up to 67 % fewer tokens). The core parses the model’s output, turns it into live UI, and can be used from React, Vue, Svelte, Angular, or even a plain browser bundle.
How it works
- Component library – Define a set of UI components (charts, forms, tables, etc.) with typed props (using Zod).
- System prompt generation – OpenUI creates a prompt that tells the LLM which components it may emit.
- LLM call – Send the prompt to your model.
- OpenUI Lang stream – The model streams a compact UI description.
- Renderer – The appropriate runtime (React, Vue, …) parses the stream and incrementally renders the UI as tokens arrive.
The flow is visualised in the README’s Mermaid diagram.
Main packages (monorepo)
| Package | What it provides | Typical use |
|---|---|---|
@openuidev/lang-core |
Parser, prompt generator, runtime evaluation, type layer – no framework dependency | Backend services, edge functions, custom runtimes |
@openuidev/react-lang |
React bindings for parsing and rendering OpenUI Lang | Any React app that wants streaming UI |
@openuidev/react-ui |
Pre‑built chat UI, component library, ready‑to‑use layouts | Fastest way to get a full chat interface |
@openuidev/react-headless |
Headless chat state & streaming adapters | Build your own UI on top of the streaming logic |
@openuidev/vue-lang, @openuidev/svelte-lang, @openuidev/angular-lang |
Framework‑specific bindings | Vue / Svelte / Angular projects |
@openuidev/langchain |
Helpers for LangChain / LangGraph agents to stream OpenUI Lang | Build LLM agents that produce UI |
@openuidev/browser-bundle |
Single‑file bundle (script + stylesheet) for CDN/iframe embeds | No‑build, embed‑in‑any‑page scenarios |
@openuidev/a2ui |
A2UI protocol client that carries OpenUI Lang payloads | Interoperate with A2UI‑compatible back‑ends |
@openuidev/server |
Server utilities and gateway helpers | Host the prompt generation or event observability |
@openuidev/observability-cloud |
Cloud sink that ships OpenUI events to the Thesys console | Production‑grade telemetry |
@openuidev/cli |
CLI for scaffolding apps, generating prompts, converting schemas | npx @openuidev/cli@latest create … |
Quick start (React example)
npx @openuidev/cli@latest create --name genui-chat-app
The command scaffolds a React app that includes:
- OpenUI Lang support
- Library‑driven prompt generation
- Streaming UI updates
- A ready‑to‑run chat surface
You can also install only the core parser for a backend service:
npm install @openuidev/lang-core
Why use OpenUI Lang?
- Streaming‑first – UI appears progressively as the model generates output, reducing perceived latency.
- Token efficiency – Benchmarks show ~50 % fewer tokens than JSON‑based streaming formats across common UI patterns.
- Controlled output – The model can only emit components you have defined, preventing arbitrary markup.
- Typed contracts – Component props are described with Zod schemas, giving static guarantees and easier debugging.
Documentation & community
- Docs & playground – https://openui.com and https://www.openui.com/playground
- Discord – https://discord.com/invite/Pbv5PsqUSv
- GitHub issues – for bugs and feature requests
- Agent Skill – an
openuiskill for AI coding assistants (install vianpx skills add …)
License
OpenUI is released under the MIT License.
TL;DR
OpenUI gives you a compact streaming language and a set of framework‑agnostic runtimes so LLMs can generate UI that appears instantly, with far fewer tokens than JSON. Install the core parser for backend work, or pull in the React/Vue/Svelte/Angular bindings for a full front‑end experience, and use the CLI to scaffold a working app in seconds.
Related
- Project
- Project
- Project
- Project
- Project