alt.freeweights.qwen / kev-4b-ONNX
From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.qwenSubject:

kev-4b-ONNX

Date: 2026-11-15Commit: 195bdf7Signed: 2DC28CC7B26A283B ✓

Text classification model. Onnx weights, 4.80 GB in all. Published by onnx-community under Apache-2.0.

qwen4.80GBkev-4b-ONNXonnxpermissive
FactsParamsnot statedSize4.80 GBFormatsonnxTasktext classificationLicenseApache-2.0From sourcepermissive
$ fw get onnx-community/kev-4b-ONNX
# manifest sha256 8845cbf11fb2… · 4.80 GB · 17 files
$ fw verify ./kev-4b-ONNX onnx-community/kev-4b-ONNX
From sourceHosted (signed)onnx-community/kev-4b-ONNXLast check: 2026-11-15 05:20 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Quantized of Qwen3-4B-Base.

Works with

Runs with

Ranked by fit to this model (onnx), then by GitHub stars.

Convert with

Scan with

Overview

Size
4.80 GB
Weights
1.07 GB (smallest of 2 ONNX variants)
Parameters
not stated
Formats
onnx
Task
text classification
License
Apache-2.0 (permissive)
Files
17, each with a sha256
Publisher
onnx-community
Added
2026-11-15
Section
alt.freeweights.qwen
Lineage

Original release from the publisher.

Base model: Qwen/Qwen3-4B-Base

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 05:20 UTCpassed

Model card

From the publisher at commit 195bdf7. Shown as plain text with links; images open at the publisher.

This is a Transformers.js-ready ONNX conversion of the original Hugging Face model jaredpalmer/kev-4b. The original model card content follows below.

Usage with Transformers.js#

Variants under onnx/: q4f16 (default) and q4 (4-bit MatMulNBits weights, block 32, embedding as GatherBlockQuantized, pointer head in fp32; q4f16 runs the rest of the graph in fp16 for WebGPU). The full-precision export is not published.

Kev is not a text generator and not a plain sequence classifier. One document (the state) and any number of typed questions are packed into a single sequence with five delimiter tokens; a block-causal mask lets every question see the state and itself only, and a pointer head scores each option's </opt> token against its question's <decide> token. The graph takes only input_ids and attention_mask (right padded) and derives segments, positions and the mask from the delimiter ids in-graph. Its logits output has one value per token: read the value at every option's </opt> position and softmax within the question. config.json carries the delimiters, ids and limits under kev.

Transformers.js resolves qwen3 to its text-generation class, which expects a KV-cache graph, so load this graph through the base PreTrainedModel class: unknown or unmapped types take the single-session encoder-only path, which feeds every graph input by name. It logs one warning ("assuming encoder-only architecture"), which is expected.

import { AutoTokenizer, PreTrainedModel, Tensor } from "@huggingface/transformers";

const repo = "onnx-community/kev-4b-ONNX";
const tokenizer = await AutoTokenizer.from_pretrained(repo);
const model = await PreTrainedModel.from_pretrained(repo, { dtype: "q4f16", device: "webgpu" });

// Caller text can never produce a delimiter: <|name|> -> <¦name¦> (kev.model.user_tokens)
const enc = (t) => Array.from(tokenizer(t.replace(/<\|([A-Za-z0-9_]+)\|>/g, "<¦$1¦>"), { add_special_tokens: false }).input_ids.data, Number);
const [STATE, Q, OPT, END, DECIDE] = ["<|fim_prefix|>", "<|fim_middle|>", "<|box_start|>", "<|box_end|>", "<|fim_suffix|>"].map((t) => enc(t)[0]);

// TypeSafe request: choice = criteria object (name -> description or null), noul = yes/no, score = ordered levels
const state = "I was charged twice for the same order and nobody answers my emails. I want my money back now.";
const questions = [
  { instr: "Which team should handle this ticket?", options: ["billing: Charges, refunds, invoices", "technical support: Bugs, outages, login problems", "sales", "account management"] },
  { instr: "Is the customer asking for a refund?", options: ["no", "yes"] },
  { instr: "How positive is the sentiment of this message?", options: ["very negative", "negative", "neutral", "positive", "very positive"] },
];

