Instructions to use tieubaoca/AREX-2-MTP-Draft 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 tieubaoca/AREX-2-MTP-Draft 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 tieubaoca/AREX-2-MTP-Draft:Q4_0 # Run inference directly in the terminal: llama cli -hf tieubaoca/AREX-2-MTP-Draft:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tieubaoca/AREX-2-MTP-Draft:Q4_0 # Run inference directly in the terminal: llama cli -hf tieubaoca/AREX-2-MTP-Draft:Q4_0
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 tieubaoca/AREX-2-MTP-Draft:Q4_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf tieubaoca/AREX-2-MTP-Draft:Q4_0
Use Docker
docker model run hf.co/tieubaoca/AREX-2-MTP-Draft:Q4_0
- Llama new
- LM Studio
- Jan
- Ollama
How to use tieubaoca/AREX-2-MTP-Draft with Ollama:
ollama run hf.co/tieubaoca/AREX-2-MTP-Draft:Q4_0
- Unsloth Desktop
- Pi
How to use tieubaoca/AREX-2-MTP-Draft with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tieubaoca/AREX-2-MTP-Draft:Q4_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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "tieubaoca/AREX-2-MTP-Draft:Q4_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use tieubaoca/AREX-2-MTP-Draft with Docker Model Runner:
docker model run hf.co/tieubaoca/AREX-2-MTP-Draft:Q4_0
- Lemonade
How to use tieubaoca/AREX-2-MTP-Draft with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tieubaoca/AREX-2-MTP-Draft:Q4_0
Run and chat with the model
lemonade run user.AREX-2-MTP-Draft-Q4_0
List all available models
lemonade list
- Hermes Agent
How to use tieubaoca/AREX-2-MTP-Draft with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tieubaoca/AREX-2-MTP-Draft:Q4_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:9931/v1 hermes config set model.default tieubaoca/AREX-2-MTP-Draft:Q4_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use tieubaoca/AREX-2-MTP-Draft with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tieubaoca/AREX-2-MTP-Draft:Q4_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:9931/v1 \ --custom-model-id "tieubaoca/AREX-2-MTP-Draft:Q4_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"
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf tieubaoca/AREX-2-MTP-Draft:Q4_0# Run inference directly in the terminal:
llama cli -hf tieubaoca/AREX-2-MTP-Draft:Q4_0Build 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 tieubaoca/AREX-2-MTP-Draft:Q4_0# Run inference directly in the terminal:
./build/bin/llama cli -hf tieubaoca/AREX-2-MTP-Draft:Q4_0Use Docker
docker model run hf.co/tieubaoca/AREX-2-MTP-Draft:Q4_0AREX-2 MTP Draft
An experimental text-only Multi-Token Prediction (MTP) sidecar for BAAI AREX-2. It proposes draft tokens in llama.cpp while the separately loaded target model verifies them. This is a community project. The GGUF files are intended to be passed as --model-draft alongside the target.
The trained Q4_0 sidecar with a two-token draft budget ran at 30.61 decode tokens/s versus 20.15 tokens/s with drafting disabled on four harder prompts on one AMD Radeon Instinct MI50. The target accepted 893 of 1,272 proposals (70.2%). Greedy output text differed on all four prompts in that test. The result demonstrates decode throughput on this small sample, with limited evidence about answer quality or behavior on other setups.
Files
| File | Purpose |
|---|---|
mtp-BAAI_AREX-2-teacher-Q4_0.gguf |
Quantized MTP sidecar tested for inference |
mtp-BAAI_AREX-2-teacher-F16.gguf |
Reference sidecar with F16 MTP matrices |
teacher_mtp.pt |
PyTorch MTP state dict for training and export |
SHA256SUMS |
Integrity hashes for the three artifacts |
Both GGUFs retain F32 normalization weights and include the teacher's quantized shared embedding and output tensors. The full target model and visual projector are separate downloads. The checkpoint contains weights only.
Run in llama.cpp
Use a llama.cpp build supporting a separate draft-mtp GGUF sidecar. This example used a ROCm build and the bartowski AREX-2 Q5_K_M target. Set LLAMA_SERVER to the binary and TARGET to the local BAAI_AREX-2-Q5_K_M.gguf path. Set DRAFT to the downloaded Q4_0 file.
export HSA_OVERRIDE_GFX_VERSION=9.0.6
export GGML_CUDA_NO_PINNED=1
"$LLAMA_SERVER" -m "$TARGET" -md "$DRAFT" \
--spec-type draft-mtp --spec-draft-n-max 2 \
-ngl 99 -ngld 99 --fit off --load-mode none --no-warmup \
-c 768 -np 1 --host 127.0.0.1 --port 8080
The ROCm environment variables and load mode reflect the tested MI50 setup. Wait for /health to report ready. Warm up with a short completion request before timing. For a non-speculative baseline, restart the server with the same target and settings and omit -md, -ngld, and both --spec-* options. Compare requests at the same seed, temperature, and decode budget with prompt caching disabled. The training repository includes benchmark prompts and a request example. Pipeline and benchmark instructions
Training and provenance
- Teacher and runtime target. BAAI AREX-2, using Bartowski's Q5_K_M GGUF. The extractor collected the same nextn hidden representation used by the MTP runtime. AREX-2 ยท Teacher GGUF
- Initialization. Fifteen tensors from a local Qwen3.8-27B MTP Q4_0 GGUF. Its metadata credits Unsloth for the conversion and Qwen for the base weights. Qwen3.8-27B
- Data. Forty-five technical seed prompts yielded 38 training and 7 validation sequences after splitting by prompt family. The teacher generated up to 40 greedy continuation tokens per prompt. The training labels are teacher-selected token IDs.
- Objective. At position
j, the draft consumes target hidden state atj-1plus the teacher's embedding of tokenj, then predicts tokenj+1through the fixed target LM head. The loss is cross-entropy over continuation tokens. The target, embeddings and head were frozen. - Optimization. One sequence per microbatch, FP16 autocast with gradient scaling, vocabulary projection in chunks of eight positions, AdamW, and gradient-norm clipping at 1.0. The selected run used a learning rate of
3e-6and four epochs. A short overfit probe was reset before the main run. - Selection. Epoch 1 reached 90.36% validation top-1 and loss 0.4026 on 280 tokens. The Qwen warm-start reached 85.00% and loss 0.5228. The earlier experimental checkpoint scored 0.71%. Selection prioritized validation top-1, with loss as the tiebreaker. Source and reproduction
Evaluation
One AMD Radeon Instinct MI50 with approximately 32 GiB VRAM. Tests used greedy raw-text completion, one request at a time. Decode throughput is total generated tokens divided by total decode time, excluding prompt processing. Acceptance is accepted draft tokens divided by proposed draft tokens.
Five short prompts, at most 48 generated tokens per prompt
| Configuration | Accepted / proposed | Decode tokens/s |
|---|---|---|
| Target only | โ | 20.77 |
| Qwen warm-start Q4_0 with AREX-2 shared tensors, one draft | 109 / 122 | 30.64 |
| Trained F16, one draft | 109 / 122 | 29.85 |
| Trained Q4_0, one draft | 108 / 122 | 29.93 |
| Trained Q4_0, up to two drafts | 138 / 188 | 31.54 |
Greedy output matched target-only on four of five prompts. On the remaining Python prompt, the function signature differed. Although held-out token prediction improved after fine-tuning, this one-draft runtime comparison did not show a gain over the warm-start. The warm-start was not measured with a two-token draft budget.
Four harder prompts, at most 384 generated tokens per prompt
| Task | Accepted / proposed | Draft on, tokens/s | Draft off, tokens/s |
|---|---|---|---|
| Count subarrays with sum K | 233 / 298 | 32.64 | 20.32 |
| Solve a five-digit reversal puzzle | 229 / 307 | 31.72 | 20.17 |
| Solve a Vietnamese conditional probability problem | 228 / 308 | 31.37 | 20.03 |
| Design a seat reservation API that handles races | 203 / 359 | 27.03 | 19.90 |
| Aggregate | 893 / 1,272 | 30.61 | 20.15 |
Every output reached the token limit. The draft-enabled answers included an unfinished digit-reversal proof and an incorrect second probability. Acceptance measures how often the runtime confirms draft proposals. Answer correctness and token-for-token agreement with target-only inference are separate measurements.
Intended use and limitations
Use as an experimental text-inference acceleration sidecar with the documented target and llama.cpp runtime. Validation covered a small technical seed dataset. The benchmarks do not establish behavior on image input, long-context workloads, other target quantizations, other accelerators, high concurrency, or sampling settings besides greedy decoding. Check performance and answer quality on representative workloads before adopting the sidecar.
License and attribution
Apache-2.0. This release contains modified Qwen-derived MTP weights and redistributes shared AREX-2 embedding and output tensors from the cited GGUF. See the included upstream license files and notices. The upstream model cards provide author credits and the citation for AREX-2. BAAI AREX-2 ยท Qwen3.8-27B
- Downloads last month
- 150
4-bit
16-bit
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf tieubaoca/AREX-2-MTP-Draft:Q4_0# Run inference directly in the terminal: llama cli -hf tieubaoca/AREX-2-MTP-Draft:Q4_0