openui README

The project's README from github.com/thesysdev/openui. As one markdown file: README.md.

OpenUI - The Open Standard for Intelligent UI

OpenUI - The Open Standard for Intelligent UI

Build License: MIT Discord

thesysdev%2Fopenui | Trendshift

OpenUI is a full-stack, framework-agnostic Generative UI framework built around a compact, streaming-first language. A framework-agnostic core powers first-party runtimes for React, Vue, Svelte, and Angular, and React additionally ships built-in component libraries and ready-to-use chat interfaces. OpenUI Lang uses up to 67% fewer tokens than JSON.

Docs · Playground · Discord · Contributing

Important: OpenUI has no official cryptocurrency, token, or coin. Any asset using the OpenUI name is unaffiliated with this project and is not endorsed by its maintainers.


What is OpenUI

OpenUI Demo

At the center of OpenUI is OpenUI Lang: a compact, streaming-first language for model-generated UI. Instead of treating model output as only text, OpenUI lets you define components, generate prompt instructions from that component library, and render structured UI as the model streams.

Core capabilities:

Quick Start

npx @openuidev/cli@latest create --name genui-chat-app
cd genui-chat-app
echo "OPENAI_API_KEY=sk-your-key-here" > .env
npm run dev

This is the fastest way to start with OpenUI. The scaffolded app gives you an end-to-end starting point with streaming, built-in UI, and OpenUI Lang support.

What this gives you:

How it works

Your components define what the model can generate.

flowchart LR
    A["Component Library"] --> B["System Prompt"]
    B --> C["LLM"]
    C --> D["OpenUI Lang Stream"]
    D --> E["Renderer"]
    E --> F["Live UI"]
  1. Define or reuse a component library.
  2. Generate a system prompt from that library.
  3. Send that prompt to your model.
  4. Stream OpenUI Lang output back to the client.
  5. Render the output progressively with Renderer.

Try it yourself in the Playground: generate UI live with the default component library.

Packages

Package Best for Description
@openuidev/lang-core Framework-agnostic parsing and prompt generation Core parser, prompt-generation, runtime-evaluation, and type layer with no React, Angular, Vue, or Svelte dependency
@openuidev/langchain LangChain and LangGraph agents Agent transformer and server helpers that stream OpenUI through AG-UI
@openuidev/react-lang React rendering runtimes Define component libraries, generate prompts, and render streamed OpenUI Lang in React
@openuidev/react-headless Bring-your-own React chat UI Headless chat state, streaming adapters, and message format converters
@openuidev/react-ui Fastest path to a full React chat experience Prebuilt chat layouts, standalone UI primitives, and two built-in component libraries
@openuidev/react-email Email generation and HTML export React Email component definitions plus prompt options for model-generated emails
@openuidev/assistant-ui assistant-ui apps Tool UI renderers and instruction wiring for streaming OpenUI Lang inside assistant-ui
@openuidev/vue-lang Vue integrations Vue 3 bindings for defining model-renderable components and rendering streamed OpenUI Lang
@openuidev/svelte-lang Svelte integrations Svelte 5 bindings for defining model-renderable components and rendering streamed OpenUI Lang
@openuidev/angular-lang Angular integrations Angular bindings for defining component libraries and rendering streamed OpenUI Lang
@openuidev/browser-bundle CDN, iframe, and no-build embeds Prebuilt browser bundle that ships the renderer, UI library, React, and styles as script + stylesheet assets
@openuidev/a2ui A2UI with OpenUI Lang component payloads Framework-agnostic A2UI v1.0 protocol client with an optional React renderer
@openuidev/server Server side utilities Server utilities for OpenUI and OpenUI Gateway
@openuidev/observability-cloud Hosted observability in the Thesys console Cloud sink that batches OpenUI events and ships them to OpenUI Gateway
@openuidev/cli Project scaffolding and prompt generation CLI for creating new apps and generating system prompts or JSON schema from a library definition
@openuidev/openclaw-os-plugin OpenClaw workspaces OpenClaw OS plugin for serving OpenUI-powered OpenClaw workspaces

Common starting points:

