Large Language Model Text Generation Inference
open sourceApache-2.0self-hostablefree
Text Generation Inference (TGI) is Hugging Face's Rust, Python and gRPC server for deploying open large language models, used in production at Hugging Face for Hugging Chat, the Inference API and Inference Endpoints. A launcher serves a model from the Hugging Face Hub with continuous batching, token streaming over Server-Sent Events, tensor parallelism across GPUs, Flash Attention and Paged Attention, quantization (bitsandbytes, GPTQ, AWQ, Marlin, FP8) and an OpenAI-compatible Messages API, with OpenTelemetry tracing and Prometheus metrics. In December 2025 Hugging Face put TGI in maintenance mode and recommended vLLM and SGLang (or llama.cpp and MLX locally) instead, and the GitHub repository has since been archived. It's Apache-2.0 licensed.
Problems it solves
- serve a Hugging Face Hub model behind an HTTP API with token streaming on my own GPUs
- continuous batching for a self-hosted LLM so concurrent requests share the GPU
- an OpenAI-compatible chat completions endpoint for an open model in a Docker container
- shard one LLM across several GPUs with tensor parallelism on a single server
- Prometheus metrics and OpenTelemetry traces from our LLM inference server
- our TGI deployment is in maintenance mode and we need to know what to move to
Features
- launcher that serves popular open LLMs from the Hugging Face Hub
- continuous batching of incoming requests
- token streaming with Server-Sent Events
- tensor parallelism across GPUs
- Flash Attention and Paged Attention
- quantization: bitsandbytes, GPT-Q, EETQ, AWQ, Marlin and FP8
- Messages API compatible with OpenAI's Chat Completions
- Safetensors weight loading
- OpenTelemetry distributed tracing and Prometheus metrics
- official Docker images
Limitations
- Doesn't get new features: Hugging Face put TGI in maintenance mode in December 2025 and recommends vLLM or SGLang1
Capabilities
| Has an API | plan not known |
|---|
Alternatives
The same job
These do what Text Generation Inference does.
- vLLM A high-throughput and memory-efficient inference and serving engine for LLMs
- SGLang Fast inference for LLMs and multimodal models
- llama.cpp LLM inference in C/C++
- NVIDIA Dynamo-Triton Open source inference serving software that deploys AI models from any major framework
- Ray Serve Scalable model serving library for building online inference APIs
- TensorRT-LLM Optimized LLM and visual generation inference on NVIDIA GPUs