const tokens = [STATE, ...enc(state)];
const groups = questions.map((q) => {
  const spans = q.options.map((o) => [OPT, ...enc(o), END]);
  const branch = [Q, ...enc(q.instr), ...spans.flat(), DECIDE];
  const base = tokens.length;
  let cursor = 1 + enc(q.instr).length;
  const ends = spans.map((s) => { cursor += s.length; return base + cursor - 1; }); // index of each </opt>
  tokens.push(...branch);
  return ends;
});

const { logits } = await model({
  input_ids: new Tensor("int64", BigInt64Array.from(tokens, BigInt), [1, tokens.length]),
  attention_mask: new Tensor("int64", new BigInt64Array(tokens.length).fill(1n), [1, tokens.length]),
});
const scores = Array.from(logits.to("float32").data);
const softmax = (xs) => { const m = Math.max(...xs); const e = xs.map((x) => Math.exp(x - m)); const s = e.reduce((a, b) => a + b); return e.map((x) => x / s); };
const answers = groups.map((ends) => softmax(ends.map((i) => scores[i])));
// choice: argmax over the criteria keys; noul: answers[i][1] is p(yes); score: expected level = sum(i * p[i])

Limits: the state is cut to 8,192 tokens and each question branch (instruction, options, delimiters) plus the state must fit in 8,192 tokens (training used 384 and 1,024; longer inputs run but are untested). Choice questions take 1 to 255 options. Option descriptions render as name: description; structured state or instructions (objects, lists) render as indented key: value text as in the source kev.api.render.


Original model card#

Kev-4B#

Kev-4B is a decision model: one document (the state) and a set of typed questions in, a probability distribution per question out, in one forward pass. No text generation. It is a LoRA adapter (r=16) plus a pointer head on Qwen/Qwen3-4B-Base, serving TypeSafe's public /v1/systemone contract.

The recommended kev. The best 4B checkpoint under a frozen, checksummed protocol after ~40 controlled 4B trials, and the first Kev within seven points of Jev out of domain on the same items. Same recipe run at three seeds: transfer 0.773 / 0.790 / 0.770; this checkpoint is the seed selected on the development partition (never on the locked test).

  • Hub: jaredpalmer/kev-4b (this repo; trial v7-rc3/01-trial-1)
  • Code, suites, every trial with hashes and paired bootstraps: github.com/jaredpalmer/kev — PLAN.md, runs/leaderboard.md

Results (same frozen items for every row)#

Kev-0.5B (prototype)Kev-0.6BKev-4BJev
in-distribution accuracy (decision-v4 dev, 1,200 q)0.7120.8010.8540.845
out-of-domain accuracy (transfer-v4 dev, 560 q)0.5610.6200.7900.857
out-of-domain Brier0.500.5360.3280.211
confident errors out of domain (p ≥ 0.9 and wrong)–10.8%8.2%3.7%
held-out policy structures, both siblings correct–0.080.730.86
option-order flip rate0.210.070.060.00

Per-source out-of-domain accuracy (Kev-4B / Jev): QNLI 0.89 / 0.93, SciQ 0.99 / 0.99, TweetEval-offensive 0.75 / 0.81, PAWS 0.72 / 0.79, MMLU 0.65 / 0.90, Emotion 0.66 / 0.59, deadline (3-level date arithmetic) 0.53 / 0.93, (A and B) or not C 0.97 / 0.97, if A then not B else C 0.88 / 0.78.

Seeds: three seeds on decision-v7: transfer 0.773 / 0.790 / 0.770, held-out rule pairs 0.62 / 0.73 / 0.67 (Jev 0.86); this checkpoint is seed 1, selected on development transfer accuracy. Trained on decision-v7 (10k public records + 896 policy records over nine template families incl. four ordinal Score threshold families + 1,680 records from 60 random rule structures with negation anywhere); development/test items are byte-identical to v4, so every number here is comparable with earlier checkpoints.

Locked test, read once (runs/locked/kev-4b-v7-preview-ungated/): in-distribution 0.856 (Brier 0.211), out-of-domain 0.806 (Brier 0.294, confident errors 6.6%, held-out pairs 0.66). This partition will not be read again for this checkpoint.

What we learned building it#

  • Capacity dominates out of domain. With public examples and synthetic budget held equal, 0.6B → 4B is +14–19 pp; 4B → 8B is +1–7 pp.
  • Fine-tuning erodes base capability, and the learning rate controls it. The 4B base, zero-shot with a letter readout, scores 0.688 on the same MMLU items and 0.787 on PAWS; the default recipe (lr 2e-4) trained down to 0.60–0.66 / 0.56–0.71. Lowering lr to 5e-5 recovers most of it and is the single largest recipe improvement we found; fewer LoRA target modules and smaller ranks help less.
  • More public training data raises in-distribution accuracy and lowers transfer at 4B (10k vs 3.4k records: −3 pp). Knowledge MCQ sources (ARC, OpenBookQA, CommonsenseQA) raise in-distribution accuracy to 0.86 without moving transfer.
  • Programmatic contrastive policy pairs teach the trained rule structures (both-correct 0.85–1.0) but transfer to unseen structures only partially (0.5–0.6 at 4B, 0.03–0.11 at 0.6B).

Known limits#

  • Held-out policy reasoning (unseen rule compositions, date arithmetic with grace periods) is far from Jev.
  • Product-shaped questions with no training analogue are not guaranteed: on the TypeSafe docs example ("two charges on my card" → Is there a billing problem?) this checkpoint answers 0.48 (Kev-8B 0.95, Kev-0.6B 0.97) while picking the return reason correctly (wrong size 0.53; Kev-8B 0.84; Kev-0.6B prefers "none of the above" 0.58). Measure on your own inputs.
  • Out-of-domain probabilities are usable but not calibrated (raw ECE 0.096); temperature fitted in-domain does not transfer.
  • 4B fp32 needs ~16 GB; on a 32 GB Mac use KEV_DTYPE=bf16. Latency on an H100 is ~45 ms per packed request; on an M5 several hundred ms.

Training#

Frozen suite evals/v4/decision-v4: 10,000 public records (1,000 per source, ten sources) plus two programmatic policy arms of 448 records, two epochs, LoRA r=16 on attention and MLP projections, pointer head from scratch, cross-entropy on the option distribution, lr 5e-5 (OneCycle), effective batch 8, bf16 autocast with fp32 master weights, gradient checkpointing, one H100 (~40 min). Augmentation: option permutation, none-of-the-above insertion, distractors, none minimal pairs on 25% of Choice records. No Jev outputs were used for training.

Evaluation protocol#

Development partitions select models; the locked test partition is read at most once per candidate. Every number carries suite hash, code hashes, and git commit in result.json. See PLAN.md for the corrections we made to our own earlier claims.

Use#

uv run --extra serve python -m kev.serve --run jaredpalmer/kev-4b --port 8008      # KEV_DTYPE=bf16 on a 32 GB Mac

Any TypeSafe-compatible client works: TypeSafeClient(api_key="local", base_url="http://127.0.0.1:8008", model="kev-latest").

License#

Apache-2.0 for the adapter and head; Qwen3 base is Apache-2.0; datasets carry their own licenses.

Files

17 files · 4.80 GBWeights 1.07 GB (smallest of 2 ONNX variants). Sizes and sha256 from the signed manifest.
Hide all 17 files with their sha256
FileSizesha256
.gitattributes1.90 KBdae39299914a0f2768f074b9a119dd28b06cdfc174b97a4fe63220ca376f2034
README.md10.1 KBbfa700301d00d803aa1f26b5beb6422ff2a2e8f9a675e69e4498176868181716
added_tokens.json707 Bc0284b582e14987fbd3d5a2cb2bd139084371ed9acbae488829a1c900833c680
config.json2.27 KB2d11c614783aae3e202423fef836efe5a896b5d6cdbdc0bf27476622e1c4a9a7
merges.txt1.67 MB8831e4f1a044471340f7c0a83d7bd71306a5b867e95fd870f74d0c5308a904d5
onnx/model_q4.onnx1.60 MB37b7a5755e02634bab9d3f0e8833df0a52b29c5a7c19fcdfc606281f6cd3ac49
onnx/model_q4.onnx_data1.07 GBb686530eda2077d31ead468765bf8412d8588f623774556625a7650d0c789162
onnx/model_q4.onnx_data_11.07 GB037df71ad0566e9bf43a33627cc37311d771b40cf81c0d8be1b4fbca16a682ff
onnx/model_q4.onnx_data_2378 MB68611c88d1c358270bae47fe6909efb4cfedfd88895e59eb75887144357a05e7
onnx/model_q4f16.onnx6.84 MB3eb476cc348bb2ce05cc205f1c2bed38ba1ebfb2c079c87c52ab9f49b5ba90b8
onnx/model_q4f16.onnx_data1.07 GBb137cbe0d276e474d0e3d072d1f06f3a99681d28ed0b827fc43595def267a2c3
onnx/model_q4f16.onnx_data_11.06 GBbc35d27970c56ea5d7ea2838c6f662721813c1051f2b333b7aab2c58068f5069
onnx/model_q4f16.onnx_data_2128 MBae014e677ba2a2b27fd205863335f6f09cc1f72076a4fc6f88f4a08926f80050
special_tokens_map.json616 B6676f091c8bc4d1b50146427cfde92073402866b87b6e39223227931b70083e9
tokenizer.json7.03 MBc0382117ea329cdf097041132f6d735924b697924d6f6fc3945713e96ce87539
tokenizer_config.json9.68 KB3c04ed3ca964ea2f6b2b5faf0dc4d31aec1cb1e8b4bcf63f402d295046b422b5
vocab.json2.78 MBca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
195bdf7309 pinned now2026-11-15 05:20 UTC17 files · 4.80 GB

Use it

$ fw get onnx-community/kev-4b-ONNX
# manifest sha256 8845cbf11fb2… · 4.80 GB · 17 files
$ fw verify ./kev-4b-ONNX onnx-community/kev-4b-ONNX
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/onnx-community/kev-4b-ONNX.json --dir ./kev-4b-ONNX $ python3 fw.py verify ./kev-4b-ONNX ./onnx-community__kev-4b-ONNX.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/kev-4b-ONNX --revision 195bdf73096df2bca7150223c9279af7893163c4 --local-dir ./kev-4b-ONNX

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
bfa700301d00d803aa1f26b5beb6422ff2a2e8f9a675e69e4498176868181716
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.qwenSubject: kev-4b-ONNXDate: 2026-11-15Commit: 195bdf7Signed: 2DC28CC7B26A283B ✓
Upstream
onnx-community/kev-4b-ONNX
Pinned commit
195bdf73096df2bca7150223c9279af7893163c4
Manifest
kev-4b-ONNX.json · .minisig
Manifest sha256
8845cbf11fb286abe175b22a428eb7bdbdcb6c6106b8b35d119324730b875cb5
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:20 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/onnx-community/kev-4b-ONNX.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/kev-4b-ONNX.json.minisig $ minisign -Vm kev-4b-ONNX.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

Qwen/Qwen3-4B-Base · this model is a quantization of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/kev-4b-ONNX
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. kev-4b-ONNX.json. Provenance. Takedown history: none.
From: BAAI <huggingface.co/BAAI>Subject: Aquila-VL-2B-llava-qwen
From: Perciqa <huggingface.co/Perciqa>Subject: Aurora-Code-1
From: BAAI <huggingface.co/BAAI>Subject: bge-reasoner-embed-qwen3-8b-0923
From: amazon <huggingface.co/amazon>Subject: BMOJOF-primed-HQwen3-8B-Instruct
From: nbeerbower <huggingface.co/nbeerbower>Subject: Bubba-Qwen3.6-27B-LoRA
From: bartowski <huggingface.co/bartowski>Subject: bytkim_Qwen3.8-27B-pi-GGUF