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"
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:BF16Build 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:BF16Use Docker
docker model run hf.co/AXERA-TECH/Qwen3.5-4B-AX8860-llama.cpp:BF16YAML 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 上下文。 Qwen3.5-4B with text and image input on the 4-core NPU of the Axera AX8860, with llama.cpp; 16k context.
文件 / 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 板端程序与共享库(run.sh 设置 LD_LIBRARY_PATH;还需系统 /opt/lib 与 libc)/ the board programs and shared libraries (run.sh sets LD_LIBRARY_PATH; the system /opt/lib and libc are also needed) |
kernels/ |
NPU kernel + manifest.json:prefill、16 层 decode group(两组)、输出头、3072-patch ViT、两个 IO 描述 kernel / the NPU kernels + manifest.json: prefill, a 16-layer decode group (two groups), the output head, the 3072-patch ViT, two IO descriptor kernels |
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
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:<repo>/bin GGML_AXERA_KERNEL_DIR=<repo>/kernels,-ngl 99,-c 不超过 16384,服务端 -np 1。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.6 tokens/s |
| 图像编码 / image encoding(3072 patch = 768 图像 token / image tokens) | 0.20 s |
正确性 / Correctness
- "The capital of France is" → "Paris. …";图像描述正确(车辆、文字、人物)/ image descriptions correct.
- 中文 PPL(内部测试集,
-c 512):25.57,同一 GGUF 在 CPU 上 25.15 / Chinese PPL on an internal set: 25.57 (the same GGUF on the CPU: 25.15). - 同一输入多次运行,结果偶有极小差异(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(ggml/src/ggml-axera/models/qwen35_whole) - kernel:ZHEQIUSHUI/ax-dsl-kernels
main@7d7185f(models/qwen35_4b,kernels.md5)
- Downloads last month
- -
4-bit
Install (macOS, Linux)
# 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