Skip to content
domuk-kPublic

About

Open-source generative UI pipeline — stream LLM-generated rich UI via an XML-DSL protocol. BYOK, framework-agnostic. Inspired by Thesys C1.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

c0

CI npm license

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"


Packages

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

Quick start

git clone https://github.com/domuk-k/c0 && cd c0
pnpm install
pnpm -r build

Playground

cd apps/playground
cp .env.local.example .env.local   # LLM_API_KEY, LLM_MODEL
pnpm dev

Open the dev server and watch XML-DSL stream into live UI components.


How it works

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.

Weak-model support

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 });

When to use c0

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)

Monorepo layout

packages/
  protocol/     # parse + repair
  server/       # prompts + OpenAI adapter
  react/        # UI components
apps/
  playground/   # local demo

Develop

pnpm install
pnpm -r build
pnpm test
pnpm lint

Related

Part of domuk-k's agent UI stack — pairs with oh-my-workflow for orchestration and pubifact for publishing artifacts.

License

MIT

About

Open-source generative UI pipeline — stream LLM-generated rich UI via an XML-DSL protocol. BYOK, framework-agnostic. Inspired by Thesys C1.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages