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"
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). Part of the vaked constellation β the "cogito" that runs offline.
{n+-1-<β³>} Β· 0+1 Β· the fine touch is quant
Model
| property | value |
|---|---|
| base model | Qwen/Qwen2.5-0.5B |
| quantization | BitNet b1.58 (ternary, {-1,0,+1}) |
| ternary params | 357,826,560 (24 layers Γ 7 tensors) |
| resident size | ~106.6 MiB (codes 89.5 MB + scales 22.4 MB) |
| group size | 64 |
| layers | 24 |
| tensors/layer | 7 β mlp up/gate/down, attn o/q/k/v |
| GQA | 14 q-heads / 2 kv-heads, head_dim 64 |
| RoPE | theta 1e6 |
| RMSNorm | eps 1e-6 |
| activation | SiLU |
| context | 4096 (as base) |
Training
- base: Qwen2.5-0.5B (HuggingFace)
- data:
PeetPedro/ultrawhale-dogfood(2,785 training samples) - hardware: vast.ai RTX 3090 (24 GB), MLX 0.30.0 + mlx-cuda 0.30.0
- 10 epochs (the balanced artifact):
- train loss: 2.7867 (from 7.92)
- val loss: 4.7464
- checkpoint sha256:
834dc60979d6c8b5a6941dcb724a9f1cb40663b0ca97dbcd6037a45e2dc30998 - a 34-epoch run was also completed (train 0.099 / val 6.57) β severe overfit; the 10-epoch checkpoint is the shipped artifact. Honest measurement, not a claim.
Format
Each mNNN.json is one ternary matrix:
{
"name": "model.layers.23.mlp.up_proj",
"dim": 4864, // output rows
"in_features": 896, // input cols
"group_size": 64,
"codes": [/* u32, N*K/16 β 16 two-bit codes per word, LSB-first */],
"scales": [/* f64, N*K/64 β one per group of 64 */],
"seed_hash": "quantal-trained"
}
Codeβvalue: value = (code β 1) Γ scale β code 0 = β1, code 1 = 0, code 2 = +1.
Matmul (reference): dense, activations unquantized β
y[p] = Ξ£_k x[k] Β· (code[p,k] β 1) Β· scale[p, k/64]
Files
index.jsonβ capsule metadata (base_model, checkpoint sha256, loss/val, group_size, per-matrix list)m000.json β¦ m167.jsonβ the 168 ternary matrices
Use
Load in the MLX-QUANT fork (mlx with native ternary quantize):
# (the fork's ayeOS capsule loader)
import mlx.core as mx
# load index.json + matrices, decode codes β ternary weights, matmul as above
Native Rust inference is in development for the entheai harness
(crates/ternary β ayeOS loader + ternary GEMM, 8/8 tests). The offline
"cogito" path: prompt β tokenizer β ternary forward β answer, no network.
Verified
- loss decrease: 7.92 β 2.79 over 10 epochs (monotonic)
- checkpoint: byte-verified against the vast.ai artifact (sha256 above)
- 168 matrices: byte-stable export, code β€ 2, sign balance β 50/50
- export tool: MLX-QUANT fork (mlx 0.32.1.dev, ternary quantize)
- attestal proof:
attestal.proof.v1β see attestal.ai (proof-not-assertion)
Honest limits
- 0.5B-class model, ternary β a cheap offline background thinker, not a primary coder model. Expect plausible-but-simple text.
- The export holds the 24 transformer blocks (357.8M of 494M params); the embedding + norm weights are emitted as sibling assets for the Rust runner.
The constellation
- music.vaked.dev β the living background
- mlxquantlovefrom.com β the ternary love landing
- vision-gallery β¦22 β the art
- proposal.vaked.dev β the plan + logladder
- lovetta lane: sponsor Β· revolut Β· wise
{n+-1-<β³>} Β· 0+1 Β· the fine touch is quant Β· by peterlodri-sec
Model tree for PeetPedro/quantal-ternary
Base model
Qwen/Qwen2.5-0.5B