Instructions to use AXERA-TECH/Qwen3.8-27B-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.8-27B-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.8-27B-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/Qwen3.8-27B-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.8-27B-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/Qwen3.8-27B-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.8-27B-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: ./build/bin/llama cli -hf AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp:BF16
Use Docker
docker model run hf.co/AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp:BF16
- Llama new
- LM Studio
- Jan
- Ollama
How to use AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp with Ollama:
ollama run hf.co/AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp:BF16
- Unsloth Desktop
- Pi
How to use AXERA-TECH/Qwen3.8-27B-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.8-27B-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.8-27B-AX8860-llama.cpp:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp with Docker Model Runner:
docker model run hf.co/AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp:BF16
- Lemonade
How to use AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AXERA-TECH/Qwen3.8-27B-AX8860-llama.cpp:BF16
Run and chat with the model
lemonade run user.Qwen3.8-27B-AX8860-llama.cpp-BF16
List all available models
lemonade list
- Hermes Agent
How to use AXERA-TECH/Qwen3.8-27B-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.8-27B-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.8-27B-AX8860-llama.cpp:BF16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AXERA-TECH/Qwen3.8-27B-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.8-27B-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.8-27B-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.8-27B on AX8860 (llama.cpp + ggml-axera, 2026-11-05)
在爱芯 AX8860 的 NPU(4 核)上用 llama.cpp 运行 Qwen3.8-27B,支持文本和图像输入;一套 kernel 覆盖到 256k 上下文(8-bit KV cache),NPU 内存随 llama.cpp 的上下文长度(-c)分配;服务端用模型自带的 MTP 头做投机解码(每轮猜 3 个 token)。
Qwen3.8-27B with text and image input on the 4-core NPU of the Axera AX8860, with llama.cpp; one kernel set for contexts up to 256k (8-bit KV cache), the NPU memory allocated for the context llama.cpp is given (-c); the server decodes speculatively with the model's own MTP head (3 drafts per round).
文件 / Files
| 文件 / File | 说明 / Description |
|---|---|
qwen3.8-27b-mxfp4.gguf |
模型权重(GGUF MXFP4,14.8 GB,md5 32f5a603d4f75edb16ccf7ff3a35bdd6)/ weights |
mmproj-qwen3.8-27b-bf16.gguf |
视觉编码器权重(BF16,931 MB,md5 d2b989d06a0eb9109bab182ec2ff03f2)/ 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、decode、verify(投机解码的 4 行验证)、MTP 头(3 个)、ViT、输出头、草稿词表头 / the NPU kernels + manifest.json: prefill, decode, verify (4 rows, speculative decoding), the MTP head (3 kernels), ViT, output head, the draft-vocabulary head |
run.sh |
运行脚本 / run script |
权重只来自 GGUF:kernel 不含权重,加载时从 GGUF 转换到 NPU(约 65 s);NPU 内存里只放一份权重(prefill 和 decode 共用)。KV cache 以 8 bit(e4m3)存放:每个 KV 页只有 bf16 的一半,长上下文的 attention 读的数据也减半。 The weights come only from the GGUFs: the kernels hold none; they are converted from the GGUF at load (~65 s); one copy of the weights in NPU memory (shared by prefill and decode). The KV cache is stored in 8 bits (e4m3): a KV page is half the bytes of a bf16 one, and the attention of a long context reads half as much.
运行 / 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 兼容服务,MTP 投机解码 / OpenAI-compatible server, MTP speculative decoding
CTX=262144 ./run.sh -s 8080 # 256k 上下文 / the full 256k context
CTX=16384 ./run.sh -s 8080 # 16k 上下文,NPU 内存最省 / 16k context, the least NPU memory
curl http://<board>:8080/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"messages":[{"role":"user","content":"你好"}]}'
CTX 是传给 llama.cpp 的 -c(默认 131072,最大 262144):KV cache 的 NPU 内存按它分配,所以短上下文的场景把它调小即可省内存。
CTX is llama.cpp's -c (default 131072, up to 262144): the NPU memory of the KV cache is allocated for it, so a smaller value saves memory for short-context use.
直接调用程序时设置 / When calling the programs directly: LD_LIBRARY_PATH=/opt/lib GGML_AXERA_KERNEL_DIR=<repo>/kernels,-ngl 99,-c 不超过 262144,服务端 -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:
| 项 / Item | 值 / Value |
|---|---|
| 加载后 NPU 内存(CMM)/ NPU memory after load | CTX=16384 16.1 GB,CTX=131072(默认 / default)20.3 GB,CTX=262144 25.2 GB |
| 加载后系统内存 / host memory after load | 0.9 GB(峰值 / peak 1.9 GB) |
| 加载 / load | 63 - 68 s |
| 4k prompt(3619 token)prefill | 1107 tokens/s(3.27 s) |
| 1.7k prompt(1575 token)prefill | 974 tokens/s |
| decode,MTP 投机解码(服务端,短回答 / 400 token 长回答)/ MTP speculative decoding (server, short answers / a 400-token answer) | 22 - 23.5 / 20 tokens/s |
| decode,普通 / plain(短上下文 / short context) | 13.4 - 13.6 tokens/s |
| 64k prompt prefill / decode(64k 上下文 / context) | 803 tokens/s / 8.9 tokens/s(MTP 17.9 tokens/s) |
| 120k prompt prefill / decode(113k 上下文 / context) | 614 tokens/s / 7.7 tokens/s(MTP 13.6 tokens/s) |
| 图像编码 / image encoding(3072 patch = 768 图像 token / image tokens) | 0.28 s |
prefill 吞吐随 prompt 长度上升(每 256 token 一页,末页补齐,另有每次调用的固定开销);本套 256k kernel 的 prefill 比只支持 16k 的套件低约 10%(长上下文的 KV 布局与 8-bit KV 的代价)。 Prefill throughput rises with the prompt length (256-token pages, the last one padded, plus a fixed cost per call); this 256k kernel set prefills ~10% slower than a 16k-only set (the cost of the long-context KV layout and the 8-bit KV).
MTP:短上下文每轮接受 2.0 - 2.4 个 token,一轮约 100 ms(验证 75 ms,输出头 3 ms,3 个草稿 3 x 3.5 + 3 x 1.1 ms,host 8 ms);验证一次扫完整个 KV(4 行共用一次扫描),所以长上下文下 MTP 的收益更大(64k 上下文 17.9 对 8.9 tokens/s)。 MTP: 2.0 - 2.4 tokens accepted per round at a short context, a round ~100 ms (verify 75, output head 3, 3 drafts 3 x 3.5 + 3 x 1.1, host 8); a verification scans the whole KV once for its 4 rows, so MTP gains more at a long context (17.9 vs 8.9 tokens/s at 64k).
正确性 / Correctness
- "The capital of France is" → "Paris. …",与 bf16 KV cache 的版本输出相同;图像描述正确(车辆、文字、人物)/ the same output as the bf16-KV-cache version; image descriptions correct.
- 长文 PPL(
-c 4096,英文小说):4.286(bf16 KV cache:4.289)/ long-text PPL (-c 4096, an English novel): 4.286 (bf16 KV cache: 4.289);中文 PPL(内部测试集,-c 512):8.75(bf16 KV cache:8.78)/ Chinese PPL on an internal set: 8.75 (bf16 KV cache: 8.78). - 大海捞针 / needle in a haystack(一句暗号藏在小说 30% 处,末尾提问 / a code hidden at 30% of a novel, asked at the end):64k / 120k token 命中 / found at 64k / 120k tokens.
- 投机解码的输出与普通贪心解码一致(每个草稿 token 都经目标模型验证)/ speculative decoding gives the same output as plain greedy decoding (every draft token is verified by the target model).
- 同一输入多次运行,结果偶有极小差异(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. - 板子 16 GB 系统内存:
llama-perplexity的-c不超过 4096(它把整段上下文的 logits 放在系统内存里)/ with the board's 16 GB host memory,llama-perplexityworks up to-c 4096(it keeps the whole context's logits in host memory). - 上下文越长 decode 越慢(attention 要读整个 KV):64k 上下文 8.9 tokens/s,113k 7.7 tokens/s;服务端用 MTP 时为 17.9 / 13.6 tokens/s / decode slows with the context (attention reads the whole KV): 8.9 tokens/s at 64k, 7.7 at 113k; 17.9 / 13.6 with MTP on the server.
源码 / Sources
- llama.cpp:ZHEQIUSHUI/llama.cpp
axera-dev@57a30bd(ggml/src/ggml-axera/models/qwen38_27b) - kernel:ZHEQIUSHUI/ax-dsl-kernels
main@62b38a6(models/qwen38_27b,kernels.md5列出本套件 / lists this set)
- Downloads last month
- 1,459
4-bit