Myric/Moonlight-16B-A3B-Instruct-APEX-GGUF overview
Moonlight 16B A3B Instruct — APEX GGUF MoE aware, mixed precision APEX quantizations of moonshotai/Moonlight 16B A3B Instruct https://huggingface.co/moonshotai…
Runs locally from ~10.03 GB disk (12 GB VRAM class GPUs with llama.cpp / guIDE).
Repository Files & Downloads
Model Details
| Model ID | Myric/Moonlight-16B-A3B-Instruct-APEX-GGUF |
|---|---|
| Author | Myric |
| Pipeline | text-generation |
| License | mit |
| Base model | moonshotai/Moonlight-16B-A3B-Instruct |
| Last modified | 2026-07-22T21:04:54.000Z |
Model README
---
license: mit
base_model: moonshotai/Moonlight-16B-A3B-Instruct
base_model_relation: quantized
pipeline_tag: text-generation
library_name: gguf
tags:
- gguf
- moe
- apex
- quantized
- moonlight
- deepseek2
- llama.cpp
---
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:
- 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).
- 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.
- Base model: Moonshot AI (@moonshotai) — Moonlight-16B-A3B-Instruct (MIT)
- F16 GGUF conversion: gabriellarson (@gabriellarson) — source GGUF (MIT-derived)
- Quantization engine: llama.cpp by the ggml authors (@ggml-org · github) (MIT)
- APEX recipe & toolkit: Ettore Di Giacinto / LocalAI (@mudler) — localai-org/apex-quant (MIT)
- Calibration data: Bartowski (@bartowski) — calibration_datav3
This is an unofficial community quantization and is not affiliated with or
endorsed by Moonshot AI.
Run Myric/Moonlight-16B-A3B-Instruct-APEX-GGUF with guIDE
Download guIDE — the AI-native code editor with local LLM inference and 69 built-in tools.
Source: Hugging Face · Compare models