alt.freeweights.text / K2-Horizon-3.7B-4bit
From: mlx-community <huggingface.co/mlx-community>Newsgroups: alt.freeweights.textSubject:

K2-Horizon-3.7B-4bit

Date: 2026-11-15Commit: 3b453d0Signed: 2DC28CC7B26A283B ✓

Text generation model with 5.1B parameters. Safetensors weights, 4.16 GB in all. Published by mlx-community under Apache-2.0.

5.1B params4.16GBK2-Horizon-3.7B-4bitsafetensorspermissive
FactsParams5.1BSize4.16 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get mlx-community/K2-Horizon-3.7B-4bit
# manifest sha256 6351f6dd9061… · 4.16 GB · 10 files
$ fw verify ./K2-Horizon-3.7B-4bit mlx-community/K2-Horizon-3.7B-4bit
From sourceHosted (signed)mlx-community/K2-Horizon-3.7B-4bitLast check: 2026-11-15 05:14 UTC

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

Quantized of K2-Horizon-3.7B.

Works with

Overview

Size
4.16 GB
Weights
4.14 GB (safetensors)
Parameters
5.1B
Formats
safetensors
Task
text generation
License
Apache-2.0 (permissive)
Files
10, each with a sha256
Publisher
mlx-community
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Base model: IFM/K2-Horizon-3.7B

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:14 UTCpassed

Model card

From the publisher at commit 3b453d0. Shown as plain text with links; images open at the publisher.

K2-Horizon-3.7B (MLX, 4-bit)#

Mixed-precision 4-bit MLX quantization of IFM/K2-Horizon-3.7B, converted from revision 943ce4e. 6.5 bits/weight effective, 4.1 GB on disk. For Apple silicon.

K2-Horizon-3.7B is IFM's small dense K2-Horizon model: a 3.7B decoder-only model with a 512K (524,288-token) context window.

Requirements#

mlx-lm doesn't support the k2_horizon architecture yet. There's an open request: mlx-lm#1876. Until support lands, this repo ships the MLX model code (k2_horizon.py), which mlx-lm loads through the model_file entry in config.json. So the released mlx-lm works as-is:

pip install -U mlx-lm

Pass --trust-remote-code (or trust_remote_code=True). mlx-lm 0.31.3 loads the file without it, but newer versions require it. The file runs on your machine, so read it first if you like; its comments describe how it differs from IFM's PyTorch code.

Once K2-Horizon support lands in a released mlx-lm, this repo will be updated to use it. If something breaks after that, open a discussion here asking for a re-upload.

How it was quantized#

Mixed precision, chosen from measurements rather than a fixed rule (integer affine quantization, bf16 scales and biases):

  • 4-bit, group size 32: the MLP weights (gate_proj, up_proj, down_proj). These hold most of the parameters.
  • 8-bit, group size 64: everything else: attention, the embeddings and lm_head.

Plain 4-bit (everything 4-bit, group size 64) loses too much on this model: +21.5% WikiText-2 perplexity versus bf16. This recipe loses +4.4%. On all three dense K2-Horizon models, plain 4-bit lost 18-22%, far more than on the 36B MoE model, so the dense 4-bit repos use this mixed recipe.

Memory#

Peak 4.3 GB for a short prompt; fits a 16 GB Mac. The KV cache adds about 144 KB per token in bf16 (18.0 GB at 128K tokens), so long contexts need more memory; --max-kv-size and KV-cache quantization (--kv-bits 8, where available) reduce it.

Conversion check#

The MLX implementation was checked against IFM's PyTorch code (modeling_k2_horizon.py) in fp32 on the real weights of this model:

  • Layer by layer, all 36 layers match to a relative error of 4e-6 or better, and the next-token predictions agree at every position.
  • Token by token: the full model in fp32 greedily generated with the KV cache, and the PyTorch model picked the same token at every step (256/256 tokens across English, code, math and Chinese prompts). Cached and uncached outputs also agree at every step.

Smoke-tested after conversion with released mlx-lm 0.31.3: 17 * 23 → 391 and "capital of Australia" → Canberra, both ending normally. On a Mac Studio M4 Max 128GB: 109.6 tok/s generation, peak 4.3 GB (short prompt).

Benchmarks (all K2-Horizon-3.7B MLX variants)#

WikiText-2 test perplexity (128 × 512 tokens, lower is better) and generation speed on an M4 Max 128GB, all measured the same way:

bf168-bit4-bit
Bits/weight168.56.5
Disk10.1 GB5.4 GB4.1 GB
Peak memory10.2 GB5.5 GB4.3 GB
WikiText-2 perplexity17.55217.544 (-0.05%)18.324 (+4.4%)
Generation50.3 tok/s84.2 tok/s109.6 tok/s

Perplexity is a coarse signal. Test the versions on your own workload before picking one. Other K2-Horizon sizes: the K2-Horizon collection.

Usage#

mlx_lm.generate --model mlx-community/K2-Horizon-3.7B-4bit --trust-remote-code --prompt "Explain mixture-of-experts in two sentences." --max-tokens 2048
from mlx_lm import load, generate

