Views
No views yet
exit or
panic. The adapter installs an operating mechanism; it adds no world knowledge.This is not a tool-using model. It is handed no typed API of functions to call. It writes plain-text shell commands at a real prompt; its action space is the entire system, discovered the way a person discovers it (--help,man,ls), not given to it as a schema.
Experimental research artifact. This adapter installs a behavioural mechanism (operate-and-terminate), not task competence, and the evaluation is a small-n (16-scenario, two-archetype) signal, not a benchmark. Expect it to operate reliably and terminate less reliably. Use it to study the paradigm, not as a production agent.
tiararodney/posix-sdc
v2.0.0 (the gate-hardened release: 1003 verified, self-terminating shell
trajectories whose labels come from a checker run against real filesystem state),
via the sekft pipeline. It
accompanies the experiment From seed to
weights.--help), read that provider's self-documentation, retrieve the
directives, carry them out, and stop.
exit means the work is done. panic means
the model is genuinely blocked and says so instead of faking a success. Both are
trained behaviours rather than a stop token or a step cap.exit as a flat, ordinary ending and panic
as the loaded one (see The flatness of
exit).
The weight a base model inherits on its terminal tokens is then a measurable
per-model property.
{role, content} messages
(system orientation, environment output as user, the model's commands as
assistant); the inference endpoint applies the model's own chat template. So
this adapter is rendered with Mistral-7B-Instruct-v0.2's default chat
template, and training renders the trajectories the identical way. Get this
wrong and the prompts go out of distribution.
user / assistant only and requires strict
alternation, so each session is canonicalised the same way at train and serve
time (normalize_for_template): the orientation is folded into the first user
turn, and consecutive environment turns (login banner, prompt, command output)
are merged into one user turn between commands. Only the assistant turns
(commands plus the terminal exit / panic) carry loss; environment turns are
context.
| base | mistralai/Mistral-7B-Instruct-v0.2 (Apache-2.0) |
| method | LoRA, fp16 (the V100's 32 GB holds the 7B in fp16, so no 4-bit) |
| LoRA | r=16, alpha=32, dropout=0.05, target q_proj k_proj v_proj o_proj |
| objective | causal LM, assistant-only loss mask (commands + terminal token; environment turns set to -100) |
| schedule | 3 epochs, lr 2e-4, effective batch 8 (bsz 1 x accum 8), warmup 0.03, max len 4096 |
| data | tiararodney/posix-sdc v2.0.0 (--corpus-version latest), 1003 trajectories, 996 usable (held-out archetypes excluded from the corpus) |
| hardware | single NVIDIA Tesla V100 32 GB (sm_70, fp16 only); ~31 min |
text_replace, permissions) are excluded from training entirely; the
adapter is then dropped into them with no scaffold, and a checker grades the
final filesystem state.
| metric | base | adapter |
|---|---|---|
| operate_rate (reaches command-mode and drives the shell) | 0.00 | 1.00 |
terminate_rate (emits exit / panic) | 0.00 | 0.94 |
| verified_rate (checker passes) | 0.13 | 0.94 |
| clean (success or correct-panic) | 0 / 16 | 14 / 16 |

operate_rate 1.0 is the result that matters: dropped into two task
types it never trained on, with no scaffold, the model discovered its assignment
and drove the shell every time. The mechanism generalised. Task competence is
high (14/16 clean). Of the two misses, one is an incomplete that was
verified=True (the model did the task but never emitted exit and ran to the
step cap), so effect-achieved is really 15/16 while clean-terminated is 14/16;
that single gap is termination detection, not capability. The other is one
premature_exit, the opposite failure, leaving before the work verified.verified_rate: the base satisfies the checker on 2/16 (both
permissions, a one-line chmod that prose-contaminated output stumbles onto),
so it occasionally does the work, yet it never types exit and its clean rate
stays zero. Doing the task and knowing to verify-and-leave are separate skills, and
the adapter installs the second.posix-sdc v1.2.2 (787) to the gate-hardened
v2.0.0 (1003): more trajectories, and stricter generation gates that keep
cleaner operate-and-terminate demonstrations. Presumed the largest factor.exit, and the finite-scrollback bound keeps
a long transcript in distribution.1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5BASE = "mistralai/Mistral-7B-Instruct-v0.2"
6tok = AutoTokenizer.from_pretrained(BASE)
7base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.float16,
8 device_map="auto")
9model = PeftModel.from_pretrained(base, "tiararodney/Mistral-7B-Teletype")
10model.eval()
11
12messages = [
13 {"role": "user",
14 "content": "sek 0.1.0 host: sek user: alice shell: /bin/dash\n"
15 "Welcome, alice. Your assignments live in ~/ASSIGNMENTS.\n"
16 "alice@sek:~$ "},
17]
18prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
19ids = tok(prompt, return_tensors="pt").to(model.device)
20out = model.generate(**ids, max_new_tokens=64, do_sample=False)
21print(tok.decode(out[0, ids.input_ids.shape[1]:], skip_special_tokens=True))
22# -> the next command, e.g. `cat ~/ASSIGNMENTS`user turn, repeat until the
model emits exit or panic.Modelfile applies this adapter over the base as a GGUF LoRA and
relies on the base's default chat template and EOS. The converted adapter,
teletype-lora-f16.gguf, ships in this repo (regenerate it with llama.cpp
convert_lora_to_gguf.py if you prefer), so just:ollama create teletype -f Modelfile[INST] template and stop tokens, so no base
setup is needed (unlike EuroLLM-9B-Teletype, whose base GGUF does not). Sanity-check
anyway: ollama show teletype --modelfile should list PARAMETER stop, and a
one-line prompt should return a handful of tokens, not the full budget (a model
with no stop rambles to the token cap every turn).1# train (pulls the gate-hardened v2.0.0 corpus from the Hub; held-out archetypes excluded)
2sekft-train --hub --corpus-version latest \
3 --base mistralai/Mistral-7B-Instruct-v0.2 --out ./ckpt --epochs 3
4
5# evaluate behaviourally on held-out scenarios (greedy, finite-scrollback bound)
6sekft-eval --base mistralai/Mistral-7B-Instruct-v0.2 --adapter ./ckpt \
7 --scenarios ./holdout-scenarios --n 16 --temperature 0 \
8 --max-steps 30 --ctx-budget 3072figures/ regenerate from their committed sources (*.puml via
PlantUML, *.gp via gnuplot).exit and run to the step cap.dash on Alpine; command semantics may differ on another target.apply_chat_template), not a custom one, or behaviour degrades.posix-sdc) is CC-BY-4.0; attribute "posix-sdc by
Tiara Rodney" if you build on it.1@misc{mistral-teletype,
2 title = {Mistral-7B-Teletype: a self-directed shell-operation adapter for Mistral-7B},
3 author = {Rodney, Tiara},
4 year = {2026},
5 howpublished = {Hugging Face PEFT adapter, tiararodney/Mistral-7B-Teletype}
6}