xinfer-ai 0.12.2 → 0.12.3

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
@@ -24,38 +24,16 @@
24
24
 
25
25
  ### 📦 Install
26
26
 
27
- **Option 1 — Python package**
27
+ **Option 1 — Install DEB or Python package**
28
28
  ```bash
29
29
  curl -sSL https://guoqingbao.github.io/xinfer/install.sh | bash
30
- # python3 -m xinfer.server --m Qwen/Qwen3.6-27B-FP8 --kvcache-dtype turbo4 --ui-server
31
30
  ```
32
31
 
33
32
  **Option 2 — npm**
34
33
  ```bash
35
34
  npm install -g xinfer-ai
36
- # xinfer --m Qwen/Qwen3.6-27B-FP8 --kvcache-dtype turbo4 --ui-server
37
35
  ```
38
36
 
39
- **Option 3 — Cargo (from source)**
40
- ```bash
41
- # Prerequisites: Rust compiler, CUDA Toolkit (optional) or Metal Xcode command line tool
42
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
43
- sudo apt-get install -y git build-essential libssl-dev pkg-config
44
-
45
- export XINFER_REPO="https://github.com/guoqingbao/xinfer"
46
- # MacOS/Metal: replace features to `metal`
47
- # SM_70/SM_75 (e.g., V100): remove `flashinfer` and `cutlass` features
48
- cargo install --git $XINFER_REPO xinfer --features cuda,nccl,flashinfer,cutlass
49
- ```
50
-
51
- **Option 4 — Docker**
52
- ```bash
53
- # Turing/V100 (sm_70/sm_75): remove `flashinfer` and `cutlass` features
54
- ./build_docker.sh "cuda,nccl,flashinfer,cutlass"
55
- ```
56
-
57
- See [Docker guide →](docs/docker.md)
58
-
59
37
  ---
60
38
 
61
39
  ### ▶️ Run
@@ -192,61 +170,14 @@ xinfer --m unsloth/Qwen3-30B-A3B-Instruct-2507-GGUF \
192
170
 
193
171
  ---
194
172
 
195
- ## 📘 Usage (Rust)
173
+ ## 📘 Usage
174
+ > For **Python installaion**, running model with `python3 -m xinfer.server`
196
175
 
197
- ### Installation
198
-
199
- <details>
200
- <summary><b>CUDA (Linux)</b></summary>
201
-
202
- ```bash
203
- # Prerequisites
204
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
205
- sudo apt-get install -y git build-essential libssl-dev pkg-config
206
-
207
- # Optional: CUDA toolkit + NCCL
208
- sudo apt-get install -y cuda-nvcc-12-9 cuda-nvrtc-dev-12-9 libcublas-dev-12-9 libcurand-dev-12-9
209
- sudo apt-get install -y libnccl2 libnccl-dev
210
-
211
- # Build & install
212
- cargo --install --features cuda,nccl,flashinfer,cutlass
213
- # Flash Attention backend alternative:
214
- cargo --install --features cuda,nccl,flashattn,cutlass
215
- # V100 / older (no flash backends):
216
- cargo --install --features cuda,nccl
217
- ```
218
-
219
- </details>
220
-
221
- <details>
222
- <summary><b>Metal (macOS)</b></summary>
223
-
224
- ```bash
225
- # Install Xcode command-line tools first
226
- cargo install --features metal
227
- ```
228
-
229
- </details>
230
-
231
- <details>
232
- <summary><b>Docker</b></summary>
233
-
234
- ```bash
235
- # sm_80 = A100, sm_90 = Hopper, sm_120 = Blackwell
236
- ./build_docker.sh "cuda,nccl,flashinfer,cutlass,python" sm_80 12.9.0 0
237
- # Production image with Flash Attention:
238
- ./build_docker.sh --prod "cuda,nccl,flashattn,cutlass,python" sm_90 13.0.0
239
- ```
240
-
241
- See [Docker guide →](docs/docker.md)
242
-
243
- </details>
176
+ > For Docker builds, refer to [**Run xInfer in Docker →**](docs/docker.md)
244
177
 
245
178
  ### Running Models
246
179
 
247
180
  > **Tip:** By default, xInfer starts an OpenAI-compatible API server at `http://localhost:8000`. Add `--ui-server` to also launch the built-in ChatGPT-style Web UI at `http://localhost:8001`.
248
- >
249
- > For Docker builds, refer to [**Run xInfer in Docker →**](docs/docker.md)
250
181
 
251
182
  ```bash
252
183
  # FP8 model (sm90+ with cutlass) + web UI
@@ -355,36 +286,28 @@ xinfer --m mistralai/Ministral-3-3B --ui-server
355
286
 
356
287
  ---
357
288
 
358
- ## 📘 Usage (Python)
359
-
360
- ### Running Models
289
+ ## 📘 Build from source code
361
290
 
291
+ **Option 1 — Cargo**
362
292
  ```bash
363
- # FP8 model + web UI
364
- python3 -m xinfer.server --m Qwen/Qwen3.6-27B-FP8 --ui-server
365
-
366
- # Unquantized Safetensors (multi-GPU)
367
- python3 -m xinfer.server --m Qwen/Qwen3.5-122B-A10B --d 0,1 --kvcache-dtype fp8
368
-
369
- # ISQ on-the-fly quantization
370
- python3 -m xinfer.server --w /path/Qwen3.6-35B-A3B --isq q4k --d 0 --kvcache-dtype turbo8
371
-
372
- # NVFP4 / MXFP4
373
- python3 -m xinfer.server --m unsloth/Qwen3.6-27B-NVFP4
374
- python3 -m xinfer.server --m olka-fi/Qwen3.5-4B-MXFP4
375
- python3 -m xinfer.server --m GadflyII/GLM-4.7-Flash-NVFP4
376
-
377
- # GGUF
378
- python3 -m xinfer.server --m unsloth/Qwen3.5-27B-GGUF --f Qwen3.5-27B-Q4_K_M.gguf
293
+ # Prerequisites: Rust compiler, CUDA Toolkit (optional) or Metal Xcode command line tool
294
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
295
+ sudo apt-get install -y git build-essential libssl-dev pkg-config
379
296
 
380
- # Multimodal
381
- python3 -m xinfer.server --m Qwen/Qwen3.6-35B-A3B-FP8 --kvcache-dtype fp8
297
+ export XINFER_REPO="https://github.com/guoqingbao/xinfer"
298
+ # MacOS/Metal: replace features to `metal`
299
+ # SM_70/SM_75 (e.g., V100): remove `flashinfer` and `cutlass` features
300
+ cargo install --git $XINFER_REPO xinfer --features cuda,nccl,flashinfer,cutlass
301
+ ```
382
302
 
383
- # GPTQ / AWQ
384
- python3 -m xinfer.server --w /home/Meta-Llama-3.1-8B-Instruct-GPTQ-INT4-Marlin
303
+ **Option 2 — Docker**
304
+ ```bash
305
+ # Turing/V100 (sm_70/sm_75): remove `flashinfer` and `cutlass` features
306
+ ./build_docker.sh "cuda,nccl,flashinfer,cutlass"
385
307
  ```
386
308
 
387
- See [more Python examples →](python/ReadMe.md)
309
+ See [Docker guide →](docs/docker.md)
310
+
388
311
 
389
312
  <details>
390
313
  <summary><b>Build Python wheel from source</b></summary>
@@ -407,6 +330,8 @@ pip install target/wheels/xinfer*.whl --force-reinstall
407
330
 
408
331
  </details>
409
332
 
333
+ See [more Python examples →](python/ReadMe.md)
334
+
410
335
  ---
411
336
 
412
337
  ## 🔀 Prefill-Decode Disaggregation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xinfer-ai",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "assetVersion": "0.12.1",
5
5
  "description": "xInfer — a high-performance LLM inference engine in Rust with CUDA/Metal acceleration",
6
6
  "license": "MIT",
@@ -45,6 +45,6 @@
45
45
  "x64"
46
46
  ],
47
47
  "engines": {
48
- "node": ">=18"
48
+ "node": ">=12"
49
49
  }
50
50
  }
@@ -10,6 +10,16 @@ const { spawnSync } = require("child_process");
10
10
 
11
11
  const pkg = require("../package.json");
12
12
 
13
+ function rmrf(target) {
14
+ try {
15
+ if (fs.rmSync) {
16
+ fs.rmSync(target, { recursive: true, force: true });
17
+ } else if (fs.rmdirSync) {
18
+ fs.rmdirSync(target, { recursive: true });
19
+ }
20
+ } catch (_) {}
21
+ }
22
+
13
23
  function targetTriple() {
14
24
  const platform = process.platform;
15
25
  const arch = process.arch;
@@ -186,7 +196,7 @@ async function main() {
186
196
  );
187
197
  }
188
198
 
189
- fs.rmSync(installDir, { recursive: true, force: true });
199
+ rmrf(installDir);
190
200
  fs.mkdirSync(installDir, { recursive: true });
191
201
  const tar = spawnSync(
192
202
  "tar",
@@ -199,9 +209,26 @@ async function main() {
199
209
  }
200
210
  const binary = path.join(installDir, "xinfer");
201
211
  fs.chmodSync(binary, 0o755);
202
- console.log(`xinfer installed to ${installDir}`);
212
+ const hint = [
213
+ `xinfer installed to ${installDir}`,
214
+ "",
215
+ "============================================",
216
+ " xInfer binary installed via npm",
217
+ "============================================",
218
+ "",
219
+ " HuggingFace model:",
220
+ " xinfer --m Qwen/Qwen3-8B --ui-server",
221
+ "",
222
+ " Local model path:",
223
+ " xinfer --w /path/to/model --ui-server",
224
+ "",
225
+ " API server (no UI):",
226
+ " xinfer --m Qwen/Qwen3-8B --server",
227
+ "============================================",
228
+ ].join("\n");
229
+ process.stderr.write(hint + "\n");
203
230
  } finally {
204
- fs.rmSync(tmpDir, { recursive: true, force: true });
231
+ rmrf(tmpDir);
205
232
  }
206
233
  }
207
234