kenoma
A shell powered by raw LLM completion. You type commands at your own prompt; a base model hallucinates what they print. Nothing is executed.
kenoma captures your real prompt and seeds the model with your terminal (tmux scrollback, or your shell history), so the fake session starts out looking like yours. Every output is one sample of many, and kenoma keeps them all as a tree you can re-roll, rewind and branch, loom-style.
Install
pip install kenoma
On Apple silicon the model runs locally with MLX. Elsewhere, kenoma talks to any OpenAI-compatible completion server (see Using a server).
Usage
kenoma # Qwen/Qwen3.5-4B-Base, quantized to 4 bits at load
kenoma Qwen/Qwen3.5-2B-Base # about twice as fast, a little less convincing
kenoma /path/to/local/model
Use a base (pretrained) model. Instruction-tuned models answer you instead of playing a terminal.
| Key | |
|---|---|
| Enter | run the command |
| → or Ctrl-E | accept the gray suggestion (the model's guess at what you'll type next) |
| Alt-r | re-roll: run the last command again for a different output |
| Alt-← / Alt-→ | previous / next alternative output of the last command |
| Alt-↑ / Alt-↓ | step back a turn / forward again. Typing after stepping back starts a branch. |
| Alt-t | tree explorer: browse every branch and jump anywhere |
| Ctrl-C | interrupt the running command (or clear the line) |
| Ctrl-D | exit |
Alt is Option on a Mac keyboard ("Use Option as Meta key" in Terminal.app, "Esc+" in iTerm2), or press Esc and then the key.
On an M5 Max the default model streams about 140 tokens a second, and a command that prints nothing gets its prompt back in about a tenth of a second.
Using a server
kenoma --url http://localhost:8000
Any server with a streaming /v1/completions endpoint works: vLLM, SGLang, llama.cpp's llama-server, or mlx_lm.server. kenoma uses the first model the server lists, or the one you name (kenoma --url ... <model>; mlx_lm.server lists every cached model, so name it there). Your seed transcript (scrollback or history) is sent to that server.
Configuration
By precedence: CLI flags, then KENOMA_* environment variables, then a TOML file at $XDG_CONFIG_HOME/kenoma/config.toml (falls back to ~/.config/kenoma/config.toml).
model = "Qwen/Qwen3.5-4B-Base"
bits = 4
temperature = 1.0
top_p = 0.95
max_new_tokens = 2048
context_tokens = 16384
history = 20
tmux_lines = 300
ghost = true
The environment variable for any key is KENOMA_<KEY> uppercased, so KENOMA_MODEL=Qwen/Qwen3.5-2B-Base kenoma works.
--url URL,--api-key KEY: use a completion server instead of the local engine.--bits {3,4,5,6,8,16}: quantize the local model's weights at load (16 keeps them as they are; already-quantized checkpoints are left alone).--prompt STR: use this prompt instead of your renderedPS1.--history N: without tmux, seed with your last N shell commands (0 disables).--tmux-lines N: inside tmux, seed with the last N lines of the pane (0 disables).--context-tokens N: transcript budget; past it, the oldest turns are dropped down to half.--max-new-tokens N: per-command cap on generated tokens.--no-ghost: don't show the model's guess at your next command.
License
GPL-3.0-or-later. See LICENSE.
Metadata
Release files for kenoma 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kenoma-2.0.0.tar.gz | 53.6 kB | With provenance | Details for kenoma-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kenoma-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for kenoma-2.0.0-py3-none-any.whl |
Total release size: 93.7 kB
Release files / kenoma-2.0.0.tar.gz
| Download URL | kenoma-2.0.0.tar.gz |
|---|---|
| Size | 53.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e5ed6b2e476e077ce18c03c7a0d0b2189a16d26a8cf839c8174d5f9b6415420
|
|
BLAKE2b-256 checksum How to use checksums |
940cd6e65144ce7cd352f7debc9aca070f1028c93bc98e9be298f100179b6ca4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / kenoma-2.0.0-py3-none-any.whl
| Download URL | kenoma-2.0.0-py3-none-any.whl |
|---|---|
| Size | 40.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4d8d876d5291f995d2eb27e9a2af108ce394327c0896c7b0a9f6ccfe8713619
|
|
BLAKE2b-256 checksum How to use checksums |
56db36956915e19f2583d7a514af8131b1b2b48807f2fa3a38c349728cc051c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logSecurity for kenoma 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for kenoma-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.