Instructions to use AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp 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 AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp 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 AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
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 AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: ./build/bin/llama cli -hf AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
Use Docker
docker model run hf.co/AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
- Llama new
- LM Studio
- Jan
- Ollama
How to use AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp with Ollama:
ollama run hf.co/AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
- Unsloth Desktop
- Pi
How to use AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
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": "AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp with Docker Model Runner:
docker model run hf.co/AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
- Lemonade
How to use AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
Run and chat with the model
lemonade run user.Qwen3.5-4B-AX8860-llama.cpp-BF16
List all available models
lemonade list
- Hermes Agent
How to use AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
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 AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16
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 "AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16" \ --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"
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Qwen3.5-4B on AX8860 (llama.cpp + ggml-axera, 2026-11-05)
在爱芯 AX8860 的 NPU(4 核)上用 llama.cpp 运行 Qwen3.5-4B,支持文本和图像输入;16k 上下文;服务端可选用模型自带的 MTP 头做投机解码。 Qwen3.5-4B with text and image input on the 4-core NPU of the Axera AX8860, with llama.cpp; 16k context; the server can decode speculatively with the model's own MTP head.
文件 / Files
| 文件 / File | 说明 / Description |
|---|---|
qwen3.5-4b-mxfp4.gguf |
模型权重(GGUF MXFP4,2.66 GB,md5 e82f054c77152821eb8edd5ae572f2eb)/ weights |
mmproj-qwen3.5-4b-bf16.gguf |
视觉编码器权重(BF16,676 MB,md5 d64c1da66e6bd59ecbec5d57ccc13ec7)/ vision encoder weights |
bin/ |
llama.cpp 板端程序(静态链接,只依赖系统 /opt/lib 与 libc)/ the board programs (static; need only the system /opt/lib and libc) |
kernels/ |
NPU kernel + manifest.json:prefill、16 层 decode group(两组)、输出头、3072-patch ViT、两个 IO 描述 kernel;投机解码用的 verify(4 行验证)、MTP 头(2 个)、草稿词表头 + draft_vocab.i32 / the NPU kernels + manifest.json: prefill, a 16-layer decode group (two groups), the output head, the 3072-patch ViT, two IO descriptor kernels; for speculative decoding the verify (4 rows), the MTP head (2 kernels), the draft-vocabulary head + draft_vocab.i32 |
run.sh |
运行脚本 / run script |
权重只来自 GGUF:kernel 不含权重,加载时从 GGUF 转换到 NPU(约 9 s);NPU 内存里只放一份权重(prefill 和 decode 共用)。 The weights come only from the GGUFs: the kernels hold none; they are converted from the GGUF at load (~9 s); one copy of the weights in NPU memory (shared by prefill and decode).
运行 / Run
环境 / Requirements:AX8860,SDK V0.5.0 或更新(cat /proc/ax_proc/version)/ SDK V0.5.0 or newer.
./run.sh "The capital of France is" 64 # 文本补全 / text completion
./run.sh -i bus.jpg "Describe this image." 256 # 图像描述 / describe an image
./run.sh -c # 命令行多轮对话 / multi-turn chat in the terminal
./run.sh -s 8080 # OpenAI 兼容服务 / OpenAI-compatible server
MTP=1 ./run.sh -s 8080 # 服务端 MTP 投机解码 / the server with MTP speculative decoding
curl http://<board>:8080/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"messages":[{"role":"user","content":"你好"}]}'
直接调用程序时设置 / When calling the programs directly: LD_LIBRARY_PATH=/opt/lib GGML_AXERA_KERNEL_DIR=<repo>/kernels,-ngl 99,-c 不超过 16384,服务端 -np 1;投机解码(只有 llama-server 支持)--spec-type draft-mtp --spec-draft-n-max 3,不加则为普通解码 / speculative decoding (llama-server only) --spec-type draft-mtp --spec-draft-n-max 3; without it: plain decoding。GGML_AXERA_PROF=1 退出时打印各阶段耗时 / prints per-stage times at exit。
性能 / Performance
AX8860,SDK V0.5.1,NPU 4 核 / 4 cores,贪心解码 / greedy decoding:
| 项 / Item | 值 / Value |
|---|---|
| 加载后 NPU 内存(CMM)/ NPU memory after load | 3.4 GB |
| 加载后系统内存 / host memory after load | 1.0 GB |
| 加载 / load | 9 s(服务端 / server 21 s) |
| 4k prompt prefill(4008 token) | 7.7k tokens/s(每 256 token 页 32.6 ms / 32.6 ms per 256-token page) |
| decode(短上下文 / short context) | 60 tokens/s(服务端长回答 / server, long answers 53 - 55) |
| 图像编码 / image encoding(3072 patch = 768 图像 token / image tokens) | 0.20 s |
MTP 投机解码(服务端,贪心,同一组请求,tokens/s)/ MTP speculative decoding (server, greedy, the same requests, tokens/s):
| 回答 / Answer | 普通 / plain | MTP |
|---|---|---|
| 数学推理(700 token)/ maths reasoning | 54.5 | 78.5 |
| 代码(700 token)/ code | 55.0 | 69.1 |
| 翻译 / translation | 54.0 | 65.1 |
| 事实列表(700 token)/ a list of facts | 53.7 | 64.6 |
| 中文讲解(800 token)/ a Chinese explanation | 53.8 | 61.6 |
| 英文作文(800 token)/ an English essay | 53.9 | 55.9 |
| 英文小说(1500 token)/ an English story | 53.6 | 53.7 |
| 中文作文 / a Chinese essay | 52.9 | 48.8 |
收益取决于草稿的接受率:结构化的内容(代码、推理、列表)快 15 - 45%,自由写作基本不变,所以默认不开 / the gain follows the draft acceptance: 15 - 45% on structured text (code, reasoning, lists), none on free prose, hence off by default.
正确性 / Correctness
- "The capital of France is" → "Paris. …";图像描述正确(车辆、文字、人物)/ image descriptions correct.
- 中文 PPL(内部测试集,
-c 512 --chunks 3):prefill 30.73,逐 token decode(-b 1)30.56,投机解码的 4 行验证(-ub 4)30.53;同一 GGUF 在 CPU 上 30.10 / Chinese PPL on an internal set: 30.73 through the prefill, 30.56 through the token-by-token decode (-b 1), 30.53 through the 4-row verification (-ub 4); the same GGUF on the CPU: 30.10. - 本版修正了上一版 decode 的一个错误(
manifest.json把 decode 包里 delta-net 的两组缩放标成了 MXFP8,decode 的 PPL 为 48.7,长回答容易重复);kernel 文件不变 / this release fixes a decode error of the previous one (manifest.jsontagged two delta-net scale sets of the decode packs as MXFP8: decode PPL 48.7, long answers prone to repetition); the kernel files are unchanged. - 投机解码的输出由目标模型逐个验证,与普通解码质量一致(两者累加顺序不同,长回答可能在近似平局处分叉)/ every speculative token is verified by the target model: the quality equals plain decoding (the two accumulate in a different order, so long answers may diverge at near-ties).
- 同一输入多次运行,结果偶有极小差异(NPU 上累加顺序不固定),不影响输出质量。 Repeated runs of one input may differ slightly (the NPU's accumulation order varies); the output quality is the same.
已知限制 / Known limits
- 运行时独占 NPU 4 核,同时运行其他 NPU 程序会出错 / takes all 4 NPU cores; do not run other NPU programs alongside.
- 单序列:服务端须
-np 1/ one sequence: the server needs-np 1. - 上下文最大 16384 / the context is at most 16384.
源码 / Sources
- llama.cpp:ZHEQIUSHUI/llama.cpp
axera-dev@57a30bd(ggml/src/ggml-axera/models/qwen35_whole) - kernel:ZHEQIUSHUI/ax-dsl-kernels
fix/qwen35-4b-manifest@4822156(models/qwen35_4b/whole,qwen35_4b.manifest.json,kernels.md5)
- Downloads last month
- 117
4-bit