Install locally:
pip install -e .
Create and render a UI (Python):
from gen_ui_lang import genui, row, text, btn, chart, to_html
n = genui(
row(text("Sales Overview"), btn("Load")),
chart(type="line", data="sales_q4"),
)
print(to_html(n)) # quick HTML preview
Run a demo server:
python examples/demo_server.py
Run the chatbot UI (calls an LLM if configured):
python examples/chat_server.py
Notes:
examples/ require additional packages like fastapi and uvicorn (and tiktoken for the chat UI).get_response(...), set OPENAI_API_KEY and OPENAI_MODEL in your environment (a .env file is supported).Gen-UI-Lang sits at the sweet spot between human-readable code and a machine-actionable code. It's small enough to iterate with and structured enough to transform programmatically — ideal for prototypes, demos, and LLM-driven Generative UI workflows.
Elevator pitch Describe a UI in a single expression and render it to multiple targets. Example:
genui(
row(
text("Sales Overview"),
btn("Load", on_load=lambda: get_graph(2001, 2002))
),
chart(type="line", data="sales_q4"),
)
This expression is an AST built from Node factories (genui, row, text, btn, chart) that can be converted to HTML or other formats using the included renderers.
Core strengths
genui, row, col, card, text, btn, input, table, graph/chart), making UIs expressive and compact.Node objects (see gen_ui_lang/core.py), so adding nodes or renderers is straightforward.gen_ui_lang/utils/llm_utils.py make it simple to ask an LLM to return ui(...) snippets when available.Key features:
genui, row, col, card, text, btn, input, table, graph/chart.to_html(node) (see gen_ui_lang/core.py).get_response(messages, use_genui=True) to request Gen-UI-Lang formatted replies (see gen_ui_lang/utils/llm_utils.py).Last modified 11 September 2026