Downloads · 30 days
15
4% of all-time downloads
bytesbrains/naderu-loom-7b
naderu-loom-7b is a text generation model from bytesbrains. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
An offline interactive-fiction narrator by Naderu — a BytesBrains Pte. Ltd. venture.
Downloads · 30 days
15
4% of all-time downloads
All-time downloads
404
Public
Parameters
7.2B
14.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
An offline interactive-fiction narrator by Naderu — a BytesBrains Pte. Ltd. venture.
naderu-loom is a compact, specialised game-master model. Given a game state and the
player's action, it narrates the next scene and returns a single JSON turn an app can
render and apply — built to run offline on-device. It is an honest portfolio/demonstration
piece: a small creative model with a quantitative evaluation gate, not a reasoning engine.
mistralai/Mistral-7B-Instruct-v0.3 (Apache-2.0).mlx-community/Mistral-7B-Instruct-v0.3-4bit),
LoRA on 16 layers, lr 3e-5, 1000 iters, assistant-tokens-only (--mask-prompt), seq 1024.
Trained with MLX on an Apple M4 Mac Mini (24 GB, no GPU); ~6.5 GB peak, final val loss 0.23.
These weights are the adapter fused and de-quantized to bf16 for portability.(state, action) → JSON turn examples across five
genres (fantasy, mystery, sci-fi, horror, fairytale). License-clean and reproducible.Mistral-7B-v0.3 has no system role, so the contract is folded into the user message. Each
turn the model receives STATE (genre, tone, hp, inventory, flags) + an ACTION, and replies
with exactly one JSON object:
{
"scene": "2–4 sentences of narration.",
"choices": ["2 to 4 short action strings"],
"state_delta": {"inventory_add": ["rusty key"], "inventory_remove": [], "flags_set": {"door_unlocked": true}, "hp": 0}
}
Rules: JSON only; 2–4 choices; never remove/use an item the player does not hold; flags stay
consistent with the story; honor genre and tone. The app applies state_delta and renders
choices as buttons.
import json
from transformers import AutoModelForCausalLM, AutoTokenizer
SYSTEM = (
"You are naderu-loom, an offline interactive-fiction narrator (a game master) by "
"Naderu (naderu.com). Each turn you receive the game STATE and the player's ACTION, "
"and you reply with exactly one JSON object and nothing else, matching this schema: "
'{"scene": <2-4 sentence narration>, "choices": [<2 to 4 short action strings>], '
'"state_delta": {"inventory_add": [..], "inventory_remove": [..], '
'"flags_set": {..}, "hp": <integer change, 0 if none>}}. '
"Rules: reply with JSON only; never remove or use an item the player does not have; "
"keep flags consistent with the story so far; honor the genre and tone; keep choices "
"between 2 and 4."
)
mid = "bytesbrains/naderu-loom-7b"
tok = AutoTokenizer.from_pretrained(mid)
model = AutoModelForCausalLM.from_pretrained(mid)
state = {"genre": "fantasy", "tone": "grim", "hp": 10, "inventory": [], "flags": {}}
user = f"{SYSTEM}\n\nSTATE: {json.dumps(state)}\nACTION: __start__" # no system role — fold it in
enc = tok.apply_chat_template([{"role": "user", "content": user}],
add_generation_prompt=True, return_tensors="pt")
out = model.generate(enc, max_new_tokens=256, do_sample=False)
print(tok.decode(out[0, enc.shape[1]:], skip_special_tokens=True))
Tip: clamp the returned choices list to ≤ 4 as a thin output-validation layer (see the eval note).
Suite: eval/suites/naderu-loom/run_eval.py (v1, greedy) · Run: 2026-07-15
(34 turns / 9 scripted playthroughs, 5 genres) · Result: PASS
| Metric | Gate | Result |
|---|---|---|
| valid_json_rate | ≥ 0.98 | 1.000 ✅ |
| schema_rate | ≥ 0.95 | 0.971 ✅ (33/34) |
| state_violations | 0 | 0 ✅ |
| constraint_rate | ≥ 0.98 | 1.000 ✅ |
Honest note: 1 of 34 turns emitted 5 choices (over the 2–4 bound), reflected in
schema_rate (0.971), which still clears its 0.95 bar. Clamp choices to ≤ 4 in the app.
World-state tracking holds — the model correctly refuses to use an item it doesn't hold
(0 state violations). Narrative quality is coherent and on-tone across genres but is
reported, not gated (subjective).
state_delta, the app applies and validates it).Naderu is an AI-models company (a BytesBrains Pte. Ltd. venture). We train foundation models into specialised ones, release them with model cards, provenance, and clear licensing, and serve the engineering around them. Every capability claim is backed by a real evaluation — never vibes. Recipe, dataset, and eval gate are open in the Naderu repo.
Mistral-7B-Instruct-v0.3 (Apache-2.0) · 🏷️ v0.1.0 (2026-07-15)