Skip to main content

The Narwhal logo, a black narwhal with a teal spiral tusk above the wordmark

Apache-2.0 license Python 3.11 through 3.13 Lint and format by ruff Types checked with mypy Latest PyPI version

Documentation Deployment API reference Issues Contributing

What is Narwhal?

Narwhal is an adaptive, disaggregated inference framework that automatically hot-swaps prefill and decode roles as demand changes, and without having to reload model weights. It can scale from a single GPU to multi-node deployments.

Capability Behavior Guide
Role hot-swap Reassigns prefill and decode roles across a fixed GPU fleet, with NIXL key-value (KV) transfer between them Core concepts documentation
Serving Serves completion and chat requests, streamed or buffered, with latency-aware admission HTTP API reference documentation
Fault tolerance Fails over to a warm-standby router and readmits engines against their live process generation Operating Narwhal documentation
Measurement Profiles engines, runs ordered benchmark points, and keeps the evidence from each point Measuring a fleet documentation
Observability Exports router and engine metrics to Prometheus and a provisioned Grafana dashboard Setting up observability documentation
Operator tooling Validates fleet files offline and collects private diagnostic bundles CLI reference documentation
Development mode Runs two to eight engines on one NVIDIA CUDA GPU under Ubuntu or WSL2 Narwhal dev documentation

How engines change roles

The role controller scores the current role split and each adjacent split, one engine move away. It uses measured engine profiles, offered demand, and resident work, and moves one engine only when the worst projected SLO ratio improves and every role, lifecycle, and resident-work guard passes. New requests follow the revised split; resident requests finish on their assigned engines.

Role control and capacity floors documentation

Role controller changing engine roles with weights resident.

Evaluation

Read the full evaluation: Evaluating Narwhal

Getting the commands

Install on Linux with Python 3.11 or newer:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install narwhal-inference
narwhal-serve --version
narwhal --help

The wheel installs these commands:

narwhal, narwhal-engine, narwhal-serve, narwhal-attest, narwhal-profile, and narwhal-check. See Installing from PyPI and the CLI reference for their options.

Trying it on one GPU

Narwhal dev runs a local NVIDIA CUDA fleet on Ubuntu, either directly or under WSL2.

narwhal dev init
narwhal dev up
narwhal dev verify
narwhal dev status
narwhal dev down

The default template starts two vLLM engines and the SGLang template starts two SGLang engines, each on an NVIDIA GPU whose free VRAM is at least 80% of its total plus 512 MiB. The RTX 5090 reference template starts four vLLM engines on an RTX 5090.

Installed template documentation RTX 5090 reference documentation

Bringing up a fleet

Run the deployment gates in Deploying a fleet from a management workstation.

Documentation

The MkDocs site routes installation, deployment, operation, measurement, and reference tasks.

Contributing

Contributing Code of conduct Security policy

Built on Arrow

Narwhal's scheduling algorithms derive from Arrow: Adaptive Scheduling Mechanisms for Disaggregated LLM Inference Architecture by Wu et al. (2025).

Arrow paper on arXiv Citation metadata for Arrow and Narwhal Apache-2.0 license

Metadata

Release files for narwhal-inference 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for narwhal-inference 0.7.0
File Size Uploaded
narwhal_inference-0.7.0.tar.gz 4.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for narwhal-inference 0.7.0
File Interpreter ABI Platform
narwhal_inference-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.6 MB

Release files / narwhal_inference-0.7.0.tar.gz

Download URL narwhal_inference-0.7.0.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
e1735ace58e95b4dee8ce44d2e847cca8b7a42dfb6a7fc7459bc06c0274cc335
BLAKE2b-256 checksum
How to use checksums
0b1c1686d6a70a879ee83db9322e80ae0937d236b3ff7db15ff9d2201a0ceda6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / narwhal_inference-0.7.0-py3-none-any.whl

Download URL narwhal_inference-0.7.0-py3-none-any.whl
Size 419.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebd2b6202f337274d6cbda6a108697a1235c5f96b8af65fff44a50800818338d
BLAKE2b-256 checksum
How to use checksums
4bee4ff0c05992d8b3a1ba18710e1b4b6f05fe0b78949142c649c5091d5bd2b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page