Thesysdev Opens ChatGPT's Intelligent UI Pattern as a Free Next.js Tool
A new MIT-licensed repo recreates ChatGPT's Intelligent UI, streaming interactive maps, charts, forms, and mini apps instead of plain text replies.
Takeaways
- Open-source clone of ChatGPT's Intelligent UI, streaming interactive answers instead of plain text, now at 620+ stars on GitHub.
- Built on OpenUI Lang 1.0: model emits a DSL that renders into stateful React primitives with maps, charts, inputs, SVG, and sandboxed HTML.
- Ships 59 helper functions so answers compute client-side, enabling calculators, planners, and dashboards without round-trips to the model.
- Works with OpenUI Cloud, any OpenAI-compatible API via
LLM_BASE_URL, or local Ollama models like qwen3 and gpt-oss. - Includes a benchmark harness that parses outputs and screenshots them across widths and themes for model evaluation.
- MIT licensed Next.js and TypeScript project with a live hosted demo you can try first.
Thesysdev has released Open Intelligent UI, an MIT-licensed Next.js implementation of ChatGPT’s Intelligent UI pattern. A prompt such as “Plan a day in San Francisco” can produce an interactive map, photos, and an editable itinerary. Developers can inspect and modify the language, renderer, state system, API route, and evaluation harness, making the repository a practical reference for building generative interfaces.
Written in TypeScript, the repository has 630 GitHub stars. A hosted demo runs without installation and includes starter prompts for city exploration, calculators, and a playable drum pad.
| Area | Implementation |
|---|---|
| License | MIT |
| Application stack | Next.js and TypeScript |
| Generated format | OpenUI Lang 1.0 |
| Default backend | OpenUI Cloud through the Thesys-hosted Gateway |
| Other backends | OpenAI-compatible endpoints and Ollama |
| Thread storage | Browser localStorage |
From prompt to component tree
OpenUI Lang 1.0 gives the model a compact domain-specific language for describing components, state variables, and function calls. The client parses that language as tokens arrive and builds a React tree incrementally. Layout remains under the model’s control while each generated element maps to a component registered by the application.
A broad primitive set
- Layout and content: text, containers, lists, expandable sections, and other structural elements.
- Inputs:
Slider,DatePicker,Timer, and category filters. - Maps and media: MapLibre GL maps,
MapMarker, street routes, and image search results. - Data and learning tools: charts, KaTeX math, dashboards, and a flipping
Flashcard. - Embedded experiences:
HtmlViewcan run generated HTML, canvas projects, or small games inside a sandboxed iframe.
The registry constrains the main interface to known React primitives and functions. Generated HTML receives a separate sandbox through HtmlView, preserving a boundary between the application and embedded content.
State stays live in the browser
Inputs bind to dollar-prefixed variables such as $principal or $duration. Statements that read those variables recompute after user interaction, allowing a slider, date picker, or filter to update the surrounding interface without another model request.
The project adds 59 generic functions to the OpenUI 1.0 built-ins. They cover lists, numbers, text, colors, dates, and dashboard operations such as @GroupBy, @Pivot, @Bucket, and @MovingAvg. The supplied prompt options instruct the model to store inputs and lists in variables, then derive displayed values through these functions.
A request such as “I just bought a KALLAX” can become an interactive assembly guide. A loan question can produce sliders and an amortization table that recalculates locally as the principal, term, or rate changes. This client-side state model turns one generated answer into a reusable tool.
One route, two backend paths
The browser sends conversations through /api/chat, while the server selects the generation path from its environment configuration.
- Gateway mode: The default path calls the OpenUI Gateway Responses API with
generateSystemPrompt({ cloud: true }). Gateway validates generated OpenUI Lang against the application’s component library and can correct invalid output. - Compatible endpoint mode: The route builds the full OpenUI 1.0 system prompt on the server, opens a Chat Completions stream against the configured endpoint, and converts incoming text into Responses-style events. The browser renderer remains unchanged.
SearchImage resolution happens after generation. The client calls /api/wiki for a Wikipedia lead image and /api/image-search for matching Wikimedia Commons results. Image retrieval therefore remains a renderer-side operation and requires no search tool in the model request.
Local setup in four commands
| Required runtime | Node.js 24 |
|---|---|
| Package manager | npm |
cp .env.example .env
npm install
npm run generate:apiKey
npm run dev
npm run generate:apiKey creates the key used by the default OpenUI Cloud configuration. The development server then exposes the chat application and supporting API routes.
Custom endpoint variables
LLM_BASE_URL: the OpenAI-compatible endpoint.LLM_API_KEY: the provider credential.LLM_MODEL: the model identifier sent with requests.
Ollama provides a fully local path. The README defaults to qwen3.8:27b, which occupies about 18 GB and is best suited to systems with at least 32 GB of memory. Smaller listed alternatives include gpt-oss:20b and qwen3:8b.
The OpenUI system prompt uses roughly 8,000 tokens, while Ollama’s default context window is 4,096. That mismatch silently truncates the instructions and often produces invalid output. Local deployments need a larger OLLAMA_CONTEXT_LENGTH or a custom Ollama model configured with enough context for both the prompt and generated response.
Strong fits and hard edges
Strong fits
- Calculators, planners, dashboards, quizzes, and other interfaces that continue computing in the browser.
- Map-heavy itineraries with MapLibre GL markers and street geometry.
- Photo-rich answers backed by Wikipedia and Wikimedia Commons.
- Domain-specific tools that need custom components or functions.
- Design work through the
/gallerydevelopment page, which renders every component and worked example with light and dark tokens.
Known limits
- Dark mode remains partial. The component library includes light and dark tokens, but only
/galleryand the benchmark’s/previewroute switch themes. The chat interface is light-only. - Local endpoints render model output as generated. Gateway mode adds validation and correction, while local quality depends more heavily on the selected model.
- Thread history lives in
localStorage, leaving database persistence, account sync, and multi-device history to the application developer. - Map routing depends on the public OSRM demo server and its driving profile. The integration provides road geometry without walking or transit routes.
A benchmark for invented APIs
The included benchmark harness tests generative UI support against any OpenAI-compatible endpoint. It sends 16 example prompts and eight dashboard prompts, then evaluates both syntax and rendering behavior.
- Saves every generated answer for inspection.
- Parses output with the OpenUI 1.0 parser.
- Flags function names and components missing from the application library.
- Captures light and dark screenshots at widths of 390 and 1,280 pixels.
Those checks expose models that produce plausible syntax while inventing unsupported functions or components. They also create a repeatable way to compare open-weight models before connecting one to a production interface.
Where the pattern fits
Open Intelligent UI suits agent products that need stateful answers beyond prose and static tool-result cards. Its constrained UI language gives the model flexibility while preserving an application-controlled component registry, server route, and execution model.
Teams can prune the primitive set, add domain-specific widgets, extend the function library, replace browser storage, or connect an existing OpenAI-compatible gateway. The repository provides the renderer, prompt design, reactive state system, cloud and local backend paths, image pipeline, and benchmark needed to evaluate that architecture in a working application.