Instructions to use PeetPedro/quantal-ternary with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use PeetPedro/quantal-ternary with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("PeetPedro/quantal-ternary") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use PeetPedro/quantal-ternary with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "PeetPedro/quantal-ternary" --prompt "Once upon a time"
- Atomic Chat
quantal-ternary
A BitNet b1.58 ternary model β Qwen/Qwen2.5-0.5B, continued-trained and quantized to {-1, 0, +1} weights. Exported as 168 ayeOS ternary matrices (24 layers Γ 7 tensors) plus the runtime assets (token embeddings + RMSNorm vectors). Part of the vaked constellation β the "cogito" that runs offline in Rust.
Model
| Base model | Qwen/Qwen2.5-0.5B |
| Quantization | weight-quant-only ternary {-1,0,+1} (group size 64) |
| Matrices | 168 ayeOS per-layer files (m000.json β¦ m167.json) |
| Runtime assets | embeddings.f16 [151936, 896], norms.f32 [49, 896] |
| Training | continued-train, masked CE, deployed-forward QAT |
| Validation (masked, n=90) | 1.6998 |
| Checkpoint sha256 | 2d54a10f9dbda3502a2914375d97a7bd13e1f7d30728b17508bc011879825c4c |
Training
- Data: 7,000 text samples (konstellation corpus: kompress + domain + c3, same-period as the base), stratified 90-sample held-out val.
- Loss: masked cross-entropy β pad tokens (id 0) weighted out, honest mean over valid tokens. Dynamic per-batch padding bucketed to multiples of 64.
- Optimizer: AdamW, weight decay 0.1, grad clip off, lr 3e-4 β cosine β 3e-5 (2% warmup), early stop patience 5 / min-delta 0.05, 40-epoch cap.
- Hardware: vast.ai L40 (44 GB) β "ULTRA LOVEGOD MODE" run, B8/256.
- Forward: deployed-forward QAT β the exact forward the Rust runner uses (weight-quant-only BitLinear, per-projection RMSNorm + activation quant skipped), so training β‘ inference.
- Val trajectory (ULTRA run): 2.71 β 2.22 β 1.98 β 1.83 β 1.70 β 1.69 β 1.70 (plateau) β best 1.6998 at epoch 5. Prior night's run (2,785 samples, masked val 3.2862) was superseded; the old artifact measured 11.34.
Layout
m000.json β¦ m167.json 168 ternary matrices (packed codes + per-group scales)
index.json capsule metadata + file manifest (sha256, shapes)
embeddings.f16 token embedding matrix, BF16βFP16, [151936, 896]
norms.f32 49 RMSNorm gain vectors (24Γ2 + final), [49, 896]
norms.f32 row ordering: row 2i = layer i input_layernorm, row 2i+1 =
layer i post_attention_layernorm, row 48 = final model.norm.weight.
Runtime
Consumed by the entheai Rust ternary runner (crates/ternary) and the
pocoo.vaked.dev/demos/quantal live viewer. The same export tooling
(export_quantal_checkpoint.py + export_quantal_assets.py) produced this
repo from the winning checkpoint.
Part of the vaked constellation β sovereign, offline, fine.
Quantized
Model tree for PeetPedro/quantal-ternary
Base model
Qwen/Qwen2.5-0.5B