xinfer-ai 0.13.4 → 0.13.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,13 +14,19 @@
14
14
  | **⚡** | Fast | Native Flash Attention, FlashInfer, CUDA Graphs, continuous batching, prefix caching, PD disaggregation. Up to **197 tok/s** decode for `30B+` models on consumer GPUs |
15
15
  | **ðŸŠķ** | Tiny footprint | Core scheduling + attention logic in **< 5 000 lines** of Rust |
16
16
  | **🌍** | Cross-platform | CUDA (Linux/Windows), Metal (macOS). Same binary, same API |
17
- | **🏭** | Production-ready | OpenAI/Anthropic-compatible APIs, built-in ChatGPT-style Web UI, MCP tool calling, structured outputs, embedding + tokenizer endpoints |
17
+ | **🏭** | Production-ready | OpenAI/Anthropic-compatible APIs, built-in ChatGPT-style Web UI, MCP tool calling, structured outputs, embedding + tokenizer endpoints, multi-token prediction (MTP) |
18
18
  | **🗜ïļ** | Aggressive KV compression | TurboQuant (`2–4 bit` KV cache) extends context up to **4.3×** with minimal quality loss. Run `30B+` MoE models with **millions of context** on single 24/32 GB GPUs |
19
19
  | **ðŸ”Ĩ** | V100 + NVFP4 | First-ever NVFP4 + low-bit KV cache on V100 — no hardware FP4 needed, coherent output on legacy GPUs |
20
20
  | **🐍** | Lightweight Python bindings | Optional PyO3 wheel when you need a Python entry point |
21
21
 
22
22
  ---
23
23
 
24
+ ## ðŸ“―ïļ Demo
25
+
26
+ <video src="pages/assets/demo.mp4" width="600" controls></video>
27
+
28
+ ---
29
+
24
30
  ## 🚀 Quick Start
25
31
 
26
32
  ### ðŸ“Ķ Install
@@ -55,6 +61,11 @@ xinfer --m /home/Qwen3.6-35B-A3B --d 0,1 --ui-server
55
61
  python3 -m xinfer.server --m Qwen/Qwen3.6-27B-FP8 --kvcache-dtype turbo4 --ui-server
56
62
  ```
57
63
 
64
+ **MTP**
65
+ ```bash
66
+ xinfer --w /home/Qwen3.6-35B-A3B --d 0,1 --ui-server --mtp 2
67
+ ```
68
+
58
69
  > **Tip:** Open `http://IP:8001` for the built-in chat UI, or use `http://IP:8000/v1/` as your API `Base URL`.
59
70
 
60
71
  ---
@@ -77,7 +88,7 @@ Add `--kvcache-dtype` to compress KV cache and extend context length:
77
88
 
78
89
  > Tested on **V100-32G**, **A100-40G**, **Hopper-80G** and **RTX 5090**
79
90
 
80
- | Model | Format | Size | Decoding Speed |
91
+ | Model | Format | Size | Decoding Speed (without MTP) |
81
92
  |---|---|---|---|
82
93
  | Ministral-3-3B (**Multimodal**) | ISQ (BF16→Q4K) | 3B | **193.67** tokens/s |
83
94
  | Qwen3-VL-8B-Instruct (**Multimodal**) | Q8_0 | 8B | **112.51** tokens/s |
@@ -124,9 +135,10 @@ Add `--kvcache-dtype` to compress KV cache and extend context length:
124
135
  * ✅ Qwen3.5/3.6 Dense/MoE (27B, 35B, 122B, 397B, Multimodal model)
125
136
  * ✅ Mistral v1, v2
126
137
  * ✅ Mistral-3-VL Reasoning (3B, 8B, 14B, Multimodal model)
127
- * ✅ GLM4 (0414, **Not ChatGLM**)
138
+ * ✅ GLM4 (0414)
128
139
  * ✅ GLM4 MoE (4.6/4.7)
129
140
  * ✅ GLM4.7 Flash
