alt.freeweights.text / Spark-X2.5-4B-OptiQ-4bit
From: mlx-community <huggingface.co/mlx-community>Newsgroups: alt.freeweights.textSubject:

Spark-X2.5-4B-OptiQ-4bit

Date: 2026-11-15Commit: 105b628Signed: 2DC28CC7B26A283B ✓

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

4.1B params3.05GBSpark-X2.5-4B-OptiQ-4bitsafetensorspermissive
FactsParams4.1BSize3.05 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get mlx-community/Spark-X2.5-4B-OptiQ-4bit
# manifest sha256 c735785f085a… · 3.05 GB · 14 files
$ fw verify ./Spark-X2.5-4B-OptiQ-4bit mlx-community/Spark-X2.5-4B-OptiQ-4bit
From sourceHosted (signed)mlx-community/Spark-X2.5-4B-OptiQ-4bitLast check: 2026-11-15 05:18 UTC

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

Quantized of Spark-X2.5-4B.

Works with

Overview

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

Original release from the publisher.

Base model: XHToken/Spark-X2.5-4B

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

Model card

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

mlx-community/Spark-X2.5-4B-OptiQ-4bit#

Built with mlx-optiq, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. Try the Lab · All OptiQ quants · Docs

A 4-bit mixed-precision MLX quant of XHToken/Spark-X2.5-4B, a dense 4B trained for conversation, coding, tool use and agent work, with a native 1M-token context and 200+ languages. Sensitive layers are kept at 8-bit and robust ones at 4-bit, so the on-disk size stays within a few percent of a stock uniform 4-bit quant while the parts that matter keep their precision.

Spark-X2.5 is a new architecture for MLX, and mlx-optiq adds support for it, so import optiq before mlx_lm.load: stock mlx-lm does not know the spark2_5 model type.

Quantization details#

PropertyValue
Predominant precision4-bit
Layers at 8-bit (sensitive)107
Layers at 4-bit (robust)109
Total quantized layers216
Group size64
Referencebf16, KL-divergence sensitivity sweep over a six-domain calibration mix
KV cachekv_config.json, per-layer mixed precision for optiq serve --kv-config (5 layers at 8-bit, 31 at 4-bit)
Weights on disk2.8 GB

We follow the same naming convention llama.cpp uses for Q4_K_M and similar mixed-precision quants: the "4-bit" label is for the predominant precision, not the weighted average.

Capability Score#

Measured on this quant against a uniform 4-bit quant of the same model, same harness, same prompts (MMLU 5-shot 1000, GSM8K, IFEval strict, BFCL V3 simple, HumanEval pass@1, HashHop; the Capability Score is their mean).

Benchmarkuniform-4OptiQ-4 (mixed)Δ
MMLU63.1%66.8%+3.7
GSM8K84.9%87.0%+2.1
IFEval (strict)75.8%75.2%-0.6
BFCL V370.0%75.5%+5.5
HumanEval74.4%75.6%+1.2
HashHop1.0%8.0%+7.0
Capability Score61.5264.69+3.17

Usage#

pip install mlx-optiq   # brings mlx-lm and the spark2_5 architecture
import optiq  # registers spark2_5 with mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/Spark-X2.5-4B-OptiQ-4bit")
prompt = tokenizer.apply_chat_template(
    [{"role": "user", "content": "Explain quantum computing in simple terms."}],
    tokenize=False, add_generation_prompt=True, enable_thinking=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=300))

Serving, with the mixed-precision KV cache, tool calling and the OpenAI, Responses and Anthropic Messages APIs:

optiq serve --model mlx-community/Spark-X2.5-4B-OptiQ-4bit --kv-config kv_config.json

Only the nine full-attention layers' cache grows with the prompt; the sliding-window layers hold a fixed 512-token window. At 4-bit that is about 9 KB per token, so a 36 GB Mac serves roughly 200k tokens of prompt under the memory-safe default cap. optiq code uses the same server as a local coding agent.

Thinking and sampling#

Thinking is on by default in the chat template: the model reasons in a <think> block first, and a small max_tokens can be spent entirely on it. Give it a few hundred tokens for a direct question, or pass enable_thinking: false (as a chat_template_kwargs entry at the endpoint, or a keyword to apply_chat_template). Upstream evaluates in thinking mode with temperature 1.0, top_p 0.95; those are bundled in generation_config.json and optiq serve applies them unless you pass your own.

See the Spark-X2.5 family guide for serving flags and family caveats.

Quantize your own#

