File size: 2,335 Bytes
28677bb
 
a0f2f85
 
 
28677bb
a0f2f85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
license: apache-2.0
pipeline_tag: image-text-to-text
library_name: llama.cpp
tags: [qwen3.5, spacemit, k1, k3, gguf, onnxruntime]
---

# Qwen3.5-4B for SpacemiT K1/K3

This is a SpacemiT conversion of [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B), the Apache-2.0 native multimodal model from the Qwen Team. It is intended for visual understanding, text, coding and agent tasks. Read the [official announcement](https://qwen.ai/blog?id=qwen3.5) and cite:

```bibtex
@misc{qwen3.5, title={{Qwen3.5}: Towards Native Multimodal Agents}, author={{Qwen Team}}, month={February}, year={2026}, url={https://qwen.ai/blog?id=qwen3.5}}
```

Contents: `qwen3_5_4b-text-q41.gguf`, ONNX vision encoders at 224/384/768 pixels (384 is the default), and independent K1/K3 configs. The text model is Q4_1 GGUF; vision runs through the SpaceMIT Execution Provider.

Prerequisites are the [SpacemiT ONNX Runtime releases](https://github.com/spacemit-com/onnxruntime/releases) and SMT-enabled [spacemit-com/llama.cpp](https://github.com/spacemit-com/llama.cpp). Prebuilt ORT 2.0.6 and llama.cpp v0.1.7 archives can be unpacked directly. To compile, clone recursively, set `RISCV_ROOT_PATH` and `SPACEMIT_ORT_DIR`, and run `bash build_spacemit.sh glibc`.

K1 uses AI cores 0–3, `configs/K1`, and `-t 4`; K3 uses AI cores 8–15, `configs/K3`, and `-t 8`. Never swap these configs: `ep_config` pins the vision EP to the platform's AI cores.

```bash
export MODEL_DIR=/path/to/Qwen3.5-4B-SpacemiT LLAMA_DIR=/path/to/llama.cpp-installed ORT_DIR=/path/to/spacemit-ort.riscv64.2.0.6
export LD_LIBRARY_PATH="$LLAMA_DIR/lib:$ORT_DIR/lib:${LD_LIBRARY_PATH:-}"
"$LLAMA_DIR/bin/llama-server" -m "$MODEL_DIR/qwen3_5_4b-text-q41.gguf" --media-backend smt --smt-config-dir "$MODEL_DIR/configs/K1" -t 4 --host 0.0.0.0 --port 8080 --warmup
```

For K3 select `configs/K3` and `-t 8`. Send an image data URL plus `Describe the image content.` to `/v1/chat/completions` (64 output tokens, temperature 0, thinking disabled). The bundled smoke image produced HTTP 200 on K1 (description beginning `This image captures a moment from what appears to be a formal event...`) and K3 (beginning `This image captures a moment from what appears to be a conference...`).

The Qwen3.5 weights are Apache-2.0. Runtime dependencies remain under their upstream licenses.