bots-garden/razorbillpublic Fork
⑂ v1.0.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
tui.md · 155 lines · 8.7 KBmarkdown
Blame HistoryOpen raw

Reference: rzb tui

The screens of rzb tui, their keys and commands, its preferences file, and what it asks the server. Its command-line options are in the command-line reference.

The frame

Row Content
First The tabs F1 Chat F2 Dashboard F3 Models F4 Settings, the current one in reverse video
Last The connection on the left, Ctrl-T next · Ctrl-Q quit on the right when there is room
Between The current screen
Mark in the last row Meaning
… Waiting for the server's first answer
● Connected, in this order: the server's version, the GPU load, the memory pressure (green normal, yellow warning, red critical), the engine's memory in use over its limit, the first loaded model, the server's address. A narrow terminal cuts the end first
○ No server answers; every screen shows the rzb serve command to run (with --config when rzb tui got one)
✕ The server refused the API key (401), or it is on another machine (403 local_only)

Memory and sizes are in GB of 2³⁰ bytes.

Keys of every screen

Key Effect
F1 F2 F3 F4 Chat, Dashboard, Models, Settings
Ctrl-T Next screen
Ctrl-Q Quit
Ctrl-C Stop the answer being generated on the Chat screen; quit otherwise

rzb tui opens on the Dashboard.

Dashboard (F2)