This quant was produced by mlx-optiq. Point it at any Hugging Face model to get the same sensitivity-aware mixed precision:

pip install mlx-optiq
optiq convert <hf-model-id> --target-bpw 5.0 --candidate-bits 4,8
optiq lab   # full local workbench: chat, compare, quantize, fine-tune

License#

Apache 2.0, inherited from the base model.

Files

14 files · 3.05 GBWeights 3.04 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 14 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
README.md4.95 KBc1fca3474fa55211973861fa2eb40d43dce487ae12ed2685e912dbab262b18ba
chat_template.jinja4.65 KB705345721970da40e6aa56db548a46ecd1d8d94a5418808fa180ac19ee77a9ba
config.json49.3 KBf4fb6e0b5245fbc60f640b0145e831cd29840c77cfffd697d5fc5ca88d43a60e
configuration_spark.py4.33 KB02218597240490f490659b184052db940b08163ff9c3af7b7e59323f6f963722
generation_config.json281 B804a5276a9d237600688267dd2bf6f9d4129ec21faf417f870d5d52b32ad9e6c
kv_config.json2.37 KBce6997f86a0c7f042e1c87ba54729d37f28a28364d410f805ed145f29e644030
model.safetensors3.04 GBfd213d43a311fc85e7d3cd36e78e614ab2056b24285967fddf2b66cd4fc936a5
model.safetensors.index.json51.7 KBe04380911a1ef18a4bead540889327ada79e998743b708e79922ee5d9f278293
modeling_spark.py19.4 KB9cf0d1ad2b54b9f7088792779ddd8b5cb4d4fe63bfea054da7f2dd16362bcaf4
optiq/metadata.json19.2 KB4859842c3fb965d2c0a3b33aef0da3fc430e90a9803cdfd9aebe54662d1271f0
optiq/sensitivity.json48.5 KB2f8c37951bf3471c48aaaeb960c2d8a6905ca67e6b6180e934dd31f1c29be5c7
tokenizer.json10.1 MBf71f91ee1b2ac0b27e47bf49ee4859d322ab3d191217ec9964d0189b02454c49
tokenizer_config.json420 Bdc8640f34ad87fb04d17448183a7303d6fb10629fe8a8a2bc81937183617b77f
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
105b628431 pinned now2026-11-15 05:18 UTC14 files · 3.05 GB

Use it

$ fw get mlx-community/Spark-X2.5-4B-OptiQ-4bit
# manifest sha256 c735785f085a… · 3.05 GB · 14 files
$ fw verify ./Spark-X2.5-4B-OptiQ-4bit mlx-community/Spark-X2.5-4B-OptiQ-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/Spark-X2.5-4B-OptiQ-4bit.json --dir ./Spark-X2.5-4B-OptiQ-4bit $ python3 fw.py verify ./Spark-X2.5-4B-OptiQ-4bit ./mlx-community__Spark-X2.5-4B-OptiQ-4bit.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download mlx-community/Spark-X2.5-4B-OptiQ-4bit --revision 105b628431dd078933c969a89cba78066dfa86b5 --local-dir ./Spark-X2.5-4B-OptiQ-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/Spark-X2.5-4B-OptiQ-4bit", revision="105b628431dd078933c969a89cba78066dfa86b5") model = AutoModelForCausalLM.from_pretrained("mlx-community/Spark-X2.5-4B-OptiQ-4bit", revision="105b628431dd078933c969a89cba78066dfa86b5", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve mlx-community/Spark-X2.5-4B-OptiQ-4bit --revision 105b628431dd078933c969a89cba78066dfa86b5

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
c1fca3474fa55211973861fa2eb40d43dce487ae12ed2685e912dbab262b18ba
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: Spark-X2.5-4B-OptiQ-4bitDate: 2026-11-15Commit: 105b628Signed: 2DC28CC7B26A283B ✓
Upstream
mlx-community/Spark-X2.5-4B-OptiQ-4bit
Pinned commit
105b628431dd078933c969a89cba78066dfa86b5
Manifest
Spark-X2.5-4B-OptiQ-4bit.json · .minisig
Manifest sha256
c735785f085a049c36136a9ae001a7d106887cd1b16ae44cad5ba6f93ab6bea8
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:18 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

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

XHToken/Spark-X2.5-4B · 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/Spark-X2.5-4B-OptiQ-4bit
Open in Freeweights Studio

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

Signed manifest
minisign, key 2DC28CC7B26A283B. Spark-X2.5-4B-OptiQ-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