vllm-project/vllm-torchtpu
PyTorch-native vLLM plugin for serving existing models on Google Cloud TPUs
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
torch.compile(backend="tpu").support_matrices/nightly/ tracks unit, correctness, and benchmark status.VLLM_XLA_CACHE_PATH.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.
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.
Quick Start & Installation
pip install \ --extra-index-url https://download.pytorch.org/whl/cpu \ vllm-torchtpu
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| vllm-torchtpu ★ | 152 | +5 | Python | Apache-2.0 | PyTorch-native vLLM plugin for serving existing models on Google Cloud TPUs |
| OmniRoute | 92.1k | +1.5k | TypeScript | MIT | Self-hosted OpenAI-compatible gateway for multi-provider routing and fallback |
| freellmapi | 62k | +2.6k | TypeScript | MIT | Self-hosted LLM gateway for routing across free tiers and custom endpoints |
| bifrost | 10.2k | +125 | Go | Apache-2.0 | Self-hosted Go gateway for routing and governing multi-provider LLM traffic |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/vllm-project/vllm-torchtpu.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about vllm-torchtpu
How does the plugin integrate, and do I need to rewrite my model in JAX?
torch_tpu and torch.compile(backend="tpu"), with custom JAX/Pallas kernels for selected operations. Applications can keep using vllm serve and /v1/chat/completions; check the support matrix for the model and flags you intend to use.Which hardware should I start with, and how should I size it?
VLLM_XLA_CACHE_PATH.Can I use it commercially or redistribute it in a serving image?
How should I choose between TorchTPU, vLLM JAX, GPU-backed vLLM, and the OpenAI API?
tpu-inference) for pure JAX model implementations, or GPU-backed vLLM if GPUs are already your deployment target. Choose a managed service such as the OpenAI API if you want the provider to run the inference infrastructure. The OpenAI-compatible endpoint eases client integration but does not guarantee identical models, features, or outputs.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy