GGUF
English
maple
Mixture of Experts
reasoning
npu
amd
ryzen-ai
fastflowlm
q4nx
xdna2
conversational
Instructions to use phantomic12/maple-preview-20b-q4nx 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 phantomic12/maple-preview-20b-q4nx 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 phantomic12/maple-preview-20b-q4nx:TQ2_0 # Run inference directly in the terminal: llama cli -hf phantomic12/maple-preview-20b-q4nx:TQ2_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf phantomic12/maple-preview-20b-q4nx:TQ2_0 # Run inference directly in the terminal: llama cli -hf phantomic12/maple-preview-20b-q4nx:TQ2_0
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 phantomic12/maple-preview-20b-q4nx:TQ2_0 # Run inference directly in the terminal: ./llama-cli -hf phantomic12/maple-preview-20b-q4nx:TQ2_0
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 phantomic12/maple-preview-20b-q4nx:TQ2_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf phantomic12/maple-preview-20b-q4nx:TQ2_0
Use Docker
docker model run hf.co/phantomic12/maple-preview-20b-q4nx:TQ2_0
- LM Studio
- Jan
- Ollama
How to use phantomic12/maple-preview-20b-q4nx with Ollama:
ollama run hf.co/phantomic12/maple-preview-20b-q4nx:TQ2_0
- Unsloth Desktop
- Pi
How to use phantomic12/maple-preview-20b-q4nx with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf phantomic12/maple-preview-20b-q4nx:TQ2_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "phantomic12/maple-preview-20b-q4nx:TQ2_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use phantomic12/maple-preview-20b-q4nx with Docker Model Runner:
docker model run hf.co/phantomic12/maple-preview-20b-q4nx:TQ2_0
- Lemonade
How to use phantomic12/maple-preview-20b-q4nx with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull phantomic12/maple-preview-20b-q4nx:TQ2_0
Run and chat with the model
lemonade run user.maple-preview-20b-q4nx-TQ2_0
List all available models
lemonade list
- Hermes Agent
How to use phantomic12/maple-preview-20b-q4nx with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf phantomic12/maple-preview-20b-q4nx:TQ2_0
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 phantomic12/maple-preview-20b-q4nx:TQ2_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use phantomic12/maple-preview-20b-q4nx with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf phantomic12/maple-preview-20b-q4nx:TQ2_0
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 "phantomic12/maple-preview-20b-q4nx:TQ2_0" \ --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"
Maple-Preview 20B (Q4NX & TQ2_0 Quantized for FastFlowLM / AMD Ryzen AI NPU)
This repository contains the FastFlowLM Q4NX & TQ2_0 quantized weights of DeepGrove's Maple-Preview (20B-A1B ternary reasoning MoE model), optimized for high-speed inference on AMD Ryzen AI NPUs (XDNA 2 / Strix Point) and modern AVX2/FMA CPUs.
๐ Model & Runtime Highlights
- Base Architecture: 20B Total Parameters (~1B active per token, 256 experts with Top-8 routing).
- Hybrid 3:1 Attention: 18 Sliding Window Attention layers (512-token span) + 6 Full Global Attention layers.
- Native 128K Context Window: Full 131,072 token context support with $O(1)$ constant 18.9 MB SWA memory overhead.
- Hardware NPU Acceleration: Achieves >185โ202 tokens/second on AMD Ryzen AI 9 HX 370 NPU (
/dev/accel/accel0). - OpenAI-Compatible REST Server: Native
/v1/chat/completionsand streaming<think>reasoning support.
๐ฆ File Inventory
model.q4nx: FastFlowLM packed ternary/quantized weights for NPU & CPU runtime.maple-preview-TQ2_0-head-Q4_K.gguf: GGUF format checkpoint for cross-runtime compatibility.config.json: Architecture configuration and hyperparameter specifications.tokenizer.json&tokenizer_config.json: Byte-level BPE tokenizer (151,936 vocabulary).chat_template.jinja: Jinja chat template with reasoning toggle (<think> ... </think>).
๐ ๏ธ Quickstart with FastFlowLM
1. Clone Runtime & Setup
git clone https://github.com/phantomic12/maple-flm.git
cd maple-flm
bash install.sh
2. Download Weights via Hugging Face CLI (hf)
hf download phantomic12/maple-preview-20b-q4nx --local-dir models/maple-preview-20b
3. Run Inference on NPU
# Interactive Chat
bash scripts/chat_maple.sh
# Launch OpenAI-Compatible REST Server
bash scripts/serve_maple.sh
# Run Hardware Benchmarks
bash scripts/benchmark_npu.sh
๐ Performance Benchmarks (AMD Ryzen AI 9 HX 370 NPU)
| Context Length | Prefill Speed | Decode Speed | Memory Footprint |
|---|---|---|---|
| 4K Context | 199.6 tok/s | 190.2 tok/s | ~5.6 GB RAM |
| 32K Context | 200.1 tok/s | 187.9 tok/s | ~5.9 GB RAM |
| 128K Context | 202.6 tok/s | 185.6 tok/s | ~7.1 GB RAM |
| 1M Context (Extreme) | 193.2 tok/s | 175.4 tok/s | ~18.4 GB RAM |
๐ Citation & Credits
- Original Model: deepgrove/maple-preview
- FastFlowLM Runtime: ROCm/FastFlowLM
- Port & Optimizations: phantomic12/maple-flm
- Downloads last month
- 61
Hardware compatibility
Log In to add your hardware
2-bit
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for phantomic12/maple-preview-20b-q4nx
Base model
deepgrove/maple-preview