DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to generate model prompts from a component list on the server with Openui

Use the framework-agnostic core to build system prompts on a backend or Edge function.

Short answer: In your backend project, run npm install @openuidev/lang-core; then Define the component library you want the model to use, with Zod schemas for props; call the lang-core prompt-generation function with that library in your server route and check the returned text. All steps.

Who it is forA backend or platform engineer whose model calls run on a server or Edge runtime and who needs prompts that match an allowed component set.

The problemThe model can generate any UI unless the prompt limits it to a defined set of components, and that prompt must be kept in sync with the code that renders it.

The outcomeA server-side step that produces a system prompt from your component library, so model output stays within the components you register.

What you need first

  • Node.js with npm and npx, since the README install and scaffold commands use them
  • An LLM provider you can call from your backend, because OpenUI sends a generated system prompt to your model
  • A component library to use or define; the README provides built-in libraries in @openuidev/react-ui

Steps

  1. In your backend project, run npm install @openuidev/lang-core
  2. Define the component library you want the model to use, with Zod schemas for props.
  3. Call the lang-core prompt-generation function with that library in your server route and check the returned text. (inferred, check the README)
  4. Pass the generated prompt to your model request and stream the response back to the client.
  5. Confirm that a model reply uses only components from your library.

Prompt for your agent

Using the thesysdev/openui repo, add @openuidev/lang-core to the backend at <target backend path> and generate a system prompt from a component library that has at least two components. Expected output is the prompt text; verify that it lists only the components you defined.

Caveat. The README says lang-core provides prompt generation but does not give the exact function names, so the call step must be confirmed in the package docs.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for thesysdev/openui and "Generate model prompts from a component list on the server"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer