Skip to content
Fabrik UI

Introduction

Generative UI SDK for any LLM

Fabrik UI

Generative UI SDK for any LLM. The AI decides what to show — not just say.

Fabrik lets you define React components that the AI can render. When you ask "show me the weather", the LLM calls show_weather_card() and your component renders with real data.

Key Features

  • Generative UI — LLM decides which components to render
  • Any LLM — OpenAI, Anthropic, Google, 53+ via AI SDK
  • Streaming — Text and components stream progressively
  • Elicitation — AI asks follow-up questions inline
  • Artifacts — HTML iframes, code with syntax highlighting
  • Code Diffs — GitHub-style diffs with accept/reject
  • Secure — API keys never leave the server

Quick Example

Create two files to get a working generative UI chat:

Server route

app/api/chat/route.ts
import { aiSdk } from "@fabrik-sdk/ui/ai-sdk"
import { handler } from "@fabrik-sdk/ui/server"
import { google } from "@ai-sdk/google"

export const POST = handler({
  provider: aiSdk({ model: google("gemini-3-flash-preview") })
})

Client page

app/page.tsx
import { Fabrik, Chat } from "@fabrik-sdk/ui/react"
import { server } from "@fabrik-sdk/ui/server"

const provider = server({ url: "/api/chat" })

export default function Page() {
  return (
    <Fabrik provider={provider}>
      <Chat />
    </Fabrik>
  )
}

On this page