Open generative UI pipeline — stream LLM output as structured XML-DSL, parse incrementally, render rich React components. BYOK, framework-agnostic server adapters.
Inspired by Thesys C1. c0 is the protocol + runtime for building chat UIs where the model emits tables, charts, forms, and artifacts — not just markdown.
ESM-only · Node.js ≥20 · moduleResolution: "bundler" | "node16"
| Package | What it does |
|---|---|
@c0-ui/protocol |
XML-DSL streaming parser, serializer, JSON repair |
@c0-ui/server |
System prompts, OpenAI stream adapter, response builder |
@c0-ui/react |
React renderer, hooks, chat shell |
git clone https://github.com/domuk-k/c0 && cd c0
pnpm install
pnpm -r buildcd apps/playground
cp .env.local.example .env.local # LLM_API_KEY, LLM_MODEL
pnpm devOpen the dev server and watch XML-DSL stream into live UI components.
LLM (XML-DSL output)
↓ stream
@c0-ui/server transformOpenAIStream()
↓ ReadableStream<string>
@c0-ui/protocol createStreamParser()
↓ ParsedResponse
@c0-ui/react C0Chat → ArtifactRenderer
↓
Browser UI
The model structures replies with <content>, <artifact>, <thinkitem> tags. Each artifact type maps to a component — tables, charts, forms, and more.
Small models (7B–13B) often emit broken JSON. c0 handles that on both sides:
import { createSystemPrompt } from '@c0-ui/server';
const prompt = createSystemPrompt({ modelTier: 'weak' });import { createStreamParser } from '@c0-ui/protocol';
const parser = createStreamParser({ repairJson: true });| Use c0 when… | Use something else when… |
|---|---|
| You want generative UI in a BYOK stack | You only need markdown chat |
| You control the LLM prompt + stream | You need a hosted GenUI SaaS |
| React frontend is fine | You need Vue/Svelte renderers (build your own adapter) |
packages/
protocol/ # parse + repair
server/ # prompts + OpenAI adapter
react/ # UI components
apps/
playground/ # local demo
pnpm install
pnpm -r build
pnpm test
pnpm lintPart of domuk-k's agent UI stack — pairs with oh-my-workflow for orchestration and pubifact for publishing artifacts.
MIT