# Newer mlx-lm versions need trust_remote_code=True; on mlx-lm 0.31.3 use load("mlx-community/K2-Horizon-3.7B-4bit").
model, tokenizer = load("mlx-community/K2-Horizon-3.7B-4bit", trust_remote_code=True)
messages = [{"role": "user", "content": "Explain mixture-of-experts in two sentences."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
print(generate(model, tokenizer, prompt, max_tokens=2048))

mlx_lm.chat and mlx_lm.server take the same --trust-remote-code flag.

The model thinks before it answers, inside <ifm|think> … </ifm|think>. Leave room for that in max_tokens. The effort level is set with reasoning_effort in the chat template: "high" (default), "medium" or "low", e.g. apply_chat_template(messages, add_generation_prompt=True, reasoning_effort="low").

Notes:

  • Server output: mlx-lm doesn't recognize the <ifm|think> tags yet, so mlx_lm.server returns the thinking text inside content, before </ifm|think>, rather than in a separate reasoning field. K2-Horizon's tool-call format isn't parsed yet either.
  • Chat template change: the original template raises an error when an earlier assistant message has no thinking field, which is what OpenAI-style clients send. The template here renders empty thinking for those messages instead. Nothing else was changed.

License#

Apache-2.0, inherited from the base model. Refer to the original model card for architecture, benchmarks and intended use. All credit for the model belongs to IFM.

Files

10 files · 4.16 GBWeights 4.14 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 10 files with their sha256
FileSizesha256
.gitattributes1.57 KB34448b82c17d60fec9b65b1f093c115ddbaadc04beb1b0140b6bfed2e012a930
README.md5.84 KBff289d4ad54fd02fdb087f56b530321e8d20ee1af2b8c392c1f65afb7b27afbf
chat_template.jinja51.0 KBcaf441b7eef4032175e18e5a3fcc5d574d39db3d46a752f9fe60e05b3b0fd435
config.json71.7 KBfaeb33cbec7e47f505fd6689c118a062bb1d262c4989a47314dec1c109ee82c7
generation_config.json81 B2da7d47641f4509da4ae47711e31d8b5f0f3f801ee08d87e7e9f07f814bdc4a3
k2_horizon.py26.4 KB80b501f2ea7364842bd25659928d3af7692238e7c6c2a50bad2f35f61f5483bc
model.safetensors4.14 GB58caf5042d7139485b9dfd096bef890829ab478c38270ebdf3c6b760b386c8f5
model.safetensors.index.json58.9 KBc7221a4e67f91e09b6b31e9c591e7e990a3516c764894e260d6c8c3bf69fd92f
tokenizer.json20.6 MB838d767b7c9925ff257feb20eaa4299a8e3cc35bb3d805589c373f51d2cc3cb6
tokenizer_config.json293 B068cfdcf2bcef44fd77f935a9fb41b4d45af547fd41b95079817bd40b24fe518
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
3b453d026b pinned now2026-11-15 05:14 UTC10 files · 4.16 GB

Use it

$ fw get mlx-community/K2-Horizon-3.7B-4bit
# manifest sha256 6351f6dd9061… · 4.16 GB · 10 files
$ fw verify ./K2-Horizon-3.7B-4bit mlx-community/K2-Horizon-3.7B-4bit
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/mlx-community/K2-Horizon-3.7B-4bit.json --dir ./K2-Horizon-3.7B-4bit $ python3 fw.py verify ./K2-Horizon-3.7B-4bit ./mlx-community__K2-Horizon-3.7B-4bit.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download mlx-community/K2-Horizon-3.7B-4bit --revision 3b453d026bd4f433c0bc9a532706f87488269e4d --local-dir ./K2-Horizon-3.7B-4bit
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("mlx-community/K2-Horizon-3.7B-4bit", revision="3b453d026bd4f433c0bc9a532706f87488269e4d") model = AutoModelForCausalLM.from_pretrained("mlx-community/K2-Horizon-3.7B-4bit", revision="3b453d026bd4f433c0bc9a532706f87488269e4d", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve mlx-community/K2-Horizon-3.7B-4bit --revision 3b453d026bd4f433c0bc9a532706f87488269e4d

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
ff289d4ad54fd02fdb087f56b530321e8d20ee1af2b8c392c1f65afb7b27afbf
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: mlx-community <huggingface.co/mlx-community>Newsgroups: alt.freeweights.textSubject: K2-Horizon-3.7B-4bitDate: 2026-11-15Commit: 3b453d0Signed: 2DC28CC7B26A283B ✓
Upstream
mlx-community/K2-Horizon-3.7B-4bit
Pinned commit
3b453d026bd4f433c0bc9a532706f87488269e4d
Manifest
K2-Horizon-3.7B-4bit.json · .minisig
Manifest sha256
6351f6dd906179991da4ed7b1f7ba6dc7ba71ada421ff3ec7e151fc2991b64eb
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:14 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/mlx-community/K2-Horizon-3.7B-4bit.json $ curl -O https://freeweights.allternit.com/manifests/mlx-community/K2-Horizon-3.7B-4bit.json.minisig $ minisign -Vm K2-Horizon-3.7B-4bit.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

IFM/K2-Horizon-3.7B · 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 mlx-community/K2-Horizon-3.7B-4bit
Open in Freeweights Studio

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

Signed manifest
minisign, key 2DC28CC7B26A283B. K2-Horizon-3.7B-4bit.json. Provenance. Takedown history: none.
From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B