clef-flash-ternary-mlx is an open-weight model from Lo, released under Apache License 2.0. It has 1.6B parameters and a 262,144-token context. At 16-bit it needs about 3.7 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index. It draws 30 downloads a month.
Version v2.0 (2026-10-08). main is this build. Version v1.0 (T-cloq16, 2026-10-06) stays on the v1.0 tag. Unofficial post-training quantization of Cloudflare/clef-flash (revision 17f0b0ad64efb65d273590632833508766b2aae6).
Runs On
What it takes to serve clef-flash-ternary-mlx (1.6B parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.
| Precision | Weights | Memory needed | Cheapest setup | Per hour | Also fits |
|---|---|---|---|---|---|
| 16-bit | 3.1 GB | 3.7 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 8-bit | 1.6 GB | 1.9 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 4-bit | 0.8 GB | 0.9 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Oct 19, 2026.
clef-flash-ternary-mlx on every accelerator the SAVRN Index prices, at every precision
Model Card
By Lo, published under apache-2.0, revision 2d9e93a5972b.
Version v2.0 (2026-10-08). main is this build. Version v1.0 (T-cloq16, 2026-10-06) stays on the v1.0 tag. Unofficial post-training quantization of Cloudflare/clef-flash (revision 17f0b0ad64efb65d273590632833508766b2aae6). This is not an official Cloudflare release and is not endorsed by Cloudflare or the Qwen team. Licensed Apache-2.0 like the original (see LICENSE, NOTICE.md for the changes). Text-only package: the vision tower is removed. The separate vision repo is unchanged. Paired cluster bootstrap of accuracy, v2.0 − v1.0, 10,000 resamples, seed 1234, 95% percentile CI, clusters = (source, group) within source. Same items, same order, existing per-question rows (no re-run). - Backbone…
Read Lo's full model card
Clef-Flash mixed-bit (measured-KL, text-only)
Version v2.0 (2026-10-08). main is this build. Version v1.0 (T-cloq16, 2026-10-06) stays on the v1.0 tag.
Unofficial post-training quantization of Cloudflare/clef-flash
(revision 17f0b0ad64efb65d273590632833508766b2aae6). This is not an official Cloudflare release and is not endorsed by Cloudflare or the Qwen team.
Licensed Apache-2.0 like the original (see LICENSE, NOTICE.md for the changes).
Text-only package: the vision tower is removed. The separate vision repo is unchanged.
Versions
| version | method | packed text | decision-v7 acc (% of bf16 0.8861) | transfer-v9 acc (% of bf16 0.8011) | how to load |
|---|---|---|---|---|---|
v2.0 (this, main) |
measured-KL mixed-bit GPTQ | 3.13 GB | 0.8766 (98.9%) | 0.7361 (91.9%) | snapshot_download("Jakevin/clef-flash-ternary-mlx") |
| v1.0 | T-cloq16 (ternary + 4-bit + rank-16 CLoQ) | 3.13 GB | 0.8497 (95.9%) | 0.6788 (84.7%) | snapshot_download("Jakevin/clef-flash-ternary-mlx", revision="v1.0") |
Paired cluster bootstrap of accuracy, v2.0 − v1.0, 10,000 resamples, seed 1234, 95% percentile CI, clusters = (source, group) within source. Same items, same order, existing per-question rows (no re-run).
| suite | n (clean) | Δ acc | 95% CI | v2-only correct | v1-only correct |
|---|---|---|---|---|---|
| decision-v7 | 1264 | +0.0269 | [+0.0127, +0.0427] | 59 | 25 |
| transfer-v9 | 1046 | +0.0574 | [+0.0344, +0.0803] | 105 | 45 |
What changed (v2.0)
- Backbone (Qwen3.5-9B text model, 32 layers: 24 Gated DeltaNet + 8 gated attention): GPTQ post-training quantization, layer-sequential, 128 calibration records (seed 1234). Per-module bit-width is chosen by a knapsack on measured output KL under a packed-file byte budget matching v1.0's 3.13 GB text size. Allocation b31: 81 binary, 34 ternary, 63 3-bit, 22 4-bit modules (200 linears). No CLoQ.
- Token embedding and lm_head: 4-bit affine (group 64), same as v1.0. The joint-schema head only reads lm_head rows of the option tokens.
- Unchanged (release bytes): joint-schema head, norms, DeltaNet conv / A_log / dt_bias / in_proj_a / in_proj_b, tokenizer,
joint_schema_model.py. - Format
clef-mkl-v1(model.safetensors): binary 8 codes/byte + bf16 scale; ternary 5 trits/byte + bf16 scale; 3-bit bitstream + bf16 scale/bias; 4-bit two codes/byte + bf16 scale/bias; group 64. Seepacked_format.py. Runs on Apple Silicon with MLX (binary and ternary as 2-bitQuantizedLinear, 3-bit and 4-bit native).
Size
| bytes | |
|---|---|
model.safetensors |
3.13 GB |
| whole folder (incl. 0.24 GB head, tokenizer, code) | 3.39 GB |
| original bf16 release | 19.06 GB (18.82 GB shards + 0.24 GB head) |
Retained capability (text, measured on Apple M4 Pro with this exact runtime; bf16 release scored the same way)
| suite (dev) | clean questions | bf16 release acc | this model acc | % retained | Brier bf16 → this | KL(bf16‖this) |
|---|---|---|---|---|---|---|
| decision-v7 | 1264 | 0.8861 | 0.8766 | 98.9% | 0.1694 → 0.1838 | 0.056 |
| transfer-v9 | 1046 | 0.8011 | 0.7361 | 91.9% | 0.2873 → 0.3633 | 0.188 |
Retention depends on the task mix. decision-v7 (whose calibration partition was used for quantization) is the in-distribution number. transfer-v9 is the out-of-distribution check.
Accuracy is on the clean questions of the author's private frozen eval suites (kev; development splits); these are not the card's Decision Index / Typesafe benchmarks.
Use
Requires mlx, mlx-lm (tested 0.31.3 / 0.32.2), torch, transformers, safetensors.
import sys
from huggingface_hub import snapshot_download
pkg = snapshot_download("Jakevin/clef-flash-ternary-mlx") # main = v2.0; or a local folder
sys.path.insert(0, pkg)
import torch
from transformers import AutoTokenizer
from clef_stream import text_args, Head, encode_record, forward_logits
from packed_format import PackedBackbone
bb = PackedBackbone(f"{pkg}/model.safetensors", text_args(pkg)) # ~5.5 GB peak
head = Head(pkg, None, bb.lm_head_q)
tok = AutoTokenizer.from_pretrained(pkg)
record = {"state": "Our checkout started returning errors and orders are blocked.",
"questions": {"urgency": {"type": "score", "criteria": ["Can wait", "This week", "Today"]},
"outage": {"type": "noul", "instructions": "Is a service down?"}}}
enc = encode_record(tok, record)
zs = forward_logits([enc], bb.embed, bb, bb.norm, head, modes=("q4",))["q4"][0]
print({q.question_id: dict(zip(q.option_ids, torch.softmax(z, -1).tolist())) for q, z in zip(enc.questions, zs)})
To load v1.0 instead:
from huggingface_hub import snapshot_download
pkg = snapshot_download("Jakevin/clef-flash-ternary-mlx", revision="v1.0")
Limitations
- Quantization is post-training only (no recovery training). Calibration used 128 records from kev's decision-v7 calibration partition only (one seed, 1234).
- The KL reference for the allocation was an 8-bit copy of every decoder linear. The bf16 reference pass exceeded the swap budget on this machine, so that is a deviation from a bf16 KL measurement.
- The knapsack used v1-style packed-file byte costs (bin 1.25, tern 1.85, 3-bit 3.5, 4-bit 4.5 bits/weight including
scales), not in-memory MLX 2-bit storage. Loader still unpacks into MLX
QuantizedLinear. - No same-size depth-rule control (for example "4-bit the last k layers, ternary the rest") was run at 3.13 GB. The gain versus v1.0 is a real paired difference on these suites; it is not identified as specifically due to measured-KL versus a simpler bit-width rule.
- Smaller 2.2 GB and 2.5 GB measured-KL builds collapsed (decision-v7 0.36 / 0.64) and are not released.
- Knowledge-heavy multiple choice is still the weak spot relative to bf16 (transfer-v9 retains 91.9%). Use this model for Clef-style routing / classification decisions close to the calibration mix.
- The joint-schema head runs in fp32 on CPU here (the release runs it in bf16 on CUDA).
- Text-only. The vision tower is not in this repo;
Jakevin/clef-flash-ternary-vision-mlxis unchanged.
License and attribution
Derived from Cloudflare/clef-flash (© Cloudflare, Apache-2.0), itself
post-trained from Qwen/Qwen3.5-9B (Apache-2.0). Distributed under the Apache License 2.0 (LICENSE); NOTICE.md lists the
modifications. Not an official Cloudflare release; "Clef" and "Cloudflare" identify the source model only.
Reproduce
Method and deviations: runs/clef-mkl-20261007/ in the kev repo (not public). Recipe:
{"alloc": "b31", "sha256": "df63ead9e19bbefd806534dcd9bde7bdfac106b35b672675d64b261cdd76f344", "calib": 128, "seed": 1234, "group": 64, "damp": 0.01, "emb_bits": 4}.
Configuration
- Architecture
- Qwen3_5ForConditionalGeneration
- Context length (tokens)
- 262,144
- Layers
- 32
- Hidden size
- 4,096
- Feed-forward size
- 12,288
- Attention heads
- 16
- Key/value heads
- 4
- Head dimension
- 256
- Vocabulary size
- 248,320
- Model type
- qwen3_5
Identity and Version
- Repository
- Jakevin/clef-flash-ternary-mlx
- Publisher
- Lo
- Task
- Not stated by the source
- Modality
- Other
- Library
- mlx
- Parameters
- 1.6B parameters
- Languages
- mlx
- Revision
- 2d9e93a5972b8d8f68e993d28f51c75eaf1a91ea
- First published
- 2026-10-06
- Last updated
- 2026-10-08
Files and Weights
16 files, 3.4 GB in total. The weights are 2 files totalling 3.4 GB in safetensors.
Every file
| File | Type | Size | SHA-256 |
|---|---|---|---|
| joint_head.safetensors | Weights | 243.5 MB | 19cdcec8c81d |
| model.safetensors | Weights | 3.1 GB | f338e13d9a73 |
| MANIFEST.json | Configuration | 2.4 KB | — |
| clef_stream.py | Configuration | 10.6 KB | — |
| config.json | Configuration | 2.8 KB | — |
| generation_config.json | Configuration | 116 B | — |
| joint_head_config.json | Configuration | 119 B | — |
| joint_schema_model.py | Configuration | 23.3 KB | — |
| packed_format.py | Configuration | 6.5 KB | — |
| LICENSE | Documentation | 11.5 KB | — |
| NOTICE.md | Documentation | 1.5 KB | — |
| README.md | Documentation | 7.0 KB | — |
| chat_template.jinja | Other | 7.8 KB | — |
| .gitattributes | Repository | 1.6 KB | — |
| tokenizer.json | Tokenizer | 20.0 MB | 06b9509352d2 |
| tokenizer_config.json | Tokenizer | 1.1 KB | — |
License and Download
- License
- apache-2.0
- Access
- Open weights, no gate
- Download size
- 3.4 GB
Released by Lo through its official repository on Hugging Face. Read the license.
Built From
- Derived from Cloudflare/clef-flash
- Quantized from Cloudflare/clef-flash
Memory Requirements
| Precision | Weights in memory |
|---|---|
| As published | 3.4 GB |
| 16-bit | 3.1 GB |
| 8-bit | 1.6 GB |
| 4-bit | 0.8 GB |
Weights only, from the published parameter count; the key-value cache and runtime add to this.
Questions About clef-flash-ternary-mlx
How much GPU memory does clef-flash-ternary-mlx need?
About 3.7 GB at 16-bit and 0.9 GB at 4-bit: the weights (1.6B parameters) plus a working margin. A long context needs more.
What is the cheapest GPU to run clef-flash-ternary-mlx on?
At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.
Can I use clef-flash-ternary-mlx commercially?
Yes. clef-flash-ternary-mlx is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.
What is clef-flash-ternary-mlx's context length?
262,144 tokens, from the maximum position embeddings in its published configuration.