thesysdev/open-intelligent-ui

TypeScript

345

4 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

chatgpt's new intelligent ui was reverse engineered in less than 24 hours, and apparently you can recreate it with local llms (r/LocalLLaMA)

came across a pretty interesting technical breakdown of chatgpt's newly launched "intelligent ui" feature, and thought this subreddit might find it interesting. for anyone unfamiliar with the concept, intelligent ui is essentially openai's take on **generative ui**. instead of restricting llm…

153

Oct 8, 2026

README

Open Intelligent UI

An open-source implementation of the "Intelligent UI" experience introduced in ChatGPT, built on OpenUI.

In ChatGPT's Intelligent UI, a request such as "plan a day in San Francisco" returns an interactive answer (a map, photographs and an editable itinerary) rather than text. This repository reproduces that experience with open-source components, so that the same kind of interface can be built, modified and shipped inside any application.

OpenUI is the open standard for Generative UI.

This project is independent and is not affiliated with or endorsed by OpenAI. "Intelligent UI" refers to the ChatGPT feature that this demo recreates.

Demo video

ChatGPT's Intelligent UI (left) and this project (right) answering the same request. Select the image to play the video.

ChatGPT and OpenUI side by side, each showing a one-day San Francisco route with photos and a map

What's in the demo

The model streams OpenUI Lang through OpenUI Gateway, and the app renders it as an answer built from custom travel components. They are defined in this repository (src/lib/travel/components.tsx) with OpenUI's defineComponent and registered alongside OpenUI's built-in chat components:

  • TravelHeading and TravelProse: editorial headings and paragraphs with streaming word fades.
  • TravelImage and TravelGallery: a three-photo strip using Gateway image-search results, with Wikipedia fallbacks.
  • TravelStop and TravelItinerary: destination data and compact photo/text rows, sharing the same stop references with TravelMap.
  • TravelMap: a MapLibre GL street map with emoji pins, category filters, expansion and map-to-itinerary selection. Pins appear while the answer streams; once it ends, the map frames the route and draws its line.
  • TravelSuggestions: extra places with "+ Add to my route". Adding one puts a pin on the map and appends it to the itinerary; every stop can also be removed and added back.

The "Customize your route" form at the end of each answer uses OpenUI's built-in form components (Form, RadioGroup, CheckBoxGroup, Button) and sends the chosen preferences back to the model with @ToAssistant.

Setup

Requires Node 24.

cp .env.example .env.local   # add your THESYS_API_KEY
npm install
npm run dev

Open http://localhost:3000 and try: I'm in San Francisco for a day, plan a sightseeing route for me

VariableRequiredPurpose
THESYS_API_KEYYesOpenUI Gateway key, used only on the server.
THESYS_MODELNoA {provider}/{model} id. Defaults to openai/gpt-5.5.

How it works

  • Generation. /api/chat calls OpenUI Gateway's Responses API with generateSystemPrompt({ cloud: true }), so Gateway validates and corrects the generated OpenUI Lang against this app's component library. Gateway's hosted image_search tool finds current photos; the model copies the returned URLs into TravelImage.src and TravelStop.imageUrl.
  • Chat Completions. OpenUI Gateway also supports the Chat Completions API, and OpenUI works with either. This example uses the Responses API because Gateway's hosted tools, such as image_search, are available only there. An application already built on Chat Completions can keep that protocol and pair it with openAIReadableStreamAdapter or openAIAdapter in the browser.
  • Photos. Each photo falls back to Wikipedia when it has no URL or its image fails to load. A gallery photo with no working image at all is dropped so the others fill the row.
  • Route edits. Removed stops, added suggestions and the selected stop live in OpenUI's response state (useStateField), so AgentInterface saves them with the message. /api/chat turns them into a short note so the model knows the user's current route on the next turn.
  • Map data. Wikipedia lookups and street-route geometry go through the app's own server routes, /api/wiki and /api/street-route, which validate input and cache results. Street geometry comes from the public OSRM demo server's driving profile: a road overview, not walking or transit directions. When it's unavailable, a labelled direct connection is drawn instead.
  • Theme. Colors, type, radii, shadows and chat bubbles are theme tokens, applied once through AgentInterface's theme prop. All the stylesheets read those tokens rather than repeating their values.

Project structure

