A ~8M parameter causal transformer that talks like a tiny crab in an aquatic world.
Architecture: 6 layers, hidden dim 320, 8 heads, SwiGLU FFN 800, learned positions,
LayerNorm, weight-tied LM head. Vocab 3774 BPE, max sequence 512. See config.json.
Training: SFT for 32,000 steps on 104,200 examples — balanced templates plus ~4,200
hand-written natural paraphrases, with [mode crab] persona-prefixed variants.
The shipped checkpoint is the SFT model; PPO/DPO are optional stages in the repo.
Eval: perplexity 1.931, persona reward ~0.50 (sampling varies). On generated eval rows the 7-way probe scores 0.9998 and the 21-way head 0.9932. On 126 hand-written held-out messages the 7-way probe scores 0.6212 — the honest generalization gap. The tool-routing probe scores 0.725 on 80 hand-authored queries (web improved from 0.15 to 0.65 after adding natural web queries and hard negatives).
best_model.pt: PyTorch checkpoint (model_state_dict + config)config.json: model and training configtokenizer.json: byte-level BPE tokenizermodel.onnx: full-precision ONNX export for the browser UImodel.quant.onnx: uint8 quantized ONNX (~9MB)decision_probe.pt: 7-way intent probe on frozen featuresdecision_tool_probe.pt: 4-way tool-routing probe (math/web/faq/chat)from huggingface_hub import snapshot_download
from tokenizers import Tokenizer
import torch
from hermitlm.training.model import HermitLM
from hermitlm.config import HermitConfig
repo = snapshot_download("darshi1337/hermitlm-8M")
ckpt = torch.load(f"{repo}/best_model.pt", map_location="cpu", weights_only=True)
config = HermitConfig(**ckpt["config"])
model = HermitLM(config)
model.load_state_dict(ckpt["model_state_dict"])
tokenizer = Tokenizer.from_file(f"{repo}/tokenizer.json")
Browser chat uses model.quant.onnx with fallback to model.onnx.
model.onnx 39 MBbest_model.pt 34 MBmodel.quant.onnx 10 MBdecision_probe.pt 42.4 kBdecision_tool_probe.pt 7.7 kB