A terminal studio for running our own models, by Crisp Tech.
Lyss loads any model that follows our shared model contract (a folder with a model.json) and lets you write with
it: type the start of something, and the model's continuation streams in as it is written. The first model it runs
is Vrel, our small language model built from scratch.
Type lyss and it opens as its own app inside your terminal: the writing scrolls above, an input box stays
pinned at the bottom, and a status line under it shows the model, its settings and the keys you can use. When you
leave, your terminal is exactly as it was.
Lyss has no dependencies beyond Python. Everything you see is our own code, built on the standard library: the key reading, the line editor, the screen drawing, the colors, boxes, word wrapping and streaming. No UI library or other tool's code is used.
With Vrel 0.2.0 on an RTX 4060, Lyss loads the model in 1.9 to 2.6 s and writes about 100 tokens/s.
When Lyss finds more than one model, it opens on a picker that lists them all with their size, score and what
they were trained on. Pick one with the arrow keys and Enter, and open the picker again any time with /model.
- Python 3.10 or newer
- A terminal that understands ANSI colors (Windows Terminal, the Windows 10+ console, macOS and Linux terminals)
- Whatever the model itself needs (Vrel needs PyTorch)
With pipx, straight from GitHub:
pipx install git+https://github.com/crisptech/lyssOr from a copy of this repository:
pip install .That gives you a lyss command. Open any terminal, type lyss, and you are in the studio. Press Ctrl+C to
leave.
If your terminal says lyss is not recognized, Python's Scripts folder is not on your PATH (pip prints a warning
naming it). pipx installs command-line tools into their own environment and fixes PATH for
you:
pipx install .For working on Lyss itself, pip install -e . keeps the command pointed at your copy of the code.
The quickest way: download a trained Vrel from its
GitHub releases (vrel-0.3.0.zip, 13 MB) or from
Hugging Face, and unzip it into the models folder below. Vrel needs
PyTorch: pip install torch numpy regex.
Lyss looks for model folders in one place on your computer, created the first time it runs:
| System | Models folder |
|---|---|
| Windows | %LOCALAPPDATA%\Lyss\models |
| macOS | ~/Library/Application Support/Lyss/models |
| Linux | ~/.local/share/lyss/models (or $XDG_DATA_HOME/lyss/models) |
lyss --help prints the exact path. You can also point LYSS_MODELS at a folder of models or pass
--models PATH. When you run Lyss from a copy of this repository, it uses the repository's models/ folder
instead.
For Vrel, run its export and copy the result into the models folder:
python -m vrel export # Vrel 0.2, to models/vrel-0.2.0/
python -m vrel export --preset mini # Vrel 0.3, to models/vrel-0.3.0/Both write into the Vrel project's models/ folder. Copy as many models as you like: Lyss lists them all. A model brings its own Python needs: Vrel needs
torch, numpy and regex. If one is missing, Lyss says which one and the pip install line that fixes it.
lyssIf Lyss finds more than one model, it opens on the model picker. Up and Down move, Enter (or a model's number)
loads it, and Esc starts with the newest model. Models Lyss cannot run yet are shown but cannot be picked.
-m NAME starts straight away with that model and skips the picker.
Type the start of something and press Enter. Ctrl+C is the way out:
- While the model is writing, Ctrl+C stops it mid-sentence and keeps what it wrote. You stay in Lyss.
- With something typed in the box, Ctrl+C clears it.
- At an empty prompt, Ctrl+C leaves Lyss.
| Key | What it does |
|---|---|
| Enter | send |
\ then Enter, or Ctrl+J |
new line inside your prompt |
| Up / Down | earlier prompts (or move between lines of a long prompt) |
| Left / Right, Home / End | move the cursor |
| Ctrl+W / Ctrl+U | delete the last word / the line |
/ |
open the command menu; Tab completes the first match |
| Mouse wheel, PgUp / PgDn | scroll back through what was written; Esc jumps to the bottom |
While Lyss is open, the mouse wheel belongs to Lyss. To select text with the mouse, hold Shift while you drag.
lyss --plain runs line by line in your normal scrollback instead, for terminals that do not handle full-screen
apps well. Pipes and -p always use plain output.
| Command | What it does |
|---|---|
/models |
list the models Lyss found |
/model [name or number] |
open the model picker, or switch straight to a model by name or number |
/info |
everything the current model says about itself |
/temp <0-2> |
randomness: low is safe, high is wild (default 0.8) |
/topk <n> |
only pick from the n likeliest next pieces, 0 = no limit (default 50) |
/length <n> |
how many pieces to write each time (default 200) |
/seed <n or off> |
same seed and prompt give the same text |
/settings |
show the current settings |
/again |
write the last prompt again |
/more |
keep writing from where it stopped |
/save [file] |
save the session as a Markdown file |
/clear |
clear the screen |
Command-line options:
-p "text": write once from this prompt and exit (works in scripts and pipes).-m NAME: start with this model (name, "name version", or list number).--list: list the models Lyss can find.--models PATH: another folder to look in (repeatable).--temp,--top-k,--length,--seed: starting settings.--device cpu|cuda: where to run the model, if it supports choosing.--plain: line by line in the normal scrollback instead of full screen.--color auto|always|never: colors are on in a terminal, off in pipes and whenNO_COLORis set.
Run lyss --help for the full list. python -m lyss works too.
A model folder holds a model.json and the model's own Python code:
{
"name": "Vrel",
"version": "0.1.0",
"kind": "text-generator",
"entry": "vrel.generate:load",
"params": 13891584,
"context": 256,
"val_loss": 3.6365,
"weights": "vrel.pt",
"trained_on": "public-domain books from Project Gutenberg"
}entry names a function that takes the folder and returns an object with
generate(prompt, max_tokens, temperature, top_k, seed, on_token, should_stop). on_token is called with each
piece of text as it is written. name, version, kind and entry are required; the rest are shown on the model
card and in the picker when present. The picker shows the size of the weights file (or of the whole folder). Two models may ship packages with the same name; Lyss keeps them apart.
python -m pytest -qMIT, see LICENSE.

