DynaGuard-4B - Q4NX for FastFlowLM (AMD Ryzen AI XDNA2)
A safety-focused Qwen3-4B fine-tune, converted to Q4NX for FastFlowLM.
What is Q4NX?
Q4NX is FastFlowLM's native packed-quantization format - a rearranged Q4_1 layout tuned for the NPU matrix engine's tile sizes and memory access patterns. It is not a GGUF file and it does not run on llama.cpp or Ollama; it is meant exclusively for the FastFlowLM engine on AMD Ryzen AI NPUs.
Requirements
- FastFlowLM >= 0.9.45 (
flmCLI) - AMD Ryzen AI processor with XDNA2 (NPU2) - Strix Point / Ryzen AI 300 series or later
- Linux with the XRT NPU stack installed
- ~16 GB of unified system memory (Q4NX weights + activations + KV cache)
Files
| File | Purpose |
|---|---|
| model.q4nx | Quantized Q4NX weights |
| config.json | FastFlowLM model configuration |
| tokenizer.json | Tokenizer |
| tokenizer_config.json | Special tokens and chat template |
| chat_template.jinja | Chat template (optional) |
| flm-add.py | Installer script - registers this model with FastFlowLM |
Install and run
This repository works with flm-add, a small installer that copies the model
into the FastFlowLM user directory and registers the tag. It never
modifies the system FastFlowLM install.
pip install flm-add or uv tool install flm-add
uv tool install flm-add
flm-add Atomic-Germ/DynaGuard-4B-NPU2--tag dynaguard:4b --family qwen3.5
FLM_CONFIG_PATH="$HOME/.config/flm/model_list.json" FLM_XCLBIN_PATH="$HOME/.config/flm" flm run dynaguard:4b
Kernels
FastFlowLM's NPU kernels (xclbins) are closed source and are not shipped in
this repository. flm-add.py links the kernels of the official qwen3.5:9b
model (Qwen3.5-9B-NPU2), because this model shares the same engine family
(qwen3.5) and architecture.
Model
- Registry tag:
dynaguard:4b - Engine family:
qwen3 - Kernel source: Qwen3-4B-NPU2
- Context length: 262,144 tokens (from config)
model.q4nxsize: 3.3 GB- Base model: Qwen/Qwen3-4B
- License: apache-2.0
GhostWriter Influence Test (Arbitrary but repeatable benchmark)
Tested on an AMD Ryzen AI 340 Framework 13 laptop.
| Metric | Value |
|---|---|
| Prompt Tokens | 11,254 |
| Completion Tokens | 1,367 |
| Total Tokens | 12,621 |
| Active KV Tokens | 12,621 |
| Max KV Token Capacity | 32,768 |
| KV Token Occupancy | 38.52% |
| Load Duration | 0.000001342 seconds |
| Prefill Duration (TTFT) | 29.90 ms |
| Decoding Duration | 165.02 ms |
| Prefill Speed | 376.31 tokens/sec |
| Decoding Speed | 8.28 tokens/sec |
"load_duration":1.342e-06,"prefill_duration_ttft":29.906345984,"decoding_duration":165.0172,"prefill_speed_tps":376.30809213606136,"decoding_speed_tps":8.283984942175724}
Original model card
See the upstream model card for training details, benchmarks, and upstream usage. This repository only contains the Q4NX conversion for FastFlowLM.
- Upstream card: [tomg-group-umd/DynaGuard-4B(https://huggingface.co/tomg-group-umd/DynaGuard-4B)
- Downloads last month
- 150