Instructions to use kabcnd/Kenzan-Haru-4B-PinGrid-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- VibeVoice
How to use kabcnd/Kenzan-Haru-4B-PinGrid-GGUF with VibeVoice:
import torch, soundfile as sf, librosa, numpy as np from vibevoice.processor.vibevoice_processor import VibeVoiceProcessor from vibevoice.modular.modeling_vibevoice_inference import VibeVoiceForConditionalGenerationInference # Load voice sample (should be 24kHz mono) voice, sr = sf.read("path/to/voice_sample.wav") if voice.ndim > 1: voice = voice.mean(axis=1) if sr != 24000: voice = librosa.resample(voice, sr, 24000) processor = VibeVoiceProcessor.from_pretrained("kabcnd/Kenzan-Haru-4B-PinGrid-GGUF") model = VibeVoiceForConditionalGenerationInference.from_pretrained( "kabcnd/Kenzan-Haru-4B-PinGrid-GGUF", torch_dtype=torch.bfloat16 ).to("cuda").eval() model.set_ddpm_inference_steps(5) inputs = processor(text=["Speaker 0: Hello!\nSpeaker 1: Hi there!"], voice_samples=[[voice]], return_tensors="pt") audio = model.generate(**inputs, cfg_scale=1.3, tokenizer=processor.tokenizer).speech_outputs[0] sf.write("output.wav", audio.cpu().numpy().squeeze(), 24000) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use kabcnd/Kenzan-Haru-4B-PinGrid-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf kabcnd/Kenzan-Haru-4B-PinGrid-GGUF # Run inference directly in the terminal: llama cli -hf kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kabcnd/Kenzan-Haru-4B-PinGrid-GGUF # Run inference directly in the terminal: llama cli -hf kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf kabcnd/Kenzan-Haru-4B-PinGrid-GGUF # Run inference directly in the terminal: ./build/bin/llama cli -hf kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
Use Docker
docker model run hf.co/kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
- Llama new
- LM Studio
- Jan
- vLLM
How to use kabcnd/Kenzan-Haru-4B-PinGrid-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kabcnd/Kenzan-Haru-4B-PinGrid-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kabcnd/Kenzan-Haru-4B-PinGrid-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
- Ollama
How to use kabcnd/Kenzan-Haru-4B-PinGrid-GGUF with Ollama:
ollama run hf.co/kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
- Unsloth Desktop
- Docker Model Runner
How to use kabcnd/Kenzan-Haru-4B-PinGrid-GGUF with Docker Model Runner:
docker model run hf.co/kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
- Lemonade
How to use kabcnd/Kenzan-Haru-4B-PinGrid-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
Run and chat with the model
lemonade run user.Kenzan-Haru-4B-PinGrid-GGUF-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
- Kenzan-Haru-4B-PinGrid-GGUF
π’ Stock-Compatible: Works out-of-the-box in LM Studio / Ollama / stock
llama.cppβ The2.68 GiBlanguage backbone (Kenzan-Haru-4B-PinGrid-M6-16G.gguf,qwen35standardQ4_K_M/Q6_K/Q8_0) works out-of-the-box; the continuousMeanFlow+VibeVoiceaudio engine runs viaaudio_engine/haru_audio_loader.py(PyTorch MPS/CUDA).
Kenzan-Haru-4B-PinGrid-GGUF
β Support Local AI Development: Help me acquire a Mac mini 24GB/32GB to optimize and test local MoE models up to 80B parameters. Donate via Ko-fi β
Kenzan-Haru-4B-PinGrid β "275.76x Outliers Tamed, One-Step MeanFlow Intact, 3.80 GiB Total on a 16 GB Mac mini." Dissected autonomously by
Kenzan-Surgeon-27Bacross 1,022 tensors: we separated the 32-layer hybrid GatedDeltaNet + GQA language backbone (2.68 GiBGGUF) from the 1-Step MeanFlow + 24 kHz VibeVoice continuous audio engine (1.12 GiBW8A16/BF16), pinned theOR = 93.93anchor query and tied 248K embeddings, and slashed WikiText-2 Perplexity by-2.48points (-14.3%) over naiveQ4_K_Mwhile cruising at1,376 t/sprompt ingest and39.2 t/sgeneration on Apple M6.
Model Summary
Kenzan-Haru-4B-PinGrid (3.80 GiB Split-Engine Bundle: 2.68 GiB GGUF LM + 1.12 GiB PinGrid Audio Engine) β Surgical mixed-precision compression of higurashi-ai/Haru-4B (5.27B parameters, 10.54 GB BF16 across 1,022 tensors) engineered for Apple Silicon 16 GB Unified Memory (Mac mini M6).
Unlike stock BF16 (9.83 GiB), which triggers Metal kIOGPUCommandBufferCallbackErrorOutOfMemory during autoregressive generation on a 16 GB Mac mini due to its massive 248,320-vocab tied logit head (1.27 GB) and 24 recurrent GatedDeltaNet state buffers, Kenzan-Haru-4B-PinGrid compresses the entire multimodal system by $2.62\times$ down to 3.80 GiB while protecting every single extreme outlier tensor identified by our autonomous Kenzan-Surgeon-27B profiler.
1. Model Overview & Kenzan Pin-Grid Architecture
1.1. Dissecting higurashi-ai/Haru-4B (1,022 Tensors, 5.27B Params)
Full-tensor streaming analysis (haru_4b_analysis.json / MODEL_PASSPORT.md) revealed four distinct subsystems with vastly different quantization physics:
| Subsystem | Tensors | Params | BF16 Size | Max Outlier Ratio ($\text{OR} = \max|W|/\text{RMS}$) | Kenzan Target Format | Compressed Size |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| lm.* (qwen3_5_text Backbone) | 426 | 4.21B (79.8%) | 7.85 GiB | 93.93 (blk.3.attn_q) | PinGrid GGUF (5.45 bpw) | 2.68 GiB |
| codec.* (VibeVoice 24 kHz Codec) | 552 | 687.4M (13.0%) | 1.28 GiB | 62.82 | Hybrid BF16 Stems + W8A16 Conv | 0.72 GiB |
| head.* (1-Step MeanFlow ODE) | 32 | 363.4M (6.9%) | 0.68 GiB | 275.76 (t_embed.fc2 / ada) | BF16 (ada/embed/final) + W8A16 (ffn) | 0.38 GiB |
| user/model_audio_proj.* + Latents | 12 | 13.5M (0.3%) | 0.03 GiB | 82.35 (model_audio_proj.fc2) | Exact BF16 | 0.025 GiB |
| Total Multimodal Complex | 1,022 | 5.27B (100%) | 9.84 GiB | 275.76 | Split-Engine PinGrid | 3.805 GiB |
1.2. Language Backbone Pin-Grid (Kenzan-Haru-4B-PinGrid-M6-16G.gguf)
The 32-layer qwen3_5_text backbone uses an interleaved [linear_attention Γ 3, full_attention Γ 1] Γ 8 architecture (24 GatedDeltaNet recurrent layers + 8 GQA 16:4 full-attention layers at indices 3, 7, 11, 15, 19, 23, 27, 31 with interleaved mrope). Naive 4-bit quantization (Q4_K_M) severely degrades perplexity (17.3480) due to three structural bottlenecks that our PinGrid recipe surgically anchors:
- Tied 248K Vocabulary & Logit Classifier (
token_embd.weight$[2560, 248320]$ $\to$Q6_K): Becausetie_word_embeddings = true,token_embd.weightsimultaneously acts as the outputlm_head. Crushing it toQ4_Kcorrupts all 248,320 logit dot products (including speech control tokens248044..248076). Anchoringtoken_embd.weightinQ6_Kpreserves logit phase geometry. - First Full-Attention Anchor (
blk.3.attn_q.weight$\to$Q8_0,attn_k/v$\to$Q6_K): Layer 3 is the first global Softmax attention layer following three GatedDeltaNet recurrent layers (0, 1, 2) and exhibits the highest outlier ratio in the entire language model ($\text{OR} = 93.93$, $\max |W| = 21.50$). We pinblk.3.attn_q.weightinQ8_0, all 8 layers'attn_kandattn_vinQ6_K, tail layerblk.31.attn_q/outputinQ6_K, and remainingattn_q/outputinQ5_K. - GatedDeltaNet Recurrent Gates & Output Projections (
ssm_alpha/beta$\to$Q8_0,ssm_out$\to$Q8_0/Q6_K): In the GatedDeltaNet state update $\mathbf{S}t = \alpha_t \mathbf{S}{t-1}(\mathbf{I} - \beta_t \mathbf{k}_t \mathbf{k}_t^\top) + \beta_t \mathbf{v}_t \mathbf{k}_t^\top$,A_log,dt_bias,conv1d, andssm_normstay in exactF32,ssm_alpha(in_proj_a) andssm_beta(in_proj_b) are pinned inQ8_0, andssm_out(out_proj, reaching $\text{OR} = 82.69$ onblk.0and $71.91$ onblk.1) is pinned inQ8_0(blk.0, 1) andQ6_K(blk.2..30). - Tail SwiGLU Down-Projections (
ffn_down$\to$Q8_0/Q6_K): Layers28($\text{OR} = 80.88$) and31($\text{OR} = 87.95$) are pinned inQ8_0, while high-outlier layers0, 21, 22, 23, 24, 25, 26, 27, 29, 30($\text{OR} \in [48.8, 77.4]$) are anchored inQ6_K.
1.3. Continuous Audio Engine (audio_engine/Kenzan-Haru-4B-Audio-PinGrid.safetensors)
Because Haru-4B synthesizes 24 kHz speech via a 1-Step MeanFlow ODE generator (num_steps = 1) coupled with the VibeVoice continuous acoustic codec ($3200\times$ upsampling, $7.5\text{ Hz}$ frame rate, $\text{latent_dim} = 64$), there are zero iterative denoising steps to average out quantization error:
- All 493 sensitive tensors β including
head.t_embed.*($\text{OR} = 275.76$),head.h_embed.*($\text{OR} = 143.54$),head.omega_embed.*($\text{OR} = 134.96$),head.layers.0..3.ada.weight($\text{OR} = 89.95..129.57$),head.final.*,user_audio_proj.*($\text{OR} = 72.25$),model_audio_proj.*($\text{OR} = 82.35$), and codec stems/norms β are preserved in exact nativeBF16. - The 103 heavy internal matrices/convolutions (
head.layers.*.ffn.*and internalcodec.*stages) are compressed to per-channel symmetricW8A16(INT8weights +BF16scales) achieving a verified38.73 dBmean SQNR (32.61 dBmin SQNR) and shrinking the audio engine from2.13 GBto1.12 GiB.
2. Verified Benchmarks (Apple Silicon Mac mini M6, 16 GB Unified Memory)
Evaluated using /Users/agent/bonsai/llama-clover (build ed26f2f, Apple Metal4 + SME2) on wt2_holdout_128k.txt (-c 1024 -b 256 -ub 256 --chunks 8 -ngl 99 -fa on) and llama-bench (-p 512 -n 128 -ngl 99 -fa on):
| Model Variant | LM GGUF Size | Total Multimodal Footprint | Prompt Processing (pp512) |
Token Generation (tg128) |
WikiText-2 Holdout Perplexity (PPL) |
16 GB Mac mini M6 Status |
|---|---|---|---|---|---|---|
higurashi-ai/Haru-4B (Stock BF16) |
7.85 GiB | 9.84 GiB | 1,321.06 Β± 1.99 t/s | OOM (Metal Status 5) |
OOM on 1024-ctx eval | β Crashes on tg in 16 GB RAM |
Haru-4B-LM (Naive Q4_K_M, unpinned) |
2.52 GiB | 4.51 GiB | 1,384.10 t/s | 41.69 t/s | 17.3480 Β± 0.76551 |
β οΈ Severe logit/outlier degradation |
Kenzan-Haru-4B-PinGrid-M6-16G (Ours) |
2.68 GiB |
3.80 GiB |
1,376.46 t/s |
39.18 t/s |
14.8695 Β± 0.64803 (-2.48 PPL / -14.3%) |
β Rock-solid inside 16 GB RAM |
3. Repository Contents
Kenzan-Haru-4B-PinGrid-M6-16G.gguf(2.68 GiB) β PinGrid-quantized 32-layerQwen3.5hybrid language backbone (general.architecture = qwen35).haru4b_imatrix.gguf(7.26 MB) β Calibration importance matrix across all 248 linear/attention/MLP weight tensors.audio_engine/Kenzan-Haru-4B-Audio-PinGrid.safetensors(1.12 GiB) β PinGrid-compressedMeanFlow1-step audio head +VibeVoice24 kHz codec + audio projections (38.73 dBmean SQNR).audio_engine/haru_audio_loader.pyβ Zero-dependency PyTorch (mps/cuda/cpu) loader that transparently dequantizesW8A16tensors on load.audio_engine/audio_pingrid_manifest.jsonβ Compression and SQNR telemetry for the audio engine.recipes/tensor_types_haru_pingrid.txtβ Exact--tensor-typeregex recipe used forllama-quantize.MODEL_PASSPORT.md&MODEL_PASSPORT.jsonβ Autonomous structural inspection passport generated byKenzan-Surgeon-27B.
4. Quick Start & Recommended Deployment (Apple Silicon 16 GB)
1. Download the Split-Engine Release
huggingface-cli download kabcnd/Kenzan-Haru-4B-PinGrid-GGUF \
Kenzan-Haru-4B-PinGrid-M6-16G.gguf \
audio_engine/Kenzan-Haru-4B-Audio-PinGrid.safetensors \
audio_engine/haru_audio_loader.py \
--local-dir ./Kenzan-Haru-4B-PinGrid
2. Launch the Qwen3.5 Hybrid Language Backbone (llama-server)
Requires a llama.cpp build with QWEN35 (gated_delta_net) support (such as llama-clover or recent upstream llama.cpp):
llama-server \
-m ./Kenzan-Haru-4B-PinGrid/Kenzan-Haru-4B-PinGrid-M6-16G.gguf \
--host 127.0.0.1 --port 11442 \
-ngl 99 --no-host -fa on \
-c 32768 --cache-type-k q8_0 --cache-type-v q8_0 \
-np 1 -b 512 -ub 512 -t 4 \
--jinja --metrics \
--temp 0.60 --top-p 0.95 --top-k 40 --min-p 0.05 \
--repeat-penalty 1.05 \
--alias kenzan-haru:4b
3. Load the Continuous Audio Engine (MeanFlow + VibeVoice) in Python (Apple Metal mps)
import torch
from audio_engine.haru_audio_loader import load_haru_audio_engine
audio_state_dict = load_haru_audio_engine(
"./Kenzan-Haru-4B-PinGrid/audio_engine/Kenzan-Haru-4B-Audio-PinGrid.safetensors",
device="mps",
dtype=torch.bfloat16,
)
print(f"Loaded {len(audio_state_dict)} audio engine tensors on Apple Metal (MPS)!")
Acknowledgements & Inspiration
- Inspired by Bonsai-2 & Prism ML: Deep gratitude and inspiration go to the creators of Bonsai-2 at Prism ML (huggingface.co/prism-ml) for pioneering ternary quantization (
PTQ1_0/PQ2_0), blockwise Hadamard phase stabilization, and proving that frontier-class models can thrive on consumer unified memory. - Special Thanks to Misha: Sincere gratitude to Misha for unwavering support and financial assistance, which made the hardware testing, autonomous
Kenzan-Surgeon-27Bharness runs, calibration sweeps, and open-weights releases in the Kenzan series possible. - Base Model & Ecosystem: Built upon higurashi-ai/Haru-4B and the open-source
llama.cppMetal ecosystem.
Support the Project & Funding Goals
All Kenzan weights, calibration recipes, Metal patches, and kenzan_router.py tooling are released openly and free of charge for the local AI community. If this model saved you cloud API costs or helped you run multimodal and reasoning models locally on a base Mac, please consider supporting future releases:
What Your Donations Directly Fund
- Upgrading to a Mac mini 24 GB / 32 GB (Apple Silicon): Breaking past the 16 GB ceiling to quantize, calibrate, and benchmark 70Bβ80B ternary-hybrid MoE and multimodal models with wider pin grids at 70β100+ t/s.
- Cloud GPU Compute for I-Matrix & Calibration Sweeps: Covering cloud VRAM hours needed for full-precision importance-matrix (
imatrix) generation, leave-one-out (LOO) layer sensitivity sweeps, and multi-corpus perplexity verification. - Open-Source Metal Kernels & Autonomous Surgeon Tooling: Funding continued development of fused Metal kernels,
llama.cpppatches, and the autonomousKenzan-Surgeonmodel-engineering harness for the local-first community.
- Downloads last month
- 497
We're not able to determine the quantization variants.
Model tree for kabcnd/Kenzan-Haru-4B-PinGrid-GGUF
Base model
higurashi-ai/Haru-4B