# Repository Briefing: vllm-project/vllm-torchtpu
> Source: https://repoforai.com/repo/vllm-project/vllm-torchtpu (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/vllm-project/vllm-torchtpu
- **Official Docs / Website**: https://vllm-torchtpu.readthedocs.io/
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (93/100 · Maintenance 35/35 · Adoption 18/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.33.0 (2026-11-17) — https://github.com/vllm-project/vllm-torchtpu/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, GPU, API
- **Momentum**: 152 ★ total (+0 24h / +5 7d) · 104 forks
- **When to Use**: Best for: Teams with Cloud TPU capacity that want to keep vLLM's PyTorch models and OpenAI-compatible interface, and can validate their target model and serving topology. Skip if: You need a GPU backend, cannot provision Cloud TPU or standardize on Python 3.12, or prefer a managed API to operating TPU serving infrastructure.

## Overview
```text
### Architecture & Core Mechanics
vLLM TorchTPU is an out-of-tree platform plugin, not a separate serving engine. vLLM keeps its standard PyTorch model definitions and runner; the plugin routes TPU execution through TorchTPU (`torch_tpu`) and `torch.compile(backend="tpu")`. Custom JAX/Pallas kernels handle operations such as attention, MoE, and quantized matrix multiplication. JAX is used at the kernel layer, so serving a supported PyTorch model does not require a JAX rewrite.

The install entry point is `vllm-torchtpu`; `pyproject.toml` names the core distribution `vllm-torchtpu-core` and uses setuptools, wheel, and setuptools_scm. It constrains Python to `>=3.12,<3.13` because the `tpu-raiden-torch` wheels are cp312-only. `vllm serve` remains the CLI entry point, and the server exposes the OpenAI-compatible `/v1/chat/completions` endpoint.

### Key Capabilities & Differentiators
TPU kernels include Ragged Paged Attention, dense and sparse MLA, Gated DeltaNet, fused MoE with SparseCore offload, and FP8, INT8, and MXFP4 matmuls. Model coverage includes Qwen3/3.5, DeepSeek-V3/R1/V4, Llama 3/4, GPT-OSS, Mixtral, and multimodal families such as Qwen-VL and Gemma VL. Speculative decoding, prefix caching, multi-LoRA, structured output, and multimodal inputs use standard vLLM options; check model, feature, and quantization combinations rather than assuming all can be used together.

Tensor, data, pipeline, and expert parallelism can compose with prefill/decode context parallelism across single-host and multi-host TPU slices. The backend also supports disaggregated prefill and decode serving. The v7x nightly matrices under `support_matrices/nightly/` track unit, correctness, and benchmark status and are a useful starting point for choosing configurations to validate.

### Trade-offs & Limitations
This backend is a strong fit for an existing vLLM service moving to Cloud TPU because model definitions and the serving interface can stay in place. It is not a GPU backend. GPU-backed vLLM is the more direct baseline if you already operate a GPU fleet; vLLM JAX (`tpu-inference`) is the alternative for pure JAX model implementations. An OpenAI-compatible API can reduce client migration work compared with changing interfaces, but unlike a managed API, this deployment leaves capacity, upgrades, and incident response with your team.

TPU v7x is tested on every pull request and nightly; v6e is supported but not covered by CI, and v5e/v5p are experimental and outside CI. Python packaging is marked Alpha. Initial graph compilation for configured shapes can take several minutes; persist artifacts with `VLLM_XLA_CACHE_PATH` and test cold and warm starts separately. Size TPU memory for weights, KV cache, and runtime headroom at your target context length and concurrency, and benchmark the TPU/GPU comparison on the same workload rather than assuming a throughput or cost advantage.

### Hardware & Deployment Guide
Provision a Google Cloud TPU VM and confirm quota before choosing a slice. With Python 3.12, install `vllm-torchtpu` and its matching vLLM using `pip install --extra-index-url https://download.pytorch.org/whl/cpu vllm-torchtpu`, or use the prebuilt `vllm/vllm-torchtpu` image. For a reproducible rollout, pin the tested package versions or image tag rather than deploying `latest`.

Use `vllm.LLM` for offline batches or `vllm serve` for an API. The single-device example uses `--tensor-parallel-size 1 --max-model-len 4096`. Kubernetes and multi-host serving are documented deployment paths. The v0.33.0 backend release pairs with vLLM v0.33.0, up from v0.32.0 in the preceding backend release, while vllm-omni stays at 0.32.0rc1. Revalidate your model, features, and topology when upgrading that stack.
```

## Key Capabilities
```text
- Execution: An out-of-tree platform plugin keeps vLLM's PyTorch runner and compiles through `torch.compile(backend="tpu")`.
- Kernels: Pallas implementations cover Ragged Paged Attention, dense and sparse MLA, Gated DeltaNet, and fused MoE with SparseCore offload.
- Quantization: TPU kernels cover FP8, INT8, and MXFP4 matmuls; validate the exact model-format pairing.
- Scaling: Tensor, data, pipeline, expert, and context parallelism span single- and multi-host TPU slices, with disaggregated prefill and decode.
- Validation: TPU v7x runs per-PR and nightly CI; `support_matrices/nightly/` tracks unit, correctness, and benchmark status.
- Operations: The backend requires Python 3.12, ships as a Docker image, and persists compiled artifacts via `VLLM_XLA_CACHE_PATH`.
```

## Quick Start / Clone
```bash
pip install \
  --extra-index-url https://download.pytorch.org/whl/cpu \
  vllm-torchtpu
```
