Moonlight-16B-A3B-Instruct β€” APEX GGUF

MoE-aware, mixed-precision APEX quantizations of moonshotai/Moonlight-16B-A3B-Instruct (16B total / ~3B active, DeepSeek-V2/V3-style MoE: 64 routed + 2 shared experts, MLA attention).

APEX assigns quantization precision per tensor role and per layer instead of uniformly β€” keeping always-active shared experts and edge layers high-precision while compressing the sparse routed-expert middle layers hard. The result is near-full-precision quality at a fraction of the size.

Results

Perplexity on wikitext-2-raw (test split, 200 Γ— 512-token windows), measured with llama-perplexity. Lower is better.

File Size BPW PPL Ξ” vs F16
F16 (reference baseline) 30 GB 16.0 8.836 β€”
APEX-i-quality 12 GB 5.99 8.916 +0.90%
APEX-handroll 11 GB 5.40 8.959 +1.38%

Both tiers hold within ~1% of full-precision perplexity at ~2.6Γ— smaller. Coherent in English and on code prompts; ~85 tok/s generation on a single modern GPU.

Which file to pick

  • APEX-i-quality (12 GB) β€” highest quality; edge/near routed experts at Q6_K/Q5_K, middle at IQ4_XS, shared experts Q8_0, attention Q6_K. Uses a diverse ("I") imatrix.
  • APEX-handroll (11 GB) β€” same recipe, but the routed down projections are pinned to IQ4_NL (see Method). ~8% smaller for +0.05 PPL β€” the better size/quality trade on this architecture.

Usage (llama.cpp)

llama-cli   -m Moonlight-16B-A3B-Instruct-APEX-handroll.gguf -ngl 999 -p "Hello"
# or serve an OpenAI-compatible endpoint:
llama-server -m Moonlight-16B-A3B-Instruct-APEX-handroll.gguf -ngl 999 --host 0.0.0.0 --port 8081

Requires a llama.cpp build recent enough to support the deepseek2 architecture and the kimi-k2 pre-tokenizer (Moonlight shares Moonshot's tiktoken tokenizer).

Method & notes

APEX is a bit-allocation recipe over stock llama-quantize --tensor-type-file (no kernel/format changes). Two architecture-specific adaptations were required for Moonlight that the stock APEX profiles do not handle:

  1. MLA attention tensors. Moonlight uses Multi-head Latent Attention, so its attention projections are named attn_q, attn_kv_a_mqa, attn_k_b, attn_v_b, attn_output β€” not the usual attn_q/k/v. The generated config was patched to assign precision to the real MLA tensors (otherwise the KV projections silently keep the base type).
  2. Non-256-divisible expert dim (1408). Moonlight's routed-expert intermediate size is 1408, which K-quants (Q6_K/Q5_K/IQ4_XS require 256-divisibility) cannot quantize β€” they fall back to Q8_0, wasting bits on the largest tensors. The handroll tier pins routed ffn_down_exps to IQ4_NL (a block-32 4-bit type) to compress them properly. This is the difference between the two tiers.

Baseline: quantized from gabriellarson/Moonlight-16B-A3B-Instruct-GGUF's F16 conversion. Calibration imatrix built from Bartowski's calibration_datav3 (diverse chat/code/reasoning text).

Reproduce

Full recipe with exact commands, pinned tool versions, the tensor-type configs, and the config-generation/patch scripts is in REPRODUCE.md. Bundled: generate_config.sh, patch_moonlight_config.py, configs/moonlight_*.txt, and the imatrix β€” so the whole pipeline is reproducible without any private dependency.

Attribution & licenses

All components are MIT-licensed; see LICENSE and NOTICE.

This is an unofficial community quantization and is not affiliated with or endorsed by Moonshot AI.

Downloads last month
248
GGUF
Model size
16B params
Architecture
deepseek2
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Myric/Moonlight-16B-A3B-Instruct-APEX-GGUF

Quantized
(8)
this model