MyGit

GeeeekExplorer/nano-vllm

Fork: 995 Star: 8035 (更新于 2025-11-04 17:29:23)

license: MIT

Language: Python .

Nano vLLM

GitHub网址

GeeeekExplorer%2Fnano-vllm | Trendshift

Nano-vLLM

A lightweight vLLM implementation built from scratch.

Key Features

  • 🚀 Fast offline inference - Comparable inference speeds to vLLM
  • 📖 Readable codebase - Clean implementation in ~ 1,200 lines of Python code
  • Optimization Suite - Prefix caching, Tensor Parallelism, Torch compilation, CUDA graph, etc.

Installation

pip install git+https://github.com/GeeeekExplorer/nano-vllm.git

Model Download

To download the model weights manually, use the following command:

huggingface-cli download --resume-download Qwen/Qwen3-0.6B \
  --local-dir ~/huggingface/Qwen3-0.6B/ \
  --local-dir-use-symlinks False

Quick Start

See example.py for usage. The API mirrors vLLM's interface with minor differences in the LLM.generate method:

from nanovllm import LLM, SamplingParams
llm = LLM("/YOUR/MODEL/PATH", enforce_eager=True, tensor_parallel_size=1)
sampling_params = SamplingParams(temperature=0.6, max_tokens=256)
prompts = ["Hello, Nano-vLLM."]
outputs = llm.generate(prompts, sampling_params)
outputs[0]["text"]

Benchmark

See bench.py for benchmark.

Test Configuration:

  • Hardware: RTX 4070 Laptop (8GB)
  • Model: Qwen3-0.6B
  • Total Requests: 256 sequences
  • Input Length: Randomly sampled between 100–1024 tokens
  • Output Length: Randomly sampled between 100–1024 tokens

Performance Results:

Inference Engine Output Tokens Time (s) Throughput (tokens/s)
vLLM 133,966 98.37 1361.84
Nano-vLLM 133,966 93.41 1434.13

Star History

Star History Chart

最近版本更新:(数据更新于 2025-11-05 08:29:43)

主题(topics):

deep-learning pytorch inference nlp llm transformer

GeeeekExplorer/nano-vllm同语言 Python最近更新仓库

2025-11-08 13:43:46 ok-oldking/ok-wuthering-waves

2025-11-08 08:06:41 awslabs/mcp

2025-11-08 07:05:16 langchain-ai/langchain

2025-11-08 05:26:44 pipecat-ai/pipecat

2025-11-08 04:56:58 Significant-Gravitas/AutoGPT

2025-11-08 01:32:16 ultralytics/ultralytics