Q4NX/FastFlowLM card: flm-add.py install + run/serve flow, kernels source, model info
Browse files
README.md
CHANGED
|
@@ -1,95 +1,109 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
-
|
| 6 |
-
license: apache-2.0
|
| 7 |
-
mradermacher:
|
| 8 |
-
readme_rev: 1
|
| 9 |
-
quantized_by: mradermacher
|
| 10 |
tags:
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
- unsloth
|
| 14 |
-
- qwen2
|
| 15 |
- heretic
|
| 16 |
- uncensored
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
-
|
|
|
|
|
|
|
| 20 |
---
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
| 49 |
-
|
|
| 50 |
-
|
|
| 51 |
-
|
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
+
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
tags:
|
| 7 |
+
- qwen2.5
|
| 8 |
+
- agentic
|
|
|
|
|
|
|
| 9 |
- heretic
|
| 10 |
- uncensored
|
| 11 |
+
- fastflowlm
|
| 12 |
+
- q4nx
|
| 13 |
+
- npu
|
| 14 |
+
base_model:
|
| 15 |
+
- richardyoung/fable-qwen2.5-3b-agentic-merged-heretic
|
| 16 |
---
|
| 17 |
+
|
| 18 |
+
# Qwen2.5-3B-Fable (Agentic/H eretic) - Q4NX for FastFlowLM (AMD Ryzen AI XDNA2)
|
| 19 |
+
|
| 20 |
+
Fable-Qwen2.5-3B, an agentic merged/heretic fine-tune of Qwen2.5-3B, converted to Q4NX for FastFlowLM. Runs on the Qwen2.5 engine (3B kernels).
|
| 21 |
+
|
| 22 |
+
## What is Q4NX?
|
| 23 |
+
|
| 24 |
+
Q4NX is FastFlowLM's native packed-quantization format - a rearranged Q4_1
|
| 25 |
+
layout tuned for the NPU matrix engine's tile sizes and memory access
|
| 26 |
+
patterns. It is **not** a GGUF file and it does not run on llama.cpp or
|
| 27 |
+
Ollama; it is meant exclusively for the [FastFlowLM](https://fastflowlm.com)
|
| 28 |
+
engine on AMD Ryzen AI NPUs.
|
| 29 |
+
|
| 30 |
+
## Requirements
|
| 31 |
+
|
| 32 |
+
- FastFlowLM >= 0.9.45 (`flm` CLI)
|
| 33 |
+
- AMD Ryzen AI processor with **XDNA2 (NPU2)** - Strix Point / Ryzen AI 300
|
| 34 |
+
series or later
|
| 35 |
+
- Linux with the XRT NPU stack installed
|
| 36 |
+
- ~8 GB of unified system memory (Q4NX weights + activations + KV cache)
|
| 37 |
+
|
| 38 |
+
## Files
|
| 39 |
+
|
| 40 |
+
| File | Purpose |
|
| 41 |
+
|---|---|
|
| 42 |
+
| model.q4nx | Quantized Q4NX weights |
|
| 43 |
+
| config.json | FastFlowLM model configuration |
|
| 44 |
+
| tokenizer.json | Tokenizer |
|
| 45 |
+
| tokenizer_config.json | Special tokens and chat template |
|
| 46 |
+
| chat_template.jinja | Chat template (optional) |
|
| 47 |
+
| flm-add.py | Installer script - registers this model with FastFlowLM |
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
## Install and run
|
| 51 |
+
|
| 52 |
+
This repository ships `flm-add.py`, a small installer that copies the model
|
| 53 |
+
into the FastFlowLM user directory and registers the tag `qwen2.5-fable:3b`. It never
|
| 54 |
+
modifies the system FastFlowLM install.
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
# one-time environment (add these to ~/.bashrc)
|
| 58 |
+
export FLM_CONFIG_PATH="$HOME/.config/flm/model_list.json"
|
| 59 |
+
export FLM_XCLBIN_PATH="$HOME/.config/flm"
|
| 60 |
+
|
| 61 |
+
git lfs install
|
| 62 |
+
git clone https://huggingface.co/Atomic-Germ/Qwen2.5-3B-Fable-Agent-Heretic-NPU2
|
| 63 |
+
cd Qwen2.5-3B-Fable-Agent-Heretic-NPU2
|
| 64 |
+
python3 ./flm-add.py .
|
| 65 |
+
flm run qwen2.5-fable:3b
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
Run `python3 ./flm-add.py --help` for all options. Without a clone, the same
|
| 69 |
+
command works against the repo id directly:
|
| 70 |
+
|
| 71 |
+
```bash
|
| 72 |
+
python3 ./flm-add.py Atomic-Germ/Qwen2.5-3B-Fable-Agent-Heretic-NPU2
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
## Kernels
|
| 77 |
+
|
| 78 |
+
FastFlowLM's NPU kernels (xclbins) are closed source and are not shipped in
|
| 79 |
+
this repository. `flm-add.py` links the kernels of the official **`qwen2.5-it:3b`**
|
| 80 |
+
model (`Qwen2.5-3B-Instruct-NPU2`), because this model shares the same engine family
|
| 81 |
+
(`qwen2`) and architecture.
|
| 82 |
+
|
| 83 |
+
## Serve (OpenAI-compatible)
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
flm serve qwen2.5-fable:3b --port 8080
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
curl http://127.0.0.1:8080/v1/chat/completions \
|
| 91 |
+
-H 'Content-Type: application/json' \
|
| 92 |
+
-d '{"model":"qwen2.5-fable:3b","messages":[{"role":"user","content":"Hello!"}],"max_tokens":256}'
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
## Model
|
| 96 |
+
|
| 97 |
+
- Registry tag: `qwen2.5-fable:3b`
|
| 98 |
+
- Engine family: `qwen2`
|
| 99 |
+
- Kernel source: Qwen2.5-3B-Instruct-NPU2
|
| 100 |
+
- Context length: 32,768 tokens (from config)
|
| 101 |
+
- `model.q4nx` size: 2.59 GB
|
| 102 |
+
- Base model: [richardyoung/fable-qwen2.5-3b-agentic-merged-heretic](https://huggingface.co/richardyoung/fable-qwen2.5-3b-agentic-merged-heretic)
|
| 103 |
+
- License: apache-2.0
|
| 104 |
+
|
| 105 |
+
## Original model card
|
| 106 |
+
|
| 107 |
+
See the upstream model card for training details, benchmarks, and upstream
|
| 108 |
+
usage. This repository only contains the Q4NX conversion for FastFlowLM.
|
| 109 |
+
- Upstream card: [richardyoung/fable-qwen2.5-3b-agentic-merged-heretic](https://huggingface.co/richardyoung/fable-qwen2.5-3b-agentic-merged-heretic)
|