What is Narwhal?
Narwhal is an adaptive, disaggregated inference framework that automatically hot-swaps prefill and decode roles, without having to reload model weights. It scales from a single GPU to distributed multi-node deployments.
How engines change roles
The role controller scores the current role split and each adjacent split, one engine move away. It works from measured engine profiles, offered demand, and resident work. The score is the worst projected service-level objective (SLO) ratio across time to first token (TTFT), time per output token (TPOT), and decode queueing.
Demand is the measured window demand, using the larger of the short- and long-horizon decode estimates for decode-to-prefill candidates. The evidence window closes after controller.reactive.evidence_span_s and the minimum arrivals, or after controller.reactive.evidence_max_span_s under sparse traffic.
The controller moves to the adjacent split that improves the score by at least the configured margin. A decode-to-prefill move requires a closed evidence window and stable decode demand, and a prefill-to-decode move proceeds with the window open.
Each move passes the guards for pinned engines, role floors, cooldown, dwell time, the resident-stream ceiling on decode donors, and engine lifecycle holds. Floor repair moves one engine per monitor pass while a phase sits below its configured floor.
New requests follow the revised split, and resident requests finish on their assigned engines.
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:
Trying it on one GPU
Narwhal dev runs a local NVIDIA CUDA fleet on Ubuntu or Ubuntu under WSL2.
narwhal dev init
narwhal dev up
narwhal dev verify
narwhal dev status
narwhal dev down
The installed template starts two engines on an NVIDIA GPU with 8 GB of VRAM or less. The RTX 5090 reference template starts four engines on an RTX 5090.
Bringing up a fleet
Run these gates in order from a management workstation:
- Freeze inputs and discover the deployment in Gate A.
- Package and install the approved revision in Gate B.
- Validate and start every engine in Gate C.
- Qualify the transfer fabric in Gate D.
- Attest the live engines in Gate E.
- Profile the engines and run preflight in Gate F.
- Start the router and validate capacity through an SSH tunnel in Gate G.
Documentation
Contributing
Built on Arrow
Narwhal's scheduling algorithms derive from Arrow: Adaptive Scheduling Mechanisms for Disaggregated LLM Inference Architecture by Wu et al. (2025).
Metadata
Release files for narwhal-inference 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| narwhal_inference-0.4.1.tar.gz | 3.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| narwhal_inference-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.7 MB
Release files / narwhal_inference-0.4.1.tar.gz
| Download URL | narwhal_inference-0.4.1.tar.gz |
|---|---|
| Size | 3.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc18befab62000a2db1b06f620c72d4b6698336cd24f7a97126e3edc2e0ee96a
|
|
BLAKE2b-256 checksum How to use checksums |
dbe8f96c56cfa87d7251525df8d697404940dfb4c3e123ebbdf95c1dd37da7ba
|
| 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 2, 2026.
Transparency logRelease files / narwhal_inference-0.4.1-py3-none-any.whl
| Download URL | narwhal_inference-0.4.1-py3-none-any.whl |
|---|---|
| Size | 311.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a40238aa6c65d93637d8cd12c9ef5f66a41389e54b22a998225808a926bbe11
|
|
BLAKE2b-256 checksum How to use checksums |
9fb47c42088ae3990a94cc7d902682828d0c43c5e8a0461ca0e1a6aefde771f2
|
| 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 2, 2026.
Transparency log