Downloads · 30 days
45
6% of all-time downloads
cspenn/Skyfall-31B-v4.2-MLX-Mixed-4-8
Skyfall-31B-v4.2-MLX-Mixed-4-8 is a text generation model from cspenn. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
An MLX mixed-precision quantization of TheDrummer/Skyfall-31B-v4.2 for inference on Apple Silicon using the mlx-lm framework.
Downloads · 30 days
45
6% of all-time downloads
All-time downloads
806
Public
Parameters
31.4B
24.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors24.6 GB · 100%
How the weights are stored.
U3231.4B · 100%
From the Hugging Face model README
An MLX mixed-precision quantization of TheDrummer/Skyfall-31B-v4.2 for inference on Apple Silicon using the mlx-lm framework.
Skyfall-31B-v4.2 is a 31-billion parameter dense language model fine-tuned by TheDrummer for creative writing and roleplay. It is built on the Mistral-Small-3.2-24B-Instruct base, upscaled to 31B parameters, and trained to excel at storytelling, character interpretation, and creative dialogue. It prioritizes expressive generation quality over factual benchmark performance.
| Property | Value |
|---|---|
| Architecture | MistralForCausalLM (dense) |
| Parameters | ~31B |
| Layers | 54 |
| Attention heads | 32 (8 KV heads, GQA, head dim 128) |
| Hidden size | 5,120 |
| Intermediate size | 32,768 |
| Vocabulary | 131,072 tokens |
| Context length | 131,072 tokens (128K) |
| Base dtype | bfloat16 |
This is a mixed 4/8-bit quantization using the MLX affine scheme (group_size: 64). Layers that are most sensitive to precision loss (embeddings, attention projections, early and final layers) are preserved at 8-bit; the majority of the feed-forward weights are compressed to 4-bit.
| Bit width | Layer count |
|---|---|
| 8-bit | 276 |
| 4-bit | 104 |
| Total quantized | 380 |
This is a higher-fidelity profile than a uniform 4-bit quant — the 8-bit-heavy mix preserves more of the creative generation quality that makes Skyfall distinctive.
Disk size: ~23 GB across 5 safetensors shards.
This is the second quantization pass (-v2). Two bugs in the first attempt caused incoherent or repetitive output:
1. RoPE theta misconfiguration (critical — caused incoherent output)
transformers 5.0 writes rope_theta only inside a nested rope_parameters block in config.json. mlx_lm's llama.py (which handles model_type: mistral) declares rope_theta: float = 10000 at the top level and has no rope_parameters field, so from_dict silently discarded it. The model ran with θ=10,000 instead of the correct θ=1,000,000,000 — effectively no long-context positional encoding. Output was incoherent for anything beyond trivially short prompts.
Fix applied: rope_theta is hoisted from the nested block to the top level in config.json. The weights are unchanged; only the config layout was corrected. You can verify: jq .rope_theta config.json should return 1000000000.
2. Attention projection sensitivity (caused degenerate repetition)
With Grouped Query Attention (GQA) and only 8 KV heads, the k_proj and v_proj matrices are small (5120→1024). At 4-bit quantization, the error in these small tensors is disproportionately large relative to their contribution to attention. At standard sampling (temp=1.0, no repetition penalty) this caused persistent repetition loops. Raising all attention projections (q_proj, k_proj, v_proj, o_proj) to 8-bit eliminated the issue.
The 8-bit-heavy profile (276 layers at 8-bit) reflects these sensitivity findings.
This model requires Apple Silicon with the MLX framework.
| Configuration | Notes |
|---|---|
| Recommended | 32 GB unified memory (M3 Max / M4 Max / M2 Ultra or better) |
| Minimum | 24 GB unified memory (feasible; shorter contexts) |
At 32 GB you'll comfortably run 32K+ context; the full 128K window needs additional headroom.
Install dependencies:
pip install mlx-lm
CLI:
mlx_lm.generate \
--model cspenn/Skyfall-31B-v4.2-MLX-Mixed-4-8 \
--prompt "Continue this story: The lighthouse keeper had not seen another soul in three years, until the night a boat washed ashore with no one aboard." \
--max-tokens 512 \
--temp 0.8
Python:
from mlx_lm import load, generate
model, tokenizer = load("cspenn/Skyfall-31B-v4.2-MLX-Mixed-4-8")
prompt = (
"Continue this story: The lighthouse keeper had not seen another soul "
"in three years, until the night a boat washed ashore with no one aboard."
)
# Apply the model's chat template
messages = [{"role": "user", "content": prompt}]
formatted = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
response = generate(
model, tokenizer, prompt=formatted, max_tokens=512, temp=0.8, verbose=True
)
Tip: For creative writing, temperatures in the range of 0.7–1.0 give more varied and expressive output. For structured tasks, lower to 0.3–0.5.
mistralai/Mistral-Small-3.2-24B-Instruct → TheDrummer/Skyfall-31B-v4.2 (upscaled + fine-tuned) → this MLX mixed-4/8 quant
Apache 2.0 — inherited from the Mistral-Small base. See TheDrummer/Skyfall-31B-v4.2 for the upstream model terms.