FilePurpose
src/app/layout.tsxRoot layout: page metadata, the Inter font and globals.css.
src/app/page.tsxThe chat page. Renders AgentInterface with the component library, theme, welcome screen and starter prompts, and connects it to /api/chat.
src/app/globals.cssGlobal CSS reset.
src/app/shell.cssRestyles the AgentInterface shell (sidebar, composer, starters, message bubbles), using theme tokens where they exist.
src/app/api/chat/route.tsChat endpoint. Validates the request, forwards the conversation to OpenUI Gateway with image search enabled, and streams the response back.
src/app/api/wiki/route.tsWikipedia lookup: photos and coordinates for a place, cached on the server.
src/app/api/street-route/route.tsStreet geometry between stops from OSRM, cached on the server.
src/lib/library.tsThe OpenUI component library: OpenUI's chat components plus the travel components, with the Travel group's layout note.
src/lib/prompt-options.tsExtra prompt examples and rules for travel answers, added on top of OpenUI's defaults.
src/lib/response-theme.tsTheme tokens (colors, fonts, radii, shadows, chat bubbles), built with createTheme().
src/lib/response-theme.cssStyles OpenUI's built-in components inside answers (buttons, forms, tabs, tables), and defines the --iui-* aliases the travel styles use.
src/lib/route/root.tsxThe Card root every answer renders inside; accepts the travel components as children.
src/lib/route/route.cssLayout of the answer container.
src/lib/route/store.tsuseRouteStore(): route edits kept in OpenUI's response state, plus the client side of the Wikipedia lookup.
src/lib/travel/components.tsxThe travel components the model can generate (defineComponent + Zod schema each), plus photo fallback logic.
src/lib/travel/map.tsxThe map behind TravelMap: pins, filter, expand, framing and the route line.
src/lib/travel/map-utils.tsMap helpers: coordinates, bounds, partial lines for the draw animation, pin elements and the emoji check.
src/lib/travel/use-street-route.tsHook that loads street geometry from /api/street-route in the background.
src/lib/travel/use-dialog.tsHook for the expanded map dialog: scroll lock, focus trap, Escape to close.
src/lib/travel/vector-basemap.tsLoads MapLibre and defines the vector map style and the raster fallback style.
src/lib/travel/travel.cssStyles for the travel components and map.
src/generated/spec.jsonLibrary spec sent to Gateway in the system prompt. Regenerate with npm run generate after changing a component schema.
docs/openui-chatgpt-comparison.mp4Side-by-side video of ChatGPT and this project; docs/openui-chatgpt-comparison.jpg is its README preview.
.env.exampleThe environment variables to copy into .env.local.

Checks

npm run generate       # after changing a component schema
npx tsc --noEmit
npm run build

Then try the San Francisco prompt and another city such as Lisbon. Check the photo strip, pins appearing during the stream, the route reveal, map filters and expansion, adding and removing places, and the customize form, on desktop and mobile.

thesysdev/open-intelligent-ui

TypeScript

345

4 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

chatgpt's new intelligent ui was reverse engineered in less than 24 hours, and apparently you can recreate it with local llms (r/LocalLLaMA)

came across a pretty interesting technical breakdown of chatgpt's newly launched "intelligent ui" feature, and thought this subreddit might find it interesting. for anyone unfamiliar with the concept, intelligent ui is essentially openai's take on **generative ui**. instead of restricting llm…

153

Oct 8, 2026

README

Open Intelligent UI

An open-source implementation of the "Intelligent UI" experience introduced in ChatGPT, built on OpenUI.

In ChatGPT's Intelligent UI, a request such as "plan a day in San Francisco" returns an interactive answer (a map, photographs and an editable itinerary) rather than text. This repository reproduces that experience with open-source components, so that the same kind of interface can be built, modified and shipped inside any application.

OpenUI is the open standard for Generative UI.

This project is independent and is not affiliated with or endorsed by OpenAI. "Intelligent UI" refers to the ChatGPT feature that this demo recreates.

Demo video

ChatGPT's Intelligent UI (left) and this project (right) answering the same request. Select the image to play the video.

ChatGPT and OpenUI side by side, each showing a one-day San Francisco route with photos and a map

What's in the demo

The model streams OpenUI Lang through OpenUI Gateway, and the app renders it as an answer built from custom travel components. They are defined in this repository (src/lib/travel/components.tsx) with OpenUI's defineComponent and registered alongside OpenUI's built-in chat components:

  • TravelHeading and TravelProse: editorial headings and paragraphs with streaming word fades.
  • TravelImage and TravelGallery: a three-photo strip using Gateway image-search results, with Wikipedia fallbacks.
  • TravelStop and TravelItinerary: destination data and compact photo/text rows, sharing the same stop references with TravelMap.
  • TravelMap: a MapLibre GL street map with emoji pins, category filters, expansion and map-to-itinerary selection. Pins appear while the answer streams; once it ends, the map frames the route and draws its line.
  • TravelSuggestions: extra places with "+ Add to my route". Adding one puts a pin on the map and appends it to the itinerary; every stop can also be removed and added back.

The "Customize your route" form at the end of each answer uses OpenUI's built-in form components (Form, RadioGroup, CheckBoxGroup, Button) and sends the chosen preferences back to the model with @ToAssistant.

Setup

Requires Node 24.

