Instructions to use FastFlowLM/Qwen3.5-0.8B-NPU2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FastFlowLM/Qwen3.5-0.8B-NPU2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="FastFlowLM/Qwen3.5-0.8B-NPU2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("FastFlowLM/Qwen3.5-0.8B-NPU2") model = AutoModelForMultimodalLM.from_pretrained("FastFlowLM/Qwen3.5-0.8B-NPU2", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FastFlowLM/Qwen3.5-0.8B-NPU2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FastFlowLM/Qwen3.5-0.8B-NPU2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FastFlowLM/Qwen3.5-0.8B-NPU2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/FastFlowLM/Qwen3.5-0.8B-NPU2
- SGLang
How to use FastFlowLM/Qwen3.5-0.8B-NPU2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "FastFlowLM/Qwen3.5-0.8B-NPU2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FastFlowLM/Qwen3.5-0.8B-NPU2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "FastFlowLM/Qwen3.5-0.8B-NPU2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FastFlowLM/Qwen3.5-0.8B-NPU2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use FastFlowLM/Qwen3.5-0.8B-NPU2 with Docker Model Runner:
docker model run hf.co/FastFlowLM/Qwen3.5-0.8B-NPU2
real_q80
#1
by FastFlowLM - opened
- chat_template.jinja +8 -4
- config.json +1 -1
- model.q4nx +2 -2
chat_template.jinja
CHANGED
|
@@ -97,7 +97,11 @@
|
|
| 97 |
{%- endif %}
|
| 98 |
{%- endif %}
|
| 99 |
{%- set reasoning_content = reasoning_content|trim %}
|
| 100 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 102 |
{%- for tool_call in message.tool_calls %}
|
| 103 |
{%- if tool_call.function is defined %}
|
|
@@ -142,9 +146,9 @@
|
|
| 142 |
{%- endfor %}
|
| 143 |
{%- if add_generation_prompt %}
|
| 144 |
{{- '<|im_start|>assistant\n' }}
|
| 145 |
-
{%- if enable_thinking is defined and enable_thinking is
|
| 146 |
-
{{- '<think>\n\n</think>\n\n' }}
|
| 147 |
-
{%- else %}
|
| 148 |
{{- '<think>\n' }}
|
|
|
|
|
|
|
| 149 |
{%- endif %}
|
| 150 |
{%- endif %}
|
|
|
|
| 97 |
{%- endif %}
|
| 98 |
{%- endif %}
|
| 99 |
{%- set reasoning_content = reasoning_content|trim %}
|
| 100 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 101 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 102 |
+
{%- else %}
|
| 103 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 104 |
+
{%- endif %}
|
| 105 |
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 106 |
{%- for tool_call in message.tool_calls %}
|
| 107 |
{%- if tool_call.function is defined %}
|
|
|
|
| 146 |
{%- endfor %}
|
| 147 |
{%- if add_generation_prompt %}
|
| 148 |
{{- '<|im_start|>assistant\n' }}
|
| 149 |
+
{%- if enable_thinking is defined and enable_thinking is true %}
|
|
|
|
|
|
|
| 150 |
{{- '<think>\n' }}
|
| 151 |
+
{%- else %}
|
| 152 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 153 |
{%- endif %}
|
| 154 |
{%- endif %}
|
config.json
CHANGED
|
@@ -72,7 +72,7 @@
|
|
| 72 |
},
|
| 73 |
"addr_qk": 53248,
|
| 74 |
"addr_kv": 53536,
|
| 75 |
-
"flm_version": "0.9.
|
| 76 |
"vision_model_weight": "vision_weight.q4nx",
|
| 77 |
"vision_config": {
|
| 78 |
"vision_mm_engine_xclbin_name": "vision_mm.xclbin",
|
|
|
|
| 72 |
},
|
| 73 |
"addr_qk": 53248,
|
| 74 |
"addr_kv": 53536,
|
| 75 |
+
"flm_version": "0.9.38",
|
| 76 |
"vision_model_weight": "vision_weight.q4nx",
|
| 77 |
"vision_config": {
|
| 78 |
"vision_mm_engine_xclbin_name": "vision_mm.xclbin",
|
model.q4nx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ac49ab050beac553982960ea63ede199ec807099cd7083c3fc97480dc701788
|
| 3 |
+
size 1164335888
|