The server's version, uptime and address; the engine's memory as a gauge of active over limit, with cache and peak (not reported by this engine on Linux); the machine on two lines (GPU load, memory pressure and the server's footprint as rzb …; then available memory over installed, compressed memory and swap; each part only when the server can measure it); the loaded models; the last requests.

Models column Content
NAME, KIND, STATE, SIZE The name of the request that loaded it, chat or embedding, loading or loaded, weights on disk
ACTIVITY idle 7s, unloads in 9m 52s (from keep_alive), or busy / busy, 2 waiting
Requests column Content
AGE, REQUEST, STATUS, MODEL Time since it ended, method and path, status, model
TOKENS, CACHED Prompt+completion tokens, prompt tokens reused from the server's cache
TOK/S, TIME Completion tokens over the whole duration (prompt processing included), duration to the last byte
Key Effect
↑ ↓ PgUp PgDn Home End Select a model
u Unload the selected model; the server's answer shows under the requests (a model in use is refused)

Chat (F1)

A streamed conversation with a chat model of the server. Each answer starts with the model's name on a line of its own; the answer follows at the full width. The conversation is kept by rzb tui and resent whole with each message; the server's prompt cache makes that cheap. The model is the first loaded chat model of /v1/models, else the first chat model listed. After each answer: prompt+completion tokens, cached prompt tokens, tokens per second from the first piece to the last.

The reasoning of an answer (shown, or folded into its one line) is drawn in cyan, while it streams too, so it cannot be taken for the answer (default colour), the stats (dim) or an error (red). Each of its lines starts with ⋯, which keeps it apart from the answer without colours (NO_COLOR, colours off in the preferences).

Key Effect
Enter Send the message, or run a command
Esc Stop the answer being generated; what came stays and is part of the conversation
Ctrl-N New conversation (not while an answer is coming)
Ctrl-P Choose the model: ↑ ↓, Enter; Esc closes the list
Ctrl-R Reasoning folded (one line with its length), hidden, shown
PgUp PgDn Scroll the conversation
← → Home End Ctrl-A Ctrl-E Backspace Delete Edit the message
Command Effect
/set <name> <value> Sampling of the next messages: temperature (0–2), top_p (0–1), top_k (≥ 0), min_p (0–1), max_tokens (≥ 1), thinking (on, off, sent as chat_template_kwargs.enable_thinking)
/set <name> Give the setting back to the server's value
/set Show the settings
/clear New conversation
/help The keys and commands

The session starts with the chat: section and the reasoning key of the preferences.

Models (F3)

The MLX models of the Hugging Face cache (the same as rzb models list), read from the disk; downloads in progress; a hint on the selected model.

Column Content
ID The Hugging Face id
KIND From the server's configuration or from the loaded model; - when neither tells
SIZE Disk space
LOADED yes when the server has it in memory
DECLARED AS The configuration's ids that point to it

The hint gives the selected model's size and the server's memory in use over its limit, with more than is free now when the model would not fit beside what is loaded.

Key Effect
↑ ↓ PgUp PgDn Home End Select a model
Enter Open the Chat screen with the selected model, under its declared name when it has one, else its Hugging Face id (embedding models are refused)
p Type a Hugging Face id (org/name), Enter downloads it with the engine of the build (progress shown), Esc cancels
d, Delete Remove the selected model from the disk after y (any other key keeps it). A loaded model is unloaded first; while the server is using it, nothing is removed
r Read the cache again

Settings (F4)

Two sections: the preferences, as a form saved to the preferences file; the server's configuration file, the one given to rzb tui --config, else the one GET /rzb/status reports.

Key Effect
Tab Shift-Tab ↑ ↓ Move between the fields
Enter Check and save the preferences; the first wrong field is named
Esc Undo the changes not saved
Ctrl-O Open the server's file in $VISUAL, else $EDITOR, else vi; on return it is checked like rzb config validate, then the server reloads it
Ctrl-R Reload the server's file as it is

After a reload, the screen lists the models unloaded, those unloaded once idle, and the keys that need a restart of the server. A file with problems is not reloaded: the problems are listed with their lines. A server started without --config has no file.

Saving the preferences applies at once the reasoning display, the chat sampling, the colours and the poll interval; the server URL and the API key variable apply the next time rzb tui starts.

Preferences file (tui.yaml)

~/.config/razorbill/tui.yaml, or the file named by RZB_TUI_PREFERENCES. Every key is optional; a missing file means no preferences. The options of rzb tui win over the file, and the file wins over the server's --config file.

Key Type Default Description
server_url http://… from --config, else http://127.0.0.1:7920 The server
api_key_env string RZB_API_KEY Environment variable holding the API key
reasoning shown, folded, hidden folded How the Chat screen shows reasoning
colors boolean true Colours (NO_COLOR turns them off whatever this says)
poll_interval duration (500ms, 2s) 1s How often GET /rzb/status is asked
chat.temperature number, 0–2 the server's Chat sampling
chat.top_p, chat.min_p number, 0–1 the server's Chat sampling
chat.top_k whole number ≥ 0 the server's Chat sampling
chat.max_tokens whole number ≥ 1 the server's Chat answer limit
chat.thinking boolean the model's Reasoning on or off
server_url: http://127.0.0.1:7920
reasoning: hidden
poll_interval: 2s
chat:
  temperature: 0.7
  max_tokens: 1024

Unknown keys and wrong values are reported together, with their lines, and rzb tui exits with code 2. The Settings screen writes the file with the keys that are set, and a comment line at the top.

What it asks the server

Request When
GET /rzb/status Every poll_interval
GET /v1/models When the Chat screen is first shown, and on Ctrl-P
POST /v1/chat/completions Each message, streamed with stream_options.include_usage
POST /rzb/models/{id}/unload u on the Dashboard, d then y on a loaded model
POST /rzb/config/reload Ctrl-R, and after Ctrl-O

All of them carry Authorization: Bearer <key> when a key is set. The /rzb/ routes only answer the machine running the server.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Reference: rzb tui

> The screens of `rzb tui`, their keys and commands, its preferences file, and what it asks the server. Its command-line options are in the [command-line reference](cli.md#rzb-tui).

## The frame

| Row | Content |
| --- | --- |
| First | The tabs ` F1 Chat  F2 Dashboard  F3 Models  F4 Settings `, the current one in reverse video |
| Last | The connection on the left, `Ctrl-T next · Ctrl-Q quit` on the right when there is room |
| Between | The current screen |

| Mark in the last row | Meaning |
| --- | --- |
| `…` | Waiting for the server's first answer |
| `●` | Connected, in this order: the server's version, the GPU load, the memory pressure (green normal, yellow warning, red critical), the engine's memory in use over its limit, the first loaded model, the server's address. A narrow terminal cuts the end first |
| `○` | No server answers; every screen shows the `rzb serve` command to run (with `--config` when `rzb tui` got one) |
| `✕` | The server refused the API key (401), or it is on another machine (403 `local_only`) |

Memory and sizes are in GB of 2³⁰ bytes.

## Keys of every screen

| Key | Effect |
| --- | --- |
| `F1` `F2` `F3` `F4` | Chat, Dashboard, Models, Settings |
| `Ctrl-T` | Next screen |
| `Ctrl-Q` | Quit |
| `Ctrl-C` | Stop the answer being generated on the Chat screen; quit otherwise |

`rzb tui` opens on the Dashboard.

## Dashboard (F2)

The server's version, uptime and address; the engine's memory as a gauge of active over limit, with cache and peak (`not reported by this engine` on Linux); the machine on two lines (GPU load, memory pressure and the server's footprint as `rzb …`; then available memory over installed, compressed memory and swap; each part only when the server can measure it); the loaded models; the last requests.

| Models column | Content |
| --- | --- |
| `NAME`, `KIND`, `STATE`, `SIZE` | The name of the request that loaded it, `chat` or `embedding`, `loading` or `loaded`, weights on disk |
| `ACTIVITY` | `idle 7s, unloads in 9m 52s` (from `keep_alive`), or `busy` / `busy, 2 waiting` |

| Requests column | Content |
| --- | --- |
| `AGE`, `REQUEST`, `STATUS`, `MODEL` | Time since it ended, method and path, status, model |
| `TOKENS`, `CACHED` | Prompt+completion tokens, prompt tokens reused from the server's cache |
| `TOK/S`, `TIME` | Completion tokens over the whole duration (prompt processing included), duration to the last byte |

| Key | Effect |
| --- | --- |
| `↑` `↓` `PgUp` `PgDn` `Home` `End` | Select a model |
| `u` | Unload the selected model; the server's answer shows under the requests (a model in use is refused) |

## Chat (F1)

A streamed conversation with a chat model of the server. Each answer starts with the model's name on a line of its own; the answer follows at the full width. The conversation is kept by `rzb tui` and resent whole with each message; the server's prompt cache makes that cheap. The model is the first loaded chat model of `/v1/models`, else the first chat model listed. After each answer: prompt+completion tokens, cached prompt tokens, tokens per second from the first piece to the last.

The reasoning of an answer (shown, or folded into its one line) is drawn in cyan, while it streams too, so it cannot be taken for the answer (default colour), the stats (dim) or an error (red). Each of its lines starts with `⋯`, which keeps it apart from the answer without colours (`NO_COLOR`, colours off in the preferences).

| Key | Effect |
| --- | --- |
| `Enter` | Send the message, or run a command |
| `Esc` | Stop the answer being generated; what came stays and is part of the conversation |
| `Ctrl-N` | New conversation (not while an answer is coming) |
| `Ctrl-P` | Choose the model: `↑` `↓`, `Enter`; `Esc` closes the list |
| `Ctrl-R` | Reasoning folded (one line with its length), hidden, shown |
| `PgUp` `PgDn` | Scroll the conversation |
| `←` `→` `Home` `End` `Ctrl-A` `Ctrl-E` `Backspace` `Delete` | Edit the message |

| Command | Effect |
| --- | --- |
| `/set <name> <value>` | Sampling of the next messages: `temperature` (0–2), `top_p` (0–1), `top_k` (≥ 0), `min_p` (0–1), `max_tokens` (≥ 1), `thinking` (`on`, `off`, sent as `chat_template_kwargs.enable_thinking`) |
| `/set <name>` | Give the setting back to the server's value |
| `/set` | Show the settings |
| `/clear` | New conversation |
| `/help` | The keys and commands |

The session starts with the `chat:` section and the `reasoning` key of the preferences.

## Models (F3)

The MLX models of the Hugging Face cache (the same as `rzb models list`), read from the disk; downloads in progress; a hint on the selected model.

| Column | Content |
| --- | --- |
| `ID` | The Hugging Face id |
| `KIND` | From the server's configuration or from the loaded model; `-` when neither tells |
| `SIZE` | Disk space |
| `LOADED` | `yes` when the server has it in memory |
| `DECLARED AS` | The configuration's ids that point to it |

The hint gives the selected model's size and the server's memory in use over its limit, with `more than is free now` when the model would not fit beside what is loaded.

| Key | Effect |
| --- | --- |
| `↑` `↓` `PgUp` `PgDn` `Home` `End` | Select a model |
| `Enter` | Open the Chat screen with the selected model, under its declared name when it has one, else its Hugging Face id (embedding models are refused) |
| `p` | Type a Hugging Face id (`org/name`), `Enter` downloads it with the engine of the build (progress shown), `Esc` cancels |
| `d`, `Delete` | Remove the selected model from the disk after `y` (any other key keeps it). A loaded model is unloaded first; while the server is using it, nothing is removed |
| `r` | Read the cache again |

## Settings (F4)

Two sections: the preferences, as a form saved to the preferences file; the server's configuration file, the one given to `rzb tui --config`, else the one `GET /rzb/status` reports.

| Key | Effect |
| --- | --- |
| `Tab` `Shift-Tab` `↑` `↓` | Move between the fields |
| `Enter` | Check and save the preferences; the first wrong field is named |
| `Esc` | Undo the changes not saved |
| `Ctrl-O` | Open the server's file in `$VISUAL`, else `$EDITOR`, else `vi`; on return it is checked like `rzb config validate`, then the server reloads it |
| `Ctrl-R` | Reload the server's file as it is |

After a reload, the screen lists the models unloaded, those unloaded once idle, and the keys that need a restart of the server. A file with problems is not reloaded: the problems are listed with their lines. A server started without `--config` has no file.

Saving the preferences applies at once the reasoning display, the chat sampling, the colours and the poll interval; the server URL and the API key variable apply the next time `rzb tui` starts.

## Preferences file (tui.yaml)

`~/.config/razorbill/tui.yaml`, or the file named by `RZB_TUI_PREFERENCES`. Every key is optional; a missing file means no preferences. The options of `rzb tui` win over the file, and the file wins over the server's `--config` file.

| Key | Type | Default | Description |
| --- | --- | --- | --- |
| `server_url` | `http://…` | from `--config`, else `http://127.0.0.1:7920` | The server |
| `api_key_env` | string | `RZB_API_KEY` | Environment variable holding the API key |
| `reasoning` | `shown`, `folded`, `hidden` | `folded` | How the Chat screen shows reasoning |
| `colors` | boolean | `true` | Colours (`NO_COLOR` turns them off whatever this says) |
| `poll_interval` | duration (`500ms`, `2s`) | `1s` | How often `GET /rzb/status` is asked |
| `chat.temperature` | number, 0–2 | the server's | Chat sampling |
| `chat.top_p`, `chat.min_p` | number, 0–1 | the server's | Chat sampling |
| `chat.top_k` | whole number ≥ 0 | the server's | Chat sampling |
| `chat.max_tokens` | whole number ≥ 1 | the server's | Chat answer limit |
| `chat.thinking` | boolean | the model's | Reasoning on or off |

```yaml
server_url: http://127.0.0.1:7920
reasoning: hidden
poll_interval: 2s
chat:
  temperature: 0.7
  max_tokens: 1024
```

Unknown keys and wrong values are reported together, with their lines, and `rzb tui` exits with code 2. The Settings screen writes the file with the keys that are set, and a comment line at the top.

## What it asks the server

| Request | When |
| --- | --- |
| [`GET /rzb/status`](http-api.md#get-rzbstatus) | Every `poll_interval` |
| `GET /v1/models` | When the Chat screen is first shown, and on `Ctrl-P` |
| `POST /v1/chat/completions` | Each message, streamed with `stream_options.include_usage` |
| [`POST /rzb/models/{id}/unload`](http-api.md#post-rzbmodelsidunload) | `u` on the Dashboard, `d` then `y` on a loaded model |
| [`POST /rzb/config/reload`](http-api.md#post-rzbconfigreload) | `Ctrl-R`, and after `Ctrl-O` |

All of them carry `Authorization: Bearer <key>` when a key is set. The `/rzb/` routes only answer the machine running the server.