cp .env.example .env.local   # add your THESYS_API_KEY
npm install
npm run dev

Open http://localhost:3000 and try: I'm in San Francisco for a day, plan a sightseeing route for me

VariableRequiredPurpose
THESYS_API_KEYYesOpenUI Gateway key, used only on the server.
THESYS_MODELNoA {provider}/{model} id. Defaults to openai/gpt-5.5.

How it works

  • Generation. /api/chat calls OpenUI Gateway's Responses API with generateSystemPrompt({ cloud: true }), so Gateway validates and corrects the generated OpenUI Lang against this app's component library. Gateway's hosted image_search tool finds current photos; the model copies the returned URLs into TravelImage.src and TravelStop.imageUrl.
  • Chat Completions. OpenUI Gateway also supports the Chat Completions API, and OpenUI works with either. This example uses the Responses API because Gateway's hosted tools, such as image_search, are available only there. An application already built on Chat Completions can keep that protocol and pair it with openAIReadableStreamAdapter or openAIAdapter in the browser.
  • Photos. Each photo falls back to Wikipedia when it has no URL or its image fails to load. A gallery photo with no working image at all is dropped so the others fill the row.
  • Route edits. Removed stops, added suggestions and the selected stop live in OpenUI's response state (useStateField), so AgentInterface saves them with the message. /api/chat turns them into a short note so the model knows the user's current route on the next turn.
  • Map data. Wikipedia lookups and street-route geometry go through the app's own server routes, /api/wiki and /api/street-route, which validate input and cache results. Street geometry comes from the public OSRM demo server's driving profile: a road overview, not walking or transit directions. When it's unavailable, a labelled direct connection is drawn instead.
  • Theme. Colors, type, radii, shadows and chat bubbles are theme tokens, applied once through AgentInterface's theme prop. All the stylesheets read those tokens rather than repeating their values.

Project structure

FilePurpose
src/app/layout.tsxRoot layout: page metadata, the Inter font and globals.css.
src/app/page.tsxThe chat page. Renders AgentInterface with the component library, theme, welcome screen and starter prompts, and connects it to /api/chat.
src/app/globals.cssGlobal CSS reset.
src/app/shell.cssRestyles the AgentInterface shell (sidebar, composer, starters, message bubbles), using theme tokens where they exist.
src/app/api/chat/route.tsChat endpoint. Validates the request, forwards the conversation to OpenUI Gateway with image search enabled, and streams the response back.
src/app/api/wiki/route.tsWikipedia lookup: photos and coordinates for a place, cached on the server.
src/app/api/street-route/route.tsStreet geometry between stops from OSRM, cached on the server.
src/lib/library.tsThe OpenUI component library: OpenUI's chat components plus the travel components, with the Travel group's layout note.
src/lib/prompt-options.tsExtra prompt examples and rules for travel answers, added on top of OpenUI's defaults.
src/lib/response-theme.tsTheme tokens (colors, fonts, radii, shadows, chat bubbles), built with createTheme().
src/lib/response-theme.cssStyles OpenUI's built-in components inside answers (buttons, forms, tabs, tables), and defines the --iui-* aliases the travel styles use.
src/lib/route/root.tsxThe Card root every answer renders inside; accepts the travel components as children.
src/lib/route/route.cssLayout of the answer container.
src/lib/route/store.tsuseRouteStore(): route edits kept in OpenUI's response state, plus the client side of the Wikipedia lookup.
src/lib/travel/components.tsxThe travel components the model can generate (defineComponent + Zod schema each), plus photo fallback logic.
src/lib/travel/map.tsxThe map behind TravelMap: pins, filter, expand, framing and the route line.
src/lib/travel/map-utils.tsMap helpers: coordinates, bounds, partial lines for the draw animation, pin elements and the emoji check.
src/lib/travel/use-street-route.tsHook that loads street geometry from /api/street-route in the background.
src/lib/travel/use-dialog.tsHook for the expanded map dialog: scroll lock, focus trap, Escape to close.
src/lib/travel/vector-basemap.tsLoads MapLibre and defines the vector map style and the raster fallback style.
src/lib/travel/travel.cssStyles for the travel components and map.
src/generated/spec.jsonLibrary spec sent to Gateway in the system prompt. Regenerate with npm run generate after changing a component schema.
docs/openui-chatgpt-comparison.mp4Side-by-side video of ChatGPT and this project; docs/openui-chatgpt-comparison.jpg is its README preview.
.env.exampleThe environment variables to copy into .env.local.

Checks

npm run generate       # after changing a component schema
npx tsc --noEmit
npm run build

Then try the San Francisco prompt and another city such as Lisbon. Check the photo strip, pins appearing during the stream, the route reveal, map filters and expansion, adding and removing places, and the customize form, on desktop and mobile.

Significant stargazers

Alex Yang

6,375 followers · starred Oct 2026