
Ninfer
Native C++/CUDA inference for Qwen3 and GLM models, self-hosted.
Replaces —

Who it's for
Ninfer provides the full serving stack: CLI for single requests, ninfer-serve for persistent HTTP service, and perplexity scoring. The OpenAI-compatible endpoint means existing Python clients using the openai library connect without changes. TOML configuration files manage model path, context limits, and speculative decoding settings.
You need to run models other than the documented Qwen3 and GLM checkpoints, or your hardware is a different GPU architecture. NInfer's model support is intentionally narrow.
Inference traffic stays entirely on-premises: no data leaves the machine. The OpenAI-compatible API means the team's existing tooling connects to a local endpoint instead of a cloud API, without application-layer changes. The Apache-2.0 license allows internal commercial use without licensing negotiations.
Your team lacks RTX 5090 or DGX Spark hardware, or you need a model not in NInfer's supported set. Cloud inference APIs are the practical alternative for other hardware.
The ninfer-perplexity binary scores model outputs on custom text corpora. Capability evaluations in the README were run through NInfer's OpenAI-compatible route with EvalScope, so the same setup reproduces the published benchmark numbers. The ninfer binary writes answer content to stdout and scoring metadata to stderr, keeping them separable in pipelines.
Your evaluation infrastructure is built around Python-native inference (HuggingFace Transformers, vLLM). NInfer does not expose a Python API; interaction is via CLI arguments or HTTP.
The problem
Running large language models locally at high throughput is hard: Python-based inference stacks add framework overhead, and existing open source serving tools often target a broader set of hardware without tuning to specific GPU architectures. Teams using RTX 5090 or DGX Spark nodes that want to avoid paid inference APIs face a gap: either use a general-purpose server that leaves significant GPU performance on the table, or pay per-token to a commercial API that exposes inference traffic to a third party. The harder part is speculative decoding and distributed multi-GPU inference: wiring these together efficiently requires deep integration with the CUDA execution model that many inference frameworks trade away for portability. For research labs and enterprise teams with data-residency requirements, neither the cloud API route nor a suboptimal local stack is acceptable.
How it works
ninfer-serve exposes /v1/chat/completions and related endpoints, so existing OpenAI API clients connect without code changes. Anthropic-style endpoints are also supported. The server defaults to loopback for security; LAN access requires setting server.host = "0.0.0.0" and optionally a server.api_key in the TOML config.
Speculative decoding runs with Multi-Token Prediction (MTP) and DFlash2 backends depending on the model and artifact. Measured MTP3 acceptance rates on RTX 5090 reach 46-69% depending on the model profile, boosting effective decode throughput at single-request concurrency.
CUDA Graphs reduce kernel launch overhead for decode batches, contributing to the measured throughput. Shared-prefix caching retains exact text and multimodal prefixes, including the state needed to continue them, so repeated common prefixes (system prompts, long contexts) avoid redundant prefill computation.
The same codebase supports single RTX 5090 deployment and model-parallel execution across two DGX Spark nodes via TP2 and optional EP2. Dual-Spark Flash Next measured 109.5 to 811.9 tok/s steady decode at C=1 to C=32 concurrency in the November 2026 benchmark campaign.
Every supported model profile handles text, Vision (image and video), tool calls, and constrained structured output. Vision and speculative decoding require the corresponding components in the downloaded artifact and must be enabled at startup via the TOML config.
Artifacts are available in groupwise-int and NVFP4 quantization. FP8 KV cache is configurable at startup via --kv-dtype fp8. The Qwen3.6-27B NVFP4 profile measured 1,146.9 tok/s aggregate decode at C=8 on RTX 5090 in the documented benchmarks.
Features
- OpenAI- and Anthropic-compatible HTTP API
- Speculative decoding with MTP and DFlash2 backends
- CUDA Graph decode and shared-prefix caching
- Single-GPU and dual-DGX Spark distributed execution
- Vision, tool calls, and constrained structured output
- FP8 and NVFP4 quantization formats
How to install
Deploy NInfer using Docker with the NVIDIA Container Toolkit installed on the host.
docker build --tag ninfer:local .
docker run --rm --gpus '"device=0"' --publish 8080:8080 --volume "$PWD/models:/models:ro" ninfer:local ninfer-serve /models/qwen3_8_27b_nvfp4.ninfer --host 0.0.0.0 --max-context 8192 --kv-dtype fp8Recommended for this setup
Strengths
- Measured benchmark data for the specific hardware it targets: Ninfer publishes its performance methodology and recorded measurements for RTX 5090 and DGX Spark, with configurations, engine versions, and cache formats. The benchmarks include concurrent decode saturation, single-request prefill throughput, and EvalScope capability evaluations. This is verifiable from the documented result pages rather than marketing claims.
- Apache-2.0 license for unrestricted self-hosted use: The software license is Apache-2.0: you can run it on internal infrastructure, modify the source, and deploy it in commercial applications without licensing fees. Model weights have separate licenses documented in each model card, but the inference engine itself carries no commercial restrictions.
- OpenAI-compatible serving with no per-token charges: Once the model artifact is downloaded and the binary is running, inference requests carry no per-token cost. For high-volume private workloads, that is a fixed infrastructure cost versus recurring usage charges from paid inference services.
- 90.4% GPQA-Diamond accuracy on Qwen3.8-27B NVFP4: The Qwen3.8-27B NVFP4 profile scored 90.40% on GPQA-Diamond and 96.67% on AIME 2026 when evaluated through NInfer's OpenAI-compatible route with thinking enabled, MTP3, and EvalScope 1.9.0. These numbers confirm that the quantized artifacts served by NInfer preserve model capability.
Trade-offs
- Requires RTX 5090 or DGX Spark hardware: NInfer's supported deployments are specifically RTX 5090 (x86-64, sm_120a) and DGX Spark (AArch64, sm_121a). It does not run on consumer GPUs, cloud GPU instances, or older NVIDIA architectures. Teams without this specific hardware have no path to use it.
- Source build required; no prebuilt binaries: Installation requires building from source with CMake 3.28+, a C++20 host compiler, Ninja, CUDA 13.4, and several system libraries including FFmpeg and liburing. Docker simplifies the dependency chain for the RTX 5090 target, but there is no prebuilt binary download. First-time setup requires familiarity with CMake build systems.
- Limited model support; large weight downloads required: NInfer supports only Qwen3.6-27B, Qwen3.8-27B, Qwen3.6-35B-A3B, Qwen3.8-Flash-Next, and GLM-5.3-Flash in the documented configurations. Flash Next artifacts total 101 GiB across four files; GLM totals 178 GiB across six. Custom weight conversion from other formats is documented but not automated.
- 92 open issues as of November 2026: The GitHub issue tracker shows 92 open issues (pull requests excluded, from GitHub's issue search API). For a project created in June 2026, that volume at 3,356 stars reflects active development and an evolving codebase. Expect rough edges, especially on edge cases in model configuration and distributed deployment.
Tech stack
FAQ
NInfer runs on RTX 5090 (x86-64, sm_120a) and DGX Spark (AArch64, sm_121a). These are the only supported targets. The build system checks the requested architecture at CMake time, and there is no general CUDA fallback for other NVIDIA GPUs.
The primary path is building from source on Linux with CMake 3.28+, a C++20 compiler, Ninja, CUDA 13.4, and system dependencies including FFmpeg, liburing, hwloc, and libjpeg. The repository includes a Dockerfile for the RTX 5090 target that handles the dependency chain. Run docker build --tag ninfer:local . then docker run with --gpus to start the server. No prebuilt binary downloads are available.
NInfer supports Qwen3.6-27B, Qwen3.8-27B, Qwen3.6-35B-A3B, Qwen3.8-Flash-Next, and GLM-5.3-Flash. Official .ninfer artifacts are available on HuggingFace under the neroued organization. Flash Next and GLM have multi-file downloads (101 GiB and 178 GiB respectively). Custom weights require the weight conversion process documented in the repository.
Yes. ninfer-serve exposes /v1/chat/completions and other OpenAI-compatible endpoints. Any client library that speaks the OpenAI API format, including the openai Python package, can point to the local NInfer server. Anthropic-style endpoints are also supported. The server defaults to loopback (127.0.0.1:8080); set server.host = "0.0.0.0" in the TOML config for LAN access.
NInfer is Apache-2.0 licensed: you can run it, modify it, and use it for internal commercial applications without paying licensing fees or seeking permission. Model weights are licensed separately: 27B and 35B-A3B artifacts are Apache-2.0; Flash Next combines the Qwen Community License 1.0 and NVIDIA Open Model License; GLM uses MIT. Check each model card before deploying a specific artifact in a commercial context.