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

K2-Horizon-7B-4bit

Date: 2026-11-15Commit: c869837Signed: 2DC28CC7B26A283B ✓

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

9B params7.20GBK2-Horizon-7B-4bitsafetensorspermissive
FactsParams9BSize7.20 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get mlx-community/K2-Horizon-7B-4bit
# manifest sha256 bcfbe052be05… · 7.20 GB · 11 files
$ fw verify ./K2-Horizon-7B-4bit mlx-community/K2-Horizon-7B-4bit
From sourceHosted (signed)mlx-community/K2-Horizon-7B-4bitLast check: 2026-11-15 05:15 UTC

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

Quantized of K2-Horizon-7B.

Works with

Overview

Size
7.20 GB
Weights
7.18 GB (safetensors)
Parameters
9B
Formats
safetensors
Task
text generation
License
Apache-2.0 (permissive)
Files
11, 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-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:15 UTCpassed

Model card

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

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

Mixed-precision 4-bit MLX quantization of IFM/K2-Horizon-7B, converted from revision f846b1e. 6.4 bits/weight effective, 7.2 GB on disk. For Apple silicon.

K2-Horizon-7B is IFM's medium dense K2-Horizon model: a 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: +18.6% WikiText-2 perplexity versus bf16. This recipe loses +4.5%. 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 7.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: 69.0 tok/s generation, peak 7.3 GB (short prompt).

Benchmarks (all K2-Horizon-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.4
Disk18.0 GB9.6 GB7.2 GB
Peak memory18.1 GB9.7 GB7.3 GB
WikiText-2 perplexity14.73814.762 (+0.2%)15.395 (+4.5%)
Generation29.3 tok/s52.5 tok/s69.0 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-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-7B-4bit").
model, tokenizer = load("mlx-community/K2-Horizon-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

11 files · 7.20 GBWeights 7.18 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 11 files with their sha256
FileSizesha256
.gitattributes1.57 KB34448b82c17d60fec9b65b1f093c115ddbaadc04beb1b0140b6bfed2e012a930
README.md5.81 KB346d6816a7d58c2c30db3777a69dfa05332273476bd4c8c494abc48a4c63227b
chat_template.jinja51.0 KBcaf441b7eef4032175e18e5a3fcc5d574d39db3d46a752f9fe60e05b3b0fd435
config.json71.7 KB5e523194f1e6a64b5a3abd9b60406d4512f16fdd218a69ff67017a8d1b98bbca
generation_config.json81 B2da7d47641f4509da4ae47711e31d8b5f0f3f801ee08d87e7e9f07f814bdc4a3
k2_horizon.py26.4 KB80b501f2ea7364842bd25659928d3af7692238e7c6c2a50bad2f35f61f5483bc
model-00001-of-00002.safetensors5.37 GB134605fa293e6f56bb8862c4cc452028f1a134ac2bb842dce9ff1f09cfda933b
model-00002-of-00002.safetensors1.82 GB19b37d96f4afb339e367f1d13f5a4543c0745c5756dd5102b155cf57585c2248
model.safetensors.index.json71.5 KBe954c6c1ba510f0da377837e96ca6b758c4ec614752b558ae21cc64cc757c4ea
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
c8698376a1 pinned now2026-11-15 05:15 UTC11 files · 7.20 GB

Use it

$ fw get mlx-community/K2-Horizon-7B-4bit
# manifest sha256 bcfbe052be05… · 7.20 GB · 11 files
$ fw verify ./K2-Horizon-7B-4bit mlx-community/K2-Horizon-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-7B-4bit.json --dir ./K2-Horizon-7B-4bit $ python3 fw.py verify ./K2-Horizon-7B-4bit ./mlx-community__K2-Horizon-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-7B-4bit --revision c8698376a102bc5e7ad49089b21b62c096a2506c --local-dir ./K2-Horizon-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-7B-4bit", revision="c8698376a102bc5e7ad49089b21b62c096a2506c") model = AutoModelForCausalLM.from_pretrained("mlx-community/K2-Horizon-7B-4bit", revision="c8698376a102bc5e7ad49089b21b62c096a2506c", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve mlx-community/K2-Horizon-7B-4bit --revision c8698376a102bc5e7ad49089b21b62c096a2506c

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
346d6816a7d58c2c30db3777a69dfa05332273476bd4c8c494abc48a4c63227b
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-7B-4bitDate: 2026-11-15Commit: c869837Signed: 2DC28CC7B26A283B ✓
Upstream
mlx-community/K2-Horizon-7B-4bit
Pinned commit
c8698376a102bc5e7ad49089b21b62c096a2506c
Manifest
K2-Horizon-7B-4bit.json · .minisig
Manifest sha256
bcfbe052be05761719cb62298ab7d183afa7c35ada9b1f2ae61f52b71c4bf496
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:15 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

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