Spark-X2.5-4B — MLX oQ4e (fp16 source)

Model Details

Model Description

oQ4e-quantized MLX build (created by xunlinkx with the omlx pipeline) of XHToken/Spark-X2.5-4B for first-class, all-local serving on Apple Silicon via omlx (the MLX OpenAI-compatible server) and mlx-lm.

Attribution chain: XHToken/Spark-X2.5-4B (official base, Apache-2.0) → xunlinkx's oQ4e quantization (this repo).

This is not a new model — it is a quantization of the existing checkpoint, produced with omlx's quantize_oq_streaming(..., oq_level=4, enhanced=True) pipeline (128×512-block imatrix calibration):

  • Why we made it: run a full 4B Spark-X2.5-class model locally in ~2.5 GB of memory at usable decode rates (≈47–50 tok/s on an M3 Pro), with the attention gates and projection heads kept at higher precision so reasoning quality survives 4-bit compression. The -fp16 suffix records that the quantizer consumed full-precision float16 source weights (best-fidelity input), as opposed to bf16 or already-quantized sources.

  • Quantization: method oQ4e (omlx enhanced streaming imatrix calibration), mixed-bit per-layer layout embedded in config.json (quantization / quantization_config) so the exact layout is restored automatically on load.

  • Developed by: xunlinkx (oQ4e quantization + MLX build, using omlx)

  • Base model by: XHToken (Spark-X2.5-4B)

  • Shared by: xunlinkx

  • Model type: spark2_5 text-generation decoder (MLX quantized, model_type: spark2_5)

  • Language(s) (NLP): multilingual (base model; Spark-X2.5 pretraining, including English/Chinese coverage)

  • License: Apache 2.0 (inherits the base checkpoint license)

Compatibility — Spark support required (patch it yourself until mainline)

model_type: spark2_5 loads only where native support exists. Native support is still converging (as of 2026-09-15): mlx-lm has not merged #1891, and omlx main carries a vendored patch (#3606) that no tagged release includes yet. Until then:

  • mlx-lm users: checkout ml-explore/mlx-lm#1891 (gh pr checkout 1891 inside a mlx-lm clone, or pip install "mlx-lm @ git+https://github.com/xunlinkx/mlx-lm@spark2_5-native"; ab1806e-era alternative for omlx-scheduler compatibility: .../xunlinkx/mlx-lm@spark2_5-backport).
  • omlx users: spark support is on main since jundot/omlx#3606 (2026-09-14, vendored patch, self-disabling once the native module is present) — but no tagged release includes it yet (latest stable v0.6.4 and the 0.7.0.dev pre-releases all predate it). Run omlx from source main, or apply jundot/omlx#3671 for the oQ rules + mlx-lm pin (gh pr checkout 3671).

Loading this checkpoint with an mlx-lm that predates spark2_5 support fails with an unsupported-model-type error. No other requirements: standard MLX safetensors + config.json, no custom code needed once support is present.

Quantization detail (exact, from config.json)

  • 5.178 weight-bits per parameter average (group_size 64, affine). Embeddings and norms stay fp16; per-group scales add ~0.25 bpw on disk.
  • Layout: 4-bit base; sigmoid head gates (self_attn.g_proj) kept at 5–8 bit on all 36 layers, fused q_k_v_proj / down_proj lifted to 5–6 bit on sensitive layers, out_proj at 4–5 bit, MLP gate/up at 4-bit.
  • Sibling levels in this family: oQ5e (6.098 bpw), oQ6e (7.013 bpw), oQ8e (8.653 bpw) — see xunlinkx/Spark-X2.5-4B-oQ{e}-fp16.

Sampling (official, per the XHToken model card)

  • temperature 1.0, top_p 0.95, top_k −1 (disabled); thinking mode default. (Early third-party guides suggesting 0.6–0.7 do not match the official card.)

Measured performance (Apple M3 Pro, 36 GB)

  • Smoke/serve test: 50.05 tok/s generation, 2.49 GB peak.
  • mlx_lm.generate cake prompt (1024 tokens): 47.35 tok/s, 2.53 GB peak.

Usage

mlx_lm.generate --model xunlinkx/Spark-X2.5-4B-oQ4e-fp16 \
  -p "The secret to baking a good cake is" -m 1024 \
  --temp 1.0 --top-p 0.95
omlx serve --host 127.0.0.1 --port 8005
# model id: Spark-X2.5-4B-oQ4e-fp16 (OpenAI-compatible /v1/chat/completions)

License

Apache-2.0, inherited from XHToken/Spark-X2.5-4B.

Downloads last month
140
Safetensors
Model size
4B params
Tensor type
U32
·
F16
·
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for xunlinkx/Spark-X2.5-4B-oQ4e-fp16

Quantized
(37)
this model