Skip to content

coli tui: colibri's chat in the terminal, one C file, with the chat page's monitor and mascot - #2532

Merged
JustVugg merged 4 commits into
devfrom
feat/tui
Nov 1, 2026
Merged

JustVugg merged 4 commits into
devfrom
feat/tui

Conversation

@JustVugg

Copy link
Copy Markdown
Owner

colibri's chat in a terminal: coli tui, one C file with no libraries (c/tui.c), a client of coli serve. Tried live on Qwen3.8-Flash-Next (CUDA chain, RTX PRO 4000, 256K context) through coli serve.

the terminal UI on Qwen3.8-Flash-Next

What it does

  • The chat: the conversations on the left (tab, arrows; delete removes one after a confirmation), the answer streamed from /v1/chat/completions with its markdown drawn and the reasoning folded (ctrl+r), its tokens, tok/s and seconds.
  • The monitor (F2): the chat page's Overview and Profiling, from /health and /profile, plus the GPU and its VRAM.
  • The expert map (ctrl+e): from /experts, the live steps where the engine publishes them, else the experts the last turn used (the HITS bitmap).
  • The mascot: the chat page's, its 19 poses generated from ui/index.html (c/tools/make_tui_mascot.py), with the page's moves and timings (it reads, leans, flies and cheers with the model; sleeps after 90 s; click, double click, drag). A 60 x 60 sixel picture where the terminal answers that it draws sixel (Windows Terminal 1.22+, foot, WezTerm), half blocks elsewhere.
  • The screen is a grid of cells in 24-bit colour, only the changed cells sent, inside one synchronized update; the keyboard and mouse are read raw (VT on POSIX, console records on Windows).
  • With no server answering it plays a demo that says so (--demo forces it). The demo has no tool runs and no System One card: the live client has neither yet.

Around it

  • make colibri-tui (Linux, macOS, Windows/MSYS2 UCRT64; -lws2_32 -static there), its version from version.py.
  • coli tui attaches to a running server (--attach URL, else 127.0.0.1:8000) or starts one for --model, the server's log in the temp directory; --api-key / COLI_API_KEY.
  • Release: built in a step of its own (it is not an engine, none of their flags apply), packed next to coli, and the verify step runs colibri-tui --version from the unpacked archive.
  • /health reports the NVIDIA cards (system.gpus: use, memory, temperature, power), from nvidia-smi at most once a second; nothing, and no second look, where there is none.
  • Docs: docs/tui.md, a section in each of the seven READMEs, pictures in docs/media/tui/. Qwen3.8's long-context table measured again on 2.1.0 the same way (bench_serve.py, 452-token prompt, 128 tokens, better of two): 65,536 tokens 208 / 52.2 tok/s, 131,072 190 / 51.9, 262,144 151 / 42.9.

Tests

  • tests/test_tui.py: it builds with -Werror; the demo draws and quits, giving the terminal its screen back; against a fake server it streams the answer, sends the conversation, the model and the bearer key on every request, and shows /health's GPU in the monitor.
  • tests/test_health_gpus.py: the GPU block from a fake nvidia-smi, and none without it.
  • test_family_registry: coli tui checks the family's gateway adapter like tune, chat and serve (four checks).
  • make -C c check on Linux: 3008 tests OK. Windows: built with MSYS2 UCRT64 gcc and -Werror, --version runs.

system.gpus: each card's name, use, memory, temperature and power, from
nvidia-smi at most once a second, for the monitors that poll /health every
second or two. A machine without nvidia-smi gets no block and no second look.
c/tui.c, one C file with no libraries: a grid of cells in 24-bit colour sent
as a diff inside one synchronized update, the keyboard and the mouse read raw
(VT on POSIX terminals, console records on Windows). It talks to coli serve as
the chat page does: the answer streamed from /v1/chat/completions with its
reasoning folded, the monitor from /health and /profile (the page's Overview
and Profiling, plus the GPU), the expert map from /experts. The chat page's
hummingbird, its poses generated from ui/index.html (tools/make_tui_mascot.py)
and its moves and timings, drawn as a sixel picture where the terminal says it
can, in half blocks elsewhere. With no server it plays a demo that says so.

`make colibri-tui` builds it everywhere; `coli tui` attaches to a running
server or starts one for --model, its log in a file; the release archives
carry it next to coli and the verify step runs it. Tests: it builds with
-Werror, the demo draws and quits, and against a fake server it streams,
sends the conversation and the API key, and shows /health in the monitor.
docs/tui.md and a section in each README, pictures of the TUI on Qwen3.8-Flash-
Next through coli serve. The long-context table measured again on v2.1.0 the
same way (bench_serve.py, 452-token prompt, 128 tokens, better of two):
65,536 tokens 208 / 52.2 tok/s, 131,072 190 / 51.9, 262,144 151 / 42.9.
…heck

The release's engine loop is read by test_family_registry as engine names
([a-z0-9_]); the TUI is not an engine and builds in a step of its own, with
none of the engines' ARCH or GPU flags. coli tui starts the gateway, so it
checks the family's adapter like tune, chat and serve: four checks, not three.
@JustVugg
JustVugg merged commit b9a0c24 into dev Nov 1, 2026
128 of 129 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant