百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
O

openinfer

> AI 编程
开源

纯 Rust + CUDA LLM 推理引擎 - 不需要 PyTorch, 与 OpenAI 兼容, 可服务 Qwen3 至 Kimi-K2

619 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

纯 Rust + CUDA LLM 推理引擎 - 不需要 PyTorch, 与 OpenAI 兼容, 可服务 Qwen3 至 Kimi-K2

Quickstart · Performance · Models · Architecture · API · Development

PegaInfer serves LLMs through an OpenAI-compatible API. Each model owns its scheduler, state, and kernels; serving and KV infrastructure are shared. No PyTorch or Python runtime.

Quickstart

Prebuilt binary · Qwen3 on Linux

The Qwen3-only release bundles CUDA 13 and cuBLAS. It requires Linux x86_64, an NVIDIA GPU with compute capability 8.x–12.x, driver 580+, glibc 2.35+, and OpenSSL 3. Model weights are downloaded separately.

bash
curl -fsSL https://raw.githubusercontent.com/pegainfer-project/pegainfer/main/install.sh | bash

Download Qwen3-4B into models/Qwen3-4B, then start the server:

bash
pegainfer --model-path models/Qwen3-4B

The server listens on port 8000. If the command is not on your shell's path:

bash
export PATH="$HOME/.local/bin:$PATH"

The installer selects the latest release by default. PEGAINFER_VERSION selects an exact version; see releases.

Build from source

Use the Rust toolchain pinned in rust-toolchain.toml, a CUDA Toolkit with nvcc and cuBLAS, and a compatible NVIDIA driver. The default Qwen3 build needs no Python. Its driver floor is R545 / CUDA 12.3; newer toolkits and model-specific kernels can require a newer driver.

From the repository root, with the checkpoint downloaded:

bash
export CUDA_HOME=/usr/local/cuda
cargo run --release -- --model-path models/Qwen3-4B

Always use --release for GPU builds. The server entrypoint is pegainfer-server; model crates contain the model implementation and diagnostics.

Feature builds and environment options

Qwen3.5 uses Triton AOT kernels, requiring Python and Triton at build time:

bash
uv venv
uv pip install triton
export PEGAINFER_TRITON_PYTHON=.venv/bin/python
cargo run --release --features qwen35 -- --model-path models/Qwen3.5-4B
Variable Purpose
CUDA_HOME CUDA Toolkit location; defaults to /usr/local/cuda
PEGAINFER_CUDA_SM Target GPU architecture when it cannot be detected, e.g. 120
PEGAINFER_TRITON_PYTHON Python interpreter for Qwen3.5 Triton AOT compilation
PEGAINFER_TILELANG_PYTHON Python interpreter for K3 TileLang kernel generation

Other model lines have their own hardware and build requirements; follow the model guides below. Run cargo run --release -- --help for the compiled-in CLI.

Windows source builds

…

bash curl -s http://localhost:8000/v1/completions
-H "Content-Type: application/json"
-d '{"model":"models/Qwen3-4B","prompt":"The capital of France is","max_tokens":32}'

curl -N http://localhost:8000/v1/chat/completions
-H "Content-Type: application/json"
-d '{"model":"models/Qwen3-4B","messages":[{"role":"user","content":"Write a haiku about Rust."}],"max_tokens":64,"stream":true}'


The model guides document supported sampling fields and model-specific limits. [Documentation](https://pegainfer.org/) covers the serving interface; [metrics and dashboards](docs/subsystems/frontend/prometheus-metrics.md) cover observability.

## Development

[`scripts/setup_dev.sh`](scripts/setup_dev.sh) prepares a fresh NVIDIA Ubuntu host using the pinned Rust toolchain and build dependencies. CUDA must already be installed. Container development is documented in [docker/README.md](docker/README.md).

```bash
bash scripts/setup_dev.sh

Run checks in release mode; accuracy and integration tests need a GPU and model weights:

bash
cargo test --release --workspace --lib

PEGAINFER_TEST_MODEL_PATH=models/Qwen3-4B \
  cargo test --release -p pegainfer-qwen3 --test hf_golden_gate

PEGAINFER_TEST_MODEL_PATH=models/Qwen3.5-4B \
  cargo test --release -p pegainfer-qwen35 --features qwen35 --test e2e_scheduler

Browse the engineering docs index for model-specific gates, profiling, and benchmark methodology.

The getting started guide and model pages live at pegainfer.org. Read the engineering stories at pegainfer.org/blog: weight loading, speculative decoding, CUDA graph export, and prefill/decode overlap.

License

Apache-2.0. See NOTICE for third-party attributions. The Dynamo-derived kvbm/kvbm-logical crate retains its original Apache-2.0 headers and NVIDIA Dynamo notice.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustcudacuda-kernelsdeepseekgpu

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.