xinfer-ai 0.13.4 → 0.13.5

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,21 @@
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
+ <p align="center">
27
+ <video src="https://guoqingbao.github.io/xinfer/assets/demo.mp4" width="600" controls></video>
28
+ </p>
29
+
30
+ ---
31
+
24
32
  ## 🚀 Quick Start
25
33
 
26
34
  ### ðŸ“Ķ Install
@@ -55,6 +63,11 @@ xinfer --m /home/Qwen3.6-35B-A3B --d 0,1 --ui-server
55
63
  python3 -m xinfer.server --m Qwen/Qwen3.6-27B-FP8 --kvcache-dtype turbo4 --ui-server
56
64
  ```
57
65
 
66
+ **MTP**
67
+ ```bash
68
+ xinfer --w /home/Qwen3.6-35B-A3B --d 0,1 --ui-server --mtp 2
69
+ ```
70
+
58
71
  > **Tip:** Open `http://IP:8001` for the built-in chat UI, or use `http://IP:8000/v1/` as your API `Base URL`.
59
72
 
60
73
  ---
@@ -77,7 +90,7 @@ Add `--kvcache-dtype` to compress KV cache and extend context length:
77
90
 
78
91
  > Tested on **V100-32G**, **A100-40G**, **Hopper-80G** and **RTX 5090**
79
92
 
80
- | Model | Format | Size | Decoding Speed |
93
+ | Model | Format | Size | Decoding Speed (without MTP) |
81
94
  |---|---|---|---|
82
95
  | Ministral-3-3B (**Multimodal**) | ISQ (BF16→Q4K) | 3B | **193.67** tokens/s |
83
96
  | Qwen3-VL-8B-Instruct (**Multimodal**) | Q8_0 | 8B | **112.51** tokens/s |
@@ -164,6 +177,9 @@ xinfer --m Qwen/Qwen3.6-35B-A3B-FP8 --kvcache-dtype fp8
164
177
  # 27B Dense + turbo4
165
178
  xinfer --m Qwen/Qwen3.6-27B-FP8 --kvcache-dtype turbo4
166
179
 
180
+ # 26B Gemma4 (local model, occupy more kvcache with --kv-fraction)
181
+ xinfer --w /data/gemma-4-26B-A4B-it --ui-server --port 9000 --kv-fraction 0.8
182
+
167
183
  # 30B MoE GGUF + turbo4
168
184
  xinfer --m unsloth/Qwen3-30B-A3B-Instruct-2507-GGUF \
169
185
  --f Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf --kvcache-dtype turbo4
@@ -235,11 +251,17 @@ xinfer --m /path/Qwen3-4B --isq q6k
235
251
  <summary><b>GGUF models</b></summary>
236
252
 
237
253
  ```bash
238
- # Single GPU — GGUF
254
+ # Multi-GPU GGUF (model ID + subfolder)
255
+ xinfer --d 0,1,2,3 --m unsloth/Qwen3.5-122B-A10B-GGUF --f Q3_K_M
256
+
257
+ # Remote GGUF — single-file model
239
258
  xinfer --m unsloth/Qwen3.5-27B-GGUF --f Qwen3.5-27B-Q4_K_M.gguf
240
259
 
241
- # Multi-GPU — GGUF
260
+ # Local GGUF file (direct path)
242
261
  xinfer --d 0,1 --m /path/Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf
262
+
263
+ # Local GGUF folder
264
+ xinfer --d 0,1,2,3 --m /path/to/model-GGUF/
243
265
  ```
244
266
 
245
267
  </details>
@@ -450,7 +472,7 @@ Constraint-based generation via llguidance — Lark grammars, regex, JSON Schema
450
472
 
451
473
  | Flag | Description |
452
474
  |---|---|
453
- | `--m` | Model source: HuggingFace model ID, local Safetensors directory, or local GGUF file |
475
+ | `--m` | Model source: HuggingFace model ID, local Safetensors directory, local GGUF file, or local folder containing GGUF files |
454
476
  | `--w` | Legacy alias for local Safetensors directory; prefer `--m <local_dir>` |
455
477
  | `--f` | Local GGUF file when used alone; remote GGUF filename when paired with `--m <model_id>` |
456
478
  | `--d` | Device IDs (e.g. `--d 0,1`) |
@@ -477,6 +499,7 @@ Constraint-based generation via llguidance — Lark grammars, regex, JSON Schema
477
499
  | `--frequency-penalty` | Penalize frequent tokens (−2 to 2) |
478
500
  | `--mcp-config` | MCP servers JSON config |
479
501
  | `--mcp-command` / `--mcp-args` | Single MCP server command + args |
502
+ | `--mtp`| Multi-token prediction, usage `--mtp 2` for two-token prediction per forward pass |
480
503
 
481
504
  ### Environment Variables
482
505
 
@@ -491,12 +514,6 @@ XINFER_NVFP4_FORCE_LUT=1 xinfer --m nvidia/Qwen3-30B-A3B-FP4 --ui-server
491
514
 
492
515
  ---
493
516
 
494
- ## ðŸ“―ïļ Demo
495
-
496
- <video src="https://github.com/user-attachments/assets/7fc6aa0b-78ac-4323-923f-d761dd12857f" width="1000px"></video>
497
-
498
- ---
499
-
500
517
  ## 🛠ïļ Roadmap
501
518
 
502
519
  * [x] Batched inference (Metal)
@@ -534,6 +551,7 @@ XINFER_NVFP4_FORCE_LUT=1 xinfer --m nvidia/Qwen3-30B-A3B-FP4 --ui-server
534
551
  * [x] **MXFP4/NVFP4 Model Support**
535
552
  * [x] **Support Turboquant (4-bit, 3-bit) KvCache**
536
553
  * [ ] TentorRT-LLM
554
+ * [x] **Multi-token Prediciton (MTP)**
537
555
 
538
556
  ---
539
557
 
@@ -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/model-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.5",
4
+ "assetVersion": "0.13.5",
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",