text-generation-inference documentation

Using TGI with Nvidia GPUs

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Using TGI with Nvidia GPUs

TGI optimized models are supported on NVIDIA H100, A100, A10G and T4 GPUs with CUDA 12.2+. Note that you have to install NVIDIA Container Toolkit to use it.

For other NVIDIA GPUs, continuous batching will still apply, but some operations like flash attention and paged attention will not be executed.

TGI can be used on NVIDIA GPUs through its official docker image:

model=teknium/OpenHermes-2.5-Mistral-7B
volume=$PWD/data # share a volume with the Docker container to avoid downloading weights every run

docker run --gpus all --shm-size 64g -p 8080:80 -v $volume:/data \
    ghcr.io/huggingface/text-generation-inference:3.0.1 \
    --model-id $model

The launched TGI server can then be queried from clients, make sure to check out the Consuming TGI guide.

< > Update on GitHub