TGI logo

TGI

Free

a toolkit for deploying and serving Large Language Models (LLMs).

FreeFree tier
Inputs: textOutputs: text
Type
Open Source
Company
Hugging Face

About TGI

Text Generation Inference (TGI) is a toolkit for deploying and serving Large Language Models (LLMs) with high performance and production-ready features. Developed by Hugging Face, TGI supports popular open-source LLMs such as Llama, Falcon, StarCoder, BLOOM, GPT-NeoX, and T5. It includes optimizations like Tensor Parallelism for multi-GPU inference, token streaming via Server-Sent Events, continuous batching, Flash Attention and Paged Attention, quantization with bitsandbytes and GPT-Q, and safetensors weight loading. TGI also provides fine-tuning support, guidance for structured outputs (function calling and tool-use), watermarking, logits warping, and observability through distributed tracing and Prometheus metrics. It is used in production by Hugging Chat, OpenAssistant, and nat.dev. Note: TGI is now in maintenance mode; active development has shifted to downstream engines like vLLM and SGLang.

Key Features

Simple launcher to serve popular LLMs
Production ready with distributed tracing (OpenTelemetry) and Prometheus metrics
Tensor Parallelism for faster inference on multiple GPUs
Token streaming using Server-Sent Events (SSE)
Continuous batching for increased total throughput
Optimized transformers code using Flash Attention and Paged Attention
Quantization with bitsandbytes and GPT-Q
Safetensors weight loading
Watermarking for LLM output detection
Logits warper (temperature scaling, top-p, top-k, repetition penalty)

Pros & Cons

Pros
  • High performance through Flash Attention and continuous batching
  • Production-ready observability with OpenTelemetry and Prometheus
  • Supports a wide range of popular open-source LLMs
  • Includes quantization for reduced memory and faster inference
  • Fine-tuning support for custom models
  • Guidance for structured outputs enables advanced tool-use patterns
Cons
  • No longer actively developed; in maintenance mode (minor fixes only)
  • Documentation recommends migrating to vLLM, SGLang, llama.cpp, or MLX for future needs

Best For

Serving open-source LLMs in production environmentsBuilding chat interfaces like Hugging ChatCreating model playgrounds for comparing LLMs (e.g., nat.dev)Supporting community-driven LLM training initiatives (e.g., OpenAssistant)Enabling function calling and tool-use in LLM applications

FAQ

What is Text Generation Inference (TGI)?
TGI is a toolkit from Hugging Face for deploying and serving Large Language Models with high performance and production features.
Which models does TGI support?
TGI supports many popular open-source LLMs including Llama, Falcon, StarCoder, BLOOM, GPT-NeoX, and T5.
Is TGI still being actively developed?
No, TGI is now in maintenance mode. The project will accept pull requests for minor bug fixes, documentation improvements, and lightweight maintenance tasks.
What are some key optimizations in TGI?
Key optimizations include Tensor Parallelism, token streaming, continuous batching, Flash Attention, Paged Attention, and quantization with bitsandbytes or GPT-Q.