Metadata-Version: 2.4
Name: nvserve
Version: 0.5.0
Summary: Run large language models on low-RAM PCs by streaming the weights from the SSD
Author: Suraj Singh
License-Expression: MIT OR Apache-2.0
License-File: LICENSE-APACHE
License-File: LICENSE-MIT
Keywords: llm,inference,gguf,openai,cpu,ssd
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# NVserve

**Run 70B-class and large mixture-of-experts LLMs on a laptop with 4–8 GB of RAM and no GPU.**

NVserve streams a model's weights from your SSD one layer at a time, so a 40 GB model runs in
under 3 GB of memory. It speaks the OpenAI API, so existing clients and tools work with it
unchanged.

| Model | Size on disk | Memory used | Speed (laptop, NVMe) |
|---|---|---|---|
| Qwen3-30B-A3B (MoE) | 17.3 GiB | 2.9 GiB | 0.35–0.47 s/token |
| DeepSeek-V2-Lite (MoE, MLA) | 9.7 GiB | 2.9 GiB | 0.35 s/token |
| Llama-3.1-70B | 39.6 GiB | 3.2 GiB | 4.2 s/token with a 1B draft model |

All at Q4_K_M under a 4 GiB memory cap.

## Install

```bash
pip install nvserve
```

On Linux distributions that manage the system Python (Ubuntu 23.04+, Debian 12+), use
`pipx install nvserve` or a virtual environment instead.

The package contains the native `nvserve` program, not a Python library. It works on Windows
10/11 and on Linux with glibc 2.34 or newer, on x86-64 CPUs. It runs the fastest build your
CPU supports: the AVX2 build, or a compatible build for older CPUs. Set `NVSERVE_BUILD=compat`
or `NVSERVE_BUILD=v3` to choose one yourself.

## Quick start

Download a GGUF model, for example
[Qwen3-30B-A3B Q4_K_M](https://huggingface.co/Qwen/Qwen3-30B-A3B-GGUF), and convert it once:

```bash
nvserve convert Qwen3-30B-A3B-Q4_K_M.gguf qwen3-30b-a3b.nvpack
```

Chat with it under a 4 GB memory budget:

```bash
nvserve run qwen3-30b-a3b.nvpack --chat --no-think --prompt "Why is the sky blue?" --mem-limit 4G
```

Or serve it to any OpenAI client:

```bash
nvserve serve qwen3-30b-a3b.nvpack --mem-limit 4G --port 8080
```

```python
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="unused")
reply = client.chat.completions.create(
    model="qwen3-30b-a3b",
    messages=[{"role": "user", "content": "Write a haiku about SSDs."}],
)
print(reply.choices[0].message.content)
```

`nvserve --help` lists every command and option.

## License

Copyright (c) 2026 Suraj Singh. Licensed under either of the Apache License, Version 2.0 or
the MIT license, at your option.