141
+ * ✅ GLM 5.2 (DeepSeek V3.2 DSA architecture)
130
142
  * ✅ DeepSeek V3/R1/V3.2
131
143
  * ✅ Phi3 / Phi4 (Phi-3, Phi-4, Phi-4-mini, etc.)
132
144
  * ✅ Gemma3/**Gemma4** (Multimodal model)
@@ -164,6 +176,9 @@ xinfer --m Qwen/Qwen3.6-35B-A3B-FP8 --kvcache-dtype fp8
164
176
  # 27B Dense + turbo4
165
177
  xinfer --m Qwen/Qwen3.6-27B-FP8 --kvcache-dtype turbo4
166
178
 
179
+ # 26B Gemma4 (local model, occupy more kvcache with --kv-fraction)
180
+ xinfer --w /data/gemma-4-26B-A4B-it --ui-server --port 9000 --kv-fraction 0.8
181
+
167
182
  # 30B MoE GGUF + turbo4
168
183
  xinfer --m unsloth/Qwen3-30B-A3B-Instruct-2507-GGUF \
169
184
  --f Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf --kvcache-dtype turbo4
@@ -202,6 +217,9 @@ xinfer --m olka-fi/Qwen3.5-4B-MXFP4
202
217
  # GGUF model (4-bit KvCache)
203
218
  xinfer --m unsloth/Qwen3.5-27B-GGUF --f Qwen3.5-27B-Q4_K_M.gguf --kvcache-dtype turbo4
204
219
 
220
+ # Multi-shard 5.2 GGUF (auto-detected from HF subfolder)
221
+ xinfer --d 0,1,2,3 --m unsloth/Qwen3.5-122B-A10B-GGUF --f Q3_K_M --kvcache-dtype fp8
222
+
205
223
  # FP8 on Metal
206
224
  xinfer --m Qwen/Qwen3.5-4B-FP8
207
225
 
@@ -213,6 +231,15 @@ xinfer --m GadflyII/GLM-4.7-Flash-NVFP4
213
231
 
214
232
  # Interactive CLI chat
215
233
  xinfer --i --m unsloth/Qwen3.5-27B-GGUF --f Qwen3.5-27B-Q4_K_M.gguf
234
+
235
+ # Faster GDN prefill on Hopper with slight precision loss
236
+ SM90_LOWER_PRECISION_GDN_PREFILL=1 xinfer --m Qwen/Qwen3.5-35B-A3B-FP8
237
+
238
+ # MultiNode: GLM 5.2 (DeepSeek V3.2 architecture, FP8)
239
+ # Master node
240
+ xinfer --d 0,1,2,3,4,5,6,7 --m zai-org/GLM-5.2-FP8 --num-nodes 2 --node-rank 0 --master-addr 192.168.xxx.xxx
241
+ # Other node(s)
242
+ xinfer --d 0,1,2,3,4,5,6,7 --m zai-org/GLM-5.2-FP8 --num-nodes 2 --node-rank 1 --master-addr 192.168.xxx.xxx
216
243
  ```
217
244
 
218
245
  <details>
@@ -235,11 +262,17 @@ xinfer --m /path/Qwen3-4B --isq q6k
235
262
  <summary><b>GGUF models</b></summary>
236
263
 
237
264
  ```bash
238
- # Single GPU — GGUF
265
+ # Multi-GPU GGUF (model ID + subfolder)
266
+ xinfer --d 0,1,2,3 --m unsloth/Qwen3.5-122B-A10B-GGUF --f Q3_K_M
267
+
268
+ # Remote GGUF — single-file model
239
269
  xinfer --m unsloth/Qwen3.5-27B-GGUF --f Qwen3.5-27B-Q4_K_M.gguf
240
270
 
241
- # Multi-GPU — GGUF
271
+ # Local GGUF file (direct path)
242
272
  xinfer --d 0,1 --m /path/Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf
273
+
274
+ # Local GGUF folder
275
+ xinfer --d 0,1,2,3 --m /path/to/Qwen3.5-122B-A10B-GGUF/Q3_K_M
243
276
  ```
244
277
 
245
278
  </details>
@@ -450,7 +483,7 @@ Constraint-based generation via llguidance — Lark grammars, regex, JSON Schema
450
483
 
451
484
  | Flag | Description |
452
485
  |---|---|
453
- | `--m` | Model source: HuggingFace model ID, local Safetensors directory, or local GGUF file |
486
+ | `--m` | Model source: HuggingFace model ID, local Safetensors directory, local GGUF file, or local folder containing GGUF files |
454
487
  | `--w` | Legacy alias for local Safetensors directory; prefer `--m <local_dir>` |
455
488
  | `--f` | Local GGUF file when used alone; remote GGUF filename when paired with `--m <model_id>` |
456
489
  | `--d` | Device IDs (e.g. `--d 0,1`) |
@@ -477,23 +510,25 @@ Constraint-based generation via llguidance — Lark grammars, regex, JSON Schema
477
510
  | `--frequency-penalty` | Penalize frequent tokens (−2 to 2) |
478
511
  | `--mcp-config` | MCP servers JSON config |
479
512
  | `--mcp-command` / `--mcp-args` | Single MCP server command + args |
513
+ | `--mtp`| Multi-token prediction, usage `--mtp 2` for two-token prediction per forward pass |
480
514
 
481
515
  ### Environment Variables
482
516
 
483
517
  | Variable | Description |
484
518
  |---|---|
485
519
  | `XINFER_NVFP4_FORCE_LUT=1` | Force software NVFP4 decode to use the LUT-based dequantization path (higher precision) instead of hardware FP4 intrinsics on Blackwell (SM100+). Useful when decode precision matters more than peak throughput. |
520
+ | `XINFER_SSE_BUFFER_SIZE=256` | Size of the bounded SSE streaming buffer per client connection (default: 256). Increase for slow network proxies or high-throughput models. |
521
+ | `SM90_LOWER_PRECISION_GDN_PREFILL=1` | Enable the FlashInfer SM90 persistent kernel for GatedDeltaNet (GDN) prefill on Hopper GPUs (SM90). Delivers faster prefill speedup for Qwen3.5/3.6, with a slight precision trade-off. |
486
522
 
487
523
  **Example (Blackwell with high-precision NVFP4 decode):**
488
524
  ```bash
489
525
  XINFER_NVFP4_FORCE_LUT=1 xinfer --m nvidia/Qwen3-30B-A3B-FP4 --ui-server
490
526
  ```
491
527
 
492
- ---
493
-
494
- ## ðŸ“―ïļ Demo
495
-
496
- <video src="https://github.com/user-attachments/assets/7fc6aa0b-78ac-4323-923f-d761dd12857f" width="1000px"></video>
528
+ **Example (Hopper with faster GDN prefill):**
529
+ ```bash
530
+ SM90_LOWER_PRECISION_GDN_PREFILL=1 xinfer --m Qwen/Qwen3.5-35B-A3B-FP8 --ui-server
531
+ ```
497
532
 
498
533
  ---
499
534
 
@@ -518,7 +553,8 @@ XINFER_NVFP4_FORCE_LUT=1 xinfer --m nvidia/Qwen3-30B-A3B-FP4 --ui-server
518
553
  * [x] FP8 KV Cache (with FlashInfer, SM80+)
519
554
  * [x] TurboQuant KV Cache (2-4 bit compression with WHT rotation)
520
555
  * [x] FP8 Models (CUDA: MoE, Dense; Metal: Dense)
521
- * [ ] Additional model support (Kimi K2, GLM 5.1 etc.)
556
+ * [x] GLM 5.2 (DeepSeek V3.2 + DSA)
557
+ * [ ] Additional model support (Kimi K2, etc.)
522
558
  * [x] CPU KV Cache Offloading
523
559
  * [x] Prefill-decode Disaggregation (CUDA)
524
560
  * [x] Prefill-decode Disaggregation (Metal)
@@ -534,6 +570,7 @@ XINFER_NVFP4_FORCE_LUT=1 xinfer --m nvidia/Qwen3-30B-A3B-FP4 --ui-server
534
570
  * [x] **MXFP4/NVFP4 Model Support**
535
571
  * [x] **Support Turboquant (4-bit, 3-bit) KvCache**
536
572
  * [ ] TentorRT-LLM
573
+ * [x] **Multi-token Prediciton (MTP)**
537
574
 
538
575
  ---
539
576
 
@@ -22,8 +22,13 @@ cargo build --release --features metal
22
22
  ## Model formats
23
23
  - **Safetensors (HF layout)**: `--m <hf_id>` for cached download, or `--m <local_dir>` for offline weights + configs. `--w <local_dir>` still works as a legacy alias.
24
24
  - **Safetensors (HF layout) + ISQ**: in-situ quantize into GGUF with args `--isq <q4k|q2k|q6k|...>`.
25
- - **GGUF**: `--m <local.gguf>` or `--f <local.gguf>` for a local file. Use `--m <hf_id> --f <remote_file.gguf>` for a GGUF file hosted in a Hugging Face repo.
26
- - **Vision-Language** (Qwen3-VL, Gemma3, Mistral3-VL): require image tokens; use `--ui-server` for uploads or send image_url/base64 in the request.
25
+ - **GGUF**: multiple loading modes:
26
+ - `--m <local.gguf>` — load a single local GGUF file.
27
+ - `--m <local_dir>` — auto-detect the main GGUF file in a directory (picks the largest non-mmproj `.gguf`). Multi-shard files (`*-00001-of-00007.gguf`) and auxiliary files (`mmproj-*.gguf` for vision towers) are auto-discovered.
28
+ - `--f <local.gguf>` — load a single local GGUF file (alternative syntax).
29
+ - `--m <hf_id> --f <remote_file.gguf>` — download a GGUF file from a Hugging Face repo.
30
+ - `--m <hf_id> --f <subfolder>` — auto-detect all GGUF files in a HuggingFace repo subfolder (e.g. `--m unsloth/GLM-5.2-GGUF --f UD-Q2_K_XL`).
31
+ - **Vision-Language** (Qwen3-VL, Qwen3.5-VL, Gemma3, Gemma4, Mistral3-VL): require image tokens; use `--ui-server` for uploads or send image_url/base64 in the request. For GGUF multimodal models, place the `mmproj-*.gguf` vision tower file in the same directory as the main model file — it will be auto-detected.
27
32
 
28
33
 
29
34
  ## 3) Run patterns (single host)
@@ -36,11 +41,19 @@ cargo build --release --features metal
36
41
  ```bash
37
42
  target/release/xinfer --m meta-llama/Llama-3-8b --max-model-len 32768 --ui-server
38
43
  ```
39
- - **GGUF quantized**
44
+ - **GGUF quantized (single file)**
40
45
  ```bash
41
46
  target/release/xinfer --m /path/model-Q4_K_M.gguf --max-model-len 65536
42
47
  ```
43
- - **Remote GGUF quantized**
48
+ - **GGUF quantized (folder with auto-detection)**
49
+ ```bash
50
+ target/release/xinfer --m /path/GLM-5.2-GGUF/ --ui-server
51
+ ```
52
+ - **Remote GGUF quantized (multi-shard subfolder)**
53
+ ```bash
54
+ target/release/xinfer --d 0,1,2,3 --m unsloth/GLM-5.2-GGUF --f UD-Q2_K_XL --ui-server
55
+ ```
56
+ - **Remote GGUF quantized (single file)**
44
57
  ```bash
45
58
  target/release/xinfer --m unsloth/Qwen3-0.6B-GGUF --f Qwen3-0.6B-Q4_K_M.gguf --ui-server
46
59
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xinfer-ai",
3
- "version": "0.13.4",
4
- "assetVersion": "0.13.4",
3
+ "version": "0.13.6",
4
+ "assetVersion": "0.13.6",
5
5
  "description": "xInfer — a high-performance LLM inference engine in Rust with CUDA/Metal acceleration",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/guoqingbao/xinfer#readme",