# React app with OpenUI rendering and prebuilt components
npm install @openuidev/react-lang @openuidev/react-ui

# Framework-agnostic backend or Edge prompt generation
npm install @openuidev/lang-core

# LangChain/LangGraph agent and server integration
npm install @openuidev/langchain @langchain/langgraph

# Vue, Svelte, or Angular runtime
npm install @openuidev/vue-lang
npm install @openuidev/svelte-lang
npm install @openuidev/angular-lang

# A2UI protocol with OpenUI Lang component payloads
npm install @openuidev/a2ui zod

Why OpenUI Lang

OpenUI Lang is designed for model-generated UI that needs to be both structured and streamable.

Token efficiency benchmarks

Measured with tiktoken (GPT-5 encoder). OpenUI Lang vs two JSON-based streaming formats across seven UI scenarios:

Scenario Vercel JSON-Render Thesys C1 JSON OpenUI Lang vs Vercel vs C1
simple-table 340 357 148 -56.5% -58.5%
chart-with-data 520 516 231 -55.6% -55.2%
contact-form 893 849 294 -67.1% -65.4%
dashboard 2247 2261 1226 -45.4% -45.8%
pricing-page 2487 2379 1195 -52.0% -49.8%
settings-panel 1244 1205 540 -56.6% -55.2%
e-commerce-product 2449 2381 1166 -52.4% -51.0%
TOTAL 10180 9948 4800 -52.8% -51.7%

Full methodology and reproduction steps in benchmarks/.

Documentation

Detailed documentation is available at openui.com.

Repository structure

openui/
├── packages/
│   ├── react-lang/       # Core runtime (parser, renderer, prompt generation)
│   ├── react-headless/   # Headless chat state & streaming adapters
│   ├── react-ui/         # Prebuilt chat layouts & component libraries
│   ├── react-email/      # React Email component library for generated emails
│   ├── assistant-ui/     # assistant-ui Tool UI renderers for OpenUI Lang
│   ├── lang-core/        # Framework-agnostic parser, prompt, and runtime layer
│   ├── langchain/        # LangChain/LangGraph streaming integration
│   ├── vue-lang/         # Vue runtime bindings for OpenUI Lang
│   ├── svelte-lang/      # Svelte runtime bindings for OpenUI Lang
│   ├── angular-lang/     # Angular runtime bindings for OpenUI Lang
│   ├── browser-bundle/   # Script-tag bundle for CDN / iframe / no-build embeds
│   ├── a2ui/             # A2UI protocol with OpenUI Lang component payloads
│   ├── server/           # Server utilities for OpenUI & OpenUI Gateway
│   ├── observability/    # Framework-free observability event bus
│   ├── observability-cloud/ # Cloud sink shipping OpenUI events to Thesys
│   ├── devtools/         # Dev-only OpenUI Inspect widget
│   └── openui-cli/       # CLI for scaffolding & prompt generation
├── examples/             # Cookbooks and integration reference implementations
│   ├── agent-frameworks/
│   ├── app-frameworks/
│   ├── cookbooks/
│   ├── design-systems/
│   ├── harnesses/
│   └── miscellaneous/
├── docs/                 # Documentation site (openui.com)
└── benchmarks/           # Token efficiency benchmarks

Good places to start:

Community

How OpenUI compares

Feature OpenUI json-render (Vercel) A2UI (Google) CopilotKit OpenGenUI
Tokens 1x 3x 3x 4x
Latency (60 tok/s) 4.9s 14.2s 14.2s ~20s
Streaming Yes Yes Yes Partial
Consistent output Yes Yes Yes No
Components Library + custom Library + custom Custom only None
Multi-platform Web, mobile, email Web, mobile, PDF, email, video Web, iOS, Android Web
Built-in data fetching Yes No No No
Chat UI included Yes No No Yes

For more details, refer to the official OpenUI Lang comparison documentation.

Adopters

A list of organizations and projects using OpenUI is maintained in ADOPTERS.md. If you're using OpenUI, please consider adding your organization; it helps the project gain momentum and helps other adopters find peers using OpenUI in similar contexts.

Contributing

Contributions are welcome. See CONTRIBUTING.md for contribution guidelines and ways to get involved.

Agent Skill

OpenUI ships an Agent Skill so AI coding assistants (Claude Code, Codex, Cursor, Copilot, etc.) can help you scaffold, build, and debug Generative UI apps using OpenUI Lang.

The skill is maintained in the thesysdev/skills repository.

Install

# With the skills CLI (works across all agents)
npx skills add thesysdev/skills --skill openui

The skill covers component library design, OpenUI Lang syntax, system prompt generation, the Renderer, SDK packages, and debugging malformed LLM output.

Feedback

Found a bug or have an idea? Open an issue, or send anonymous feedback from your terminal:

npx @openuidev/cli feedback "Describe the problem or idea"

Coding agents using the OpenUI skill can send feedback for you. They remove personal details and code from the message and ask for your approval before sending it.

License

This project is available under the terms described in LICENSE.

openui (thesysdev/openui)

Searching Database…

11.4K ·GitHub
这是什么?OpenUI 是一个用于生成式 UI 的开放标准和框架。它定义了一种紧凑、优先支持流式输出的语言(OpenUI Lang),让大语言模型能够生成结构化、可渲染的界面,而不是纯文本或 JSON。它提供适用于 React、Vue、Svelte 和 Angular 的运行时。
它是一个 UI 组件库,还是别的什么?它是一个与框架无关的核心(负责解析、提示词生成和渲染),加上针对各个框架的运行时和软件包,分别支持 React、Vue、Svelte 和 Angular。其中 React 还额外提供预构建的组件库和可直接使用的聊天界面。
如何让一个 OpenUI 应用跑起来?使用命令行工具(@openuidev/cli)生成项目骨架,它会提供一个端到端的示例,并且已经接好流式输出、内置 UI 组件和 OpenUI Lang 支持。
使用它是否需要大语言模型或特定的智能体框架?需要一个可调用的模型:你先定义组件库,再基于它生成系统提示词,把提示词发送给你的大语言模型,然后通过 OpenUI 的渲染器以流式方式把返回内容展示出来。此外,它还专门支持 LangChain 和 LangGraph,并通过 AG-UI 协议进行流式传输。
模型可以生成它想要的任何界面吗?不可以。输出仅限于你明确定义并注册的组件,因此模型只能基于你批准的组件库生成界面,而不能随意生成任意标记。
它支持哪些前端框架?官方提供了 React、Vue 3、Svelte 5 和 Angular 的绑定,另有适用于无需构建或通过 CDN 直接使用的浏览器包,以及与框架无关的核心包,可用于其他场景。
为什么 OpenUI Lang 比 JSON 更高效?OpenUI Lang 是一种紧凑、更适合流式传输的语法,用来替代 JSON。在多个基准测试的界面场景中,它最多可减少 67% 的 token 用量(例如,联系人表单用 294 个 token,而 JSON 需要 893 个)。由于需要传输的 token 更少,延迟也随之降低。
OpenUI 与 Vercel json-render 或 Google A2UI 相比如何?OpenUI 声称其 token 用量约为 1 倍,而 Vercel 的 json-render 和 Google 的 A2UI 均为 3 倍。在每秒 60 个 token 的条件下,OpenUI 的延迟为 4.9 秒,另外两者为 14.2 秒。此外,OpenUI 内置数据获取和聊天界面,而这两者都缺少这些功能。
OpenUI 包含哪些软件包?它包括:与框架无关的核心包(@openuidev/lang-core)、适用于 React、Vue、Svelte 和 Angular 的各框架渲染器、LangChain/AG-UI 连接器、浏览器包、A2UI 客户端、服务端工具、可观测性接收器,以及用于生成项目骨架的命令行工具。
OpenUI 有官方代币或加密货币吗?没有。README 明确提醒,OpenUI 没有任何官方加密货币、代币或币种。任何使用 OpenUI 名称的资产都与其无关,也未获得维护者的认可。
Creator
thesysdev
Size
413.3 MB
Stars
11.4K
Age
1y
Commits · 90 Days