> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Wenyueh/MinivLLM/llms.txt
> Use this file to discover all available pages before exploring further.

# miniVLLM

> A from-scratch replication of the vLLM inference engine with self-contained paged attention and flash attention implemented in Triton.

miniVLLM is a minimal, readable implementation of the [vLLM](https://github.com/vllm-project/vllm) LLM inference engine. Built on top of Nano-vLLM, it features fully self-contained custom Triton kernels for both paged attention (decode) and flash attention (prefill), making it an ideal resource for learning how production LLM serving systems work — and for running them.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Run your first inference in under 5 minutes with a working code example.
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Install miniVLLM and its dependencies with uv.
  </Card>

  <Card title="Core Concepts" icon="brain" href="/concepts/paged-attention">
    Understand paged attention, flash attention, KV caching, and scheduling.
  </Card>

  <Card title="API Reference" icon="code" href="/api/llm-engine">
    Full reference for LLMEngine, SamplingParams, and all public APIs.
  </Card>
</CardGroup>

## What is miniVLLM?

miniVLLM implements the full LLM inference pipeline from scratch, including:

* **Custom Triton kernels** — paged attention for decode, flash attention (O(N) memory) for prefill
* **Paged KV cache** — memory-efficient KV cache management with prefix caching
* **Iteration-level scheduler** — prefill-first scheduling with preemption support
* **Multi-GPU tensor parallelism** — distributed inference via NCCL
* **CUDA graph optimization** — low-latency decode via captured replay graphs

The codebase is designed to be readable and educational. Each component maps directly to a concept in modern LLM serving.

## Getting started

<Steps>
  <Step title="Install dependencies">
    Install [uv](https://docs.astral.sh/uv/) and sync the project:

    ```bash theme={null}
    curl -LsSf https://astral.sh/uv/install.sh | sh
    uv sync
    ```
  </Step>

  <Step title="Run the inference demo">
    Execute the main inference engine demo using Qwen3:

    ```bash theme={null}
    uv run python main.py
    ```
  </Step>

  <Step title="Run benchmarks">
    Compare attention implementations across prefill and decode phases:

    ```bash theme={null}
    uv run python benchmark_prefilling.py
    uv run python benchmark_decoding.py
    ```
  </Step>

  <Step title="Explore the architecture">
    Read the [Architecture Guide](/architecture/engine) to understand how each component fits together, or follow the [step-by-step implementation guide](/architecture/layers).
  </Step>
</Steps>

## Explore by topic

<CardGroup cols={3}>
  <Card title="Paged Attention" icon="pager" href="/concepts/paged-attention">
    How KV cache is managed in fixed-size pages to eliminate fragmentation.
  </Card>

  <Card title="Flash Attention" icon="bolt" href="/concepts/flash-attention">
    O(N) memory attention via online softmax, implemented in Triton.
  </Card>

  <Card title="Scheduling" icon="calendar" href="/concepts/scheduling">
    Iteration-level prefill/decode scheduling with preemption.
  </Card>

  <Card title="Multi-GPU" icon="server" href="/architecture/multi-gpu">
    Tensor parallelism across GPUs using NCCL all-reduce.
  </Card>

  <Card title="Benchmarks" icon="chart-line" href="/benchmarks/prefill">
    Comparative benchmarks of PyTorch, Triton, and Flash Attention.
  </Card>

  <Card title="Models" icon="cube" href="/architecture/models">
    Qwen3 and Llama 3.2 implementations built on parallel layers.
  </Card>
</CardGroup>
