Instructions to use stamsam/maple-preview-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use stamsam/maple-preview-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 stamsam/maple-preview-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf stamsam/maple-preview-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf stamsam/maple-preview-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf stamsam/maple-preview-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf stamsam/maple-preview-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf stamsam/maple-preview-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf stamsam/maple-preview-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf stamsam/maple-preview-gguf:Q4_K_M
Use Docker
docker model run hf.co/stamsam/maple-preview-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use stamsam/maple-preview-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stamsam/maple-preview-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stamsam/maple-preview-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/stamsam/maple-preview-gguf:Q4_K_M
- Ollama
How to use stamsam/maple-preview-gguf with Ollama:
ollama run hf.co/stamsam/maple-preview-gguf:Q4_K_M
- Unsloth Studio
How to use stamsam/maple-preview-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for stamsam/maple-preview-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for stamsam/maple-preview-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for stamsam/maple-preview-gguf to start chatting
- Pi
How to use stamsam/maple-preview-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stamsam/maple-preview-gguf:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "stamsam/maple-preview-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use stamsam/maple-preview-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stamsam/maple-preview-gguf:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default stamsam/maple-preview-gguf:Q4_K_M
Run Hermes
hermes
- OpenClaw new
How to use stamsam/maple-preview-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stamsam/maple-preview-gguf:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "stamsam/maple-preview-gguf:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use stamsam/maple-preview-gguf with Docker Model Runner:
docker model run hf.co/stamsam/maple-preview-gguf:Q4_K_M
- Lemonade
How to use stamsam/maple-preview-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull stamsam/maple-preview-gguf:Q4_K_M
Run and chat with the model
lemonade run user.maple-preview-gguf-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf stamsam/maple-preview-gguf:# Run inference directly in the terminal:
llama cli -hf stamsam/maple-preview-gguf:Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf stamsam/maple-preview-gguf:# Run inference directly in the terminal:
./llama-cli -hf stamsam/maple-preview-gguf:Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf stamsam/maple-preview-gguf:# Run inference directly in the terminal:
./build/bin/llama-cli -hf stamsam/maple-preview-gguf:Use Docker
docker model run hf.co/stamsam/maple-preview-gguf:β οΈ STATUS β READ THIS BEFORE DOWNLOADING
All three packs generate text on GPU:
maple-f16.gguf(385 tok/s, H200),97 tok/s on an RTX 4000 Ada; previously CPU-only)**, with the Maple-enabled llama.cpp fork at github.com/stamsam/llama.cpp (branchmaple-q4_k_m.gguf(GPU-verified), andmaple-tq2_0.gguf(prism, rev9ee03ee) β all layers GPU-offloaded.Mainline llama.cpp CANNOT run any of these files. The
maplearchitecture exists only in thestamsam/llama.cppfork (the PrismML upstream does not have it), and the fork's ternary format is not interchangeable with mainline types.Development artifacts of an ongoing port, shared openly.
Overview
This repository hosts GGUF conversions of deepgrove/maple-preview β a 20B-A1B ternary-weight Mixture-of-Experts reasoning LLM by DeepGrove (2026, MIT license) β plus the original BF16 checkpoint (in bf16-checkpoint/). The GGUF pipeline was built on the PrismML llama.cpp fork; the complete Maple runtime (converter + inference graph) lives in the stamsam/llama.cpp fork (branch prism).
Model summary
| Property | Value |
|---|---|
| Base model | deepgrove/maple-preview (MIT) |
| Family | Maple-Preview β 20B total params, ~1B active (A1B) |
| Layers | 24 |
| Hidden size | 2048 |
| Attention | GQA β 16 query heads, 4 KV heads, head_dim 128 |
| Attention pattern | 3:1 hybrid β SWA-512 (sliding window 512) : Global Attention (GA) |
| RoPE | Partial (64/128 dims, theta 10000) on SWA layers; no RoPE at all on GA layers |
| QK structure | Flash-head QK β per-head RMSNorm (q_norm/k_norm), k_proj at 512 dims |
| MoE | 256 experts, 8 active; moe_intermediate 512; clamp-7 SwiGLU; fp32 router renorm |
| Context length | 131072 |
| Vocab size | 151936 (no weight tying; no bias terms) |
| RMSNorm eps | 1e-6 |
| Stored weights | Per-row-scaled ternary: W β alpha_row * T, T in {-1,0,1} (~39% exact zeros) for experts and q/o projections; k_proj, lm_head, embeddings, router, norms stored denser |
| Checkpoint | ~40.4 GB BF16 Β· 20.214 B params Β· 18,651 tensors |
Hosted files
| File | Size | Notes |
|---|---|---|
maple-q4_k_m.gguf |
12.33 GB (measured) | Uniform Q4_K_M β runs (GPU) |
maple-tq2_0.gguf |
5.45 GB (measured) | Tiered: 168x fork ternary tq2_0 (type 35) + 2x Q4_0 + 121x F32 β runs (GPU, ~97 tok/s RTX 4000) |
maple-f16.gguf |
40.5 GB (measured) | Dense F16 reference; 291 GGUF tensors (18,651 HF tensors merged) |
bf16-checkpoint/ |
40.4 GB (20 files) | Original BF16 checkpoint β 9 safetensors shards + configs + tokenizer + modeling code |
Tensor counts and shapes were verified by post-write inspection (GGUFReader): 291 tensors, architecture key maple, per-tensor types confirmed (f16: F16/F32; tq2_0: 168x type-35 + 2x Q4_0 + 121x F32; q4_k_m: 145x Q4_K + 25x Q6_K + 121x F32).
Status
The Maple compute graph is implemented and verified in github.com/stamsam/llama.cpp (branch prism). All three packs generate coherent text (tested: "What is 2+2?" β "The answer is 4."): maple-f16.gguf and maple-q4_k_m.gguf with all layers offloaded to an NVIDIA H200, and maple-tq2_0.gguf on an RTX 4000 Ada at ~97 tok/s (CPU: ~5.5 tok/s) and on a Jetson Xavier at ~14.8 tok/s.
What the graph implements (matching the MLX reference deepgrove/maple-preview-2bit-mlx):
- Hybrid attention β 3:1 SWA-512:GA: sliding-window layers (window 512, partial 64/128-dim RoPE, theta 10000) with full-attention layers every 4th (il % 4 == 3) that carry no RoPE (n_rot = 0).
- Flash-head QK β per-head RMSNorm (
q_norm/k_norm) on the reshaped Q/K before RoPE; k_proj at 512 dims (4 KV heads x 128). - MoE β 256 experts, top-8,
moe_intermediate512, clamp-7 SwiGLU (silu(min(gate, +7)) * clip(up, -7, +7)), fp32 softmax + renormalized routing. - KV β sliding-window KV cache (window 512) for the SWA layers.
Known limitations:
- Ternary GPU support is new β
tq2_0(GGML type 35) got its CUDA kernels (dequant, get_rows, mmvq vec_dot) at fork rev9ee03ee; big-batch matmuls use the dequant+gemm path (mmq kernels not yet ported). - Fork-only β the
maplearch lives in stamsam/llama.cpp (branchprism); mainline llama.cpp and the PrismML upstream fork cannot load these files. - Early validation β verified for coherent generation on simple prompts; no benchmarks, perplexity, or systematic evals yet.
For reference implementations of the model itself:
- Apple Silicon: deepgrove/maple-preview-2bit-mlx (official MLX runtime)
- Elsewhere: the original PyTorch checkpoint (deepgrove/maple-preview) β or the
bf16-checkpoint/copy in this repo
Usage
These files only work with stamsam/llama.cpp (branch prism); mainline llama.cpp cannot load them.
# GPU (f16 or Q4_K_M packs)
llama-cli -m maple-q4_k_m.gguf -p "Your prompt here" -n 512
# Server (OpenAI-compatible API)
llama-server -m maple-q4_k_m.gguf --port 8080
maple-tq2_0.gguf runs the same way but executes on the CPU backend until CUDA kernels for the ternary type land. No Maple-specific CLI flags are required.
Quantization recipe
All steps run CPU-side on an NVIDIA H200 host: the converter and quantizer are CPU processes β no GPU compute is involved, and while CUDA is available to torch, it is unused in these steps.
- Convert:
convert_hf_to_gguf.py(PrismML fork, with the Maple converter in this fork) on thedeepgrove/maple-previewcheckpoint βmaple-f16.gguf(dense reference). - Quantize:
llama-quantizeonmaple-f16.gguf:maple-tq2_0.ggufβ per-tensor type mix mirroring the official maple-preview-2bit-mlx tiering:- fork ternary
tq2_0(type 35, ~2.06 bpw) forattn_q/attn_k/attn_v/attn_outputand allffn_*_exps; - Q4_0 for
token_embdandoutput(lm_head); - F32/F16 for routers and norms.
- fork ternary
maple-q4_k_m.ggufβ uniformQ4_K_Mover the entire model.
The maple architecture is registered in the fork's arch table with a dedicated llama_model_maple class (hparams, tensor map, and full compute graph). Note: an earlier attempt used the fork's type-42 Q2_0 layout, which the quantizer can write but no inference kernel can read β it was superseded by the type-35 tq2_0 format used in maple-tq2_0.gguf.
Caveats
- Fork-only formats, no interop: the fork's ternary
tq2_0(GGML type 35) and its Q2_0 variant (type 42) are custom layouts β mainline llama.cpp has different Q2_0/Q2_K types under the same names and cannot read these files. There is no compatibility layer. - CPU-only ternary:
maple-tq2_0.ggufhas no CUDA kernels yet β expect ~5.5 tok/s CPU throughput on a 96-core host, not H200 speed. - Q4 on ternary weights is wasteful: Maple's experts and q/o projections are already ternary in storage; a uniform
Q4_K_Mre-quantizes them to 4 bits with little precision benefit.maple-q4_k_m.ggufis a quantizer sanity check / compatibility data point, not the recommended format β the tieredmaple-tq2_0.ggufmirrors the intended storage layout. - Not the MLX format: the tiering philosophy matches the official MLX pack (2-bit ternary for projections+experts at 16 codes/u32, 4-bit for lm_head+embeddings at 8 codes/u32, BF16 for router+norms), but the binary formats differ. Files are not interchangeable between the two runtimes.
- Development artifacts, not a release: trial/experimental work on a custom fork; formats and tensor layouts may change without notice as the port progresses.
Development log
- Converted
deepgrove/maple-preview(BF16 checkpoint, 20.214 B params / 18,651 tensors) βmaple-f16.ggufvia the fork's converter (CPU, H200 host). - Quantized β
maple-tq2_0.gguf(tiered ternary pack: 168x type-35, 2x Q4_0, 121x F32) andmaple-q4_k_m.gguf(uniform Q4_K_M). - Post-write verification: tensor counts and shapes inspected against the source checkpoint (2026-08-04).
- Graph implemented + verified (2026-08-04): hybrid SWA/GA attention, flash-head QK, 256-expert clamp-7 SwiGLU MoE, fp32 renorm routing β f16 and Q4_K_M packs generate coherent text on an H200 (~385 tok/s at f16, all layers GPU-offloaded).
- Ternary GPU kernels (rev
9ee03ee): CUDA dequant + get_rows + mmvq vec_dot fortq2_0β verified on an RTX 4000 Ada at ~97 tok/s decode / ~111 tok/s prefill (CPU: 5.5 tok/s). - Jetson Xavier verified (2026-08-04):
maple-tq2_0.ggufruns CPU-only on the Xavier (aarch64, 8 cores, 14 GB RAM) at 14.8 tok/s decode / 37.5 tok/s prefill, coherent output. - Next phase: quality benchmarks vs the MLX reference, CUDA build for the Xavier (sm_72) once its toolkit is set up.
Credits
- Model: DeepGrove β deepgrove/maple-preview (MIT)
- Official on-device runtime: deepgrove/maple-preview-2bit-mlx
- Base tooling: PrismML llama.cpp fork
- Maple runtime fork + conversion + packaging: stamsam/llama.cpp β MIT
- Downloads last month
- -
2-bit
4-bit
16-bit
Model tree for stamsam/maple-preview-gguf
Base model
deepgrove/maple-preview
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf stamsam/maple-preview-gguf:# Run inference directly in the terminal: llama cli -hf stamsam/maple-preview-gguf: