278 Commits
Author SHA1 Message Date
b4adbf2f6e docs: add AWS (EC2/SageMaker) deployment + benchmarking guide (#3352)
* docs: add AWS (EC2/SageMaker) deployment + benchmarking guide

- Add an AWS deployment tutorial for EC2 + SageMaker
- Fix SageMaker example indentation and link to the new guide
- Add the new guide to the docs toctree

* docs: address AWS deployment review feedback

* Apply suggestion from code review

---------

Co-authored-by: Fahad Alghanim <[email protected]>
Co-authored-by: Alvaro Bartolome <[email protected]>
2026-03-21 20:34:22 +09:00
Lysandre Debut 34988476cb Maintenance mode (#3345)
* Maintenance mode

Maintenance mode

* Light reword

* Light reword

* Light reword

* Maintenance mode

* Maintenance mode
2025-12-11 15:29:10 +01:00
Alvaro Moran efb94e0d3d Patch version 3.3.6 (#3329)
* chore: prepare version 3.3.6

* fix(benchmark): clear up progress_gauge fn signature

Otherwise there is a compiler error.
2025-09-16 19:15:23 -04:00
Eliott C. d2ad7c484e Update iframe sources for streaming demo (#3327) 2025-09-09 15:36:19 +02:00
Phil 5739b5b088 Add missing backslash (#3311) 2025-09-06 09:50:14 +02:00
Alvaro MoranandDaniël de Kok 0f79162288 chore: prepare version 3.3.5 (#3314)
* chore: prepare version 3.3.5

* black

* neuron: black

* Update hf-xet in uv lockfile

* Attempt to fix API doc check failure

Add `error_type` where missing.

* Pin redocly version

* Sync redocly with Nix for now

---------

Co-authored-by: Daniël de Kok <[email protected]>
2025-09-02 15:35:42 +02:00
Daniël de Kokanddrbh 06d9d88b95 Disable Cachix pushes (#3312)
* Disable Cachix pushes

This is not safe until we have sandboxed builds. For TGI alone
this might not be a huge issue, but with Cachix caching disabled
in hf-nix, TGI CI would build all the packages and push it to
our cache.

* fix: bump docs

---------

Co-authored-by: drbh <[email protected]>
2025-08-26 13:27:57 -04:00
Emmanuel Ferdman b4386b8c77 Migrate to V2 Pydantic interface (#3262)
Signed-off-by: Emmanuel Ferdman <[email protected]>
2025-08-18 23:55:21 +02:00
Wang, Yi ebb26f0ccd [gaudi] Deepseek v2 mla and add ep to unquantized moe (#3287)
Signed-off-by: Wang, Yi A <[email protected]>
2025-07-07 11:29:39 +02:00
Wang, Yiandregisss 778b61c0da [gaudi] Remove unnecessary reinitialize to HeterogeneousNextTokenChooser to make sampling output correct (#3284)
Signed-off-by: Wang, Yi A <[email protected]>
Co-authored-by: regisss <[email protected]>
2025-07-03 10:03:16 +02:00
David Corvoysier 238fbd4d50 Neuron backend fix and patch version 3.3.4 (#3273)
* fix(neuron): wrong assertion when batch_size==1

* chore: prepare 3.3.4
2025-06-19 10:52:41 +02:00
David Corvoysier b4d17f18ff chore: prepare release 3.3.3 (#3269) 2025-06-18 11:55:26 +02:00
Daniël de Kok 249189d96e Prepare for 3.3.2 (#3249) 2025-05-30 16:16:36 +02:00
Daniël de Kok 674c514d44 Prepare for 3.3.1 (#3238) 2025-05-22 09:43:55 +02:00
Daniël de Kok 56c8189467 Prepare for 3.3.0 (#3220) 2025-05-09 15:50:29 +02:00
Julien Chaumond 7253be349a Update client SDK snippets (#3207)
* Update client SDK snippets

* good catch from copilot
2025-05-01 17:10:51 +02:00
drbhandAlex Weston 12ea8d74c7 Pr 2982 ci branch (#3046)
* Add json_schema alias for GrammarType

* Add tests for all aliases

* fix: various linter adjustments

* fix: end-of-file-fixer lint

* fix: add test snapshots and avoid docs change

* fix: another end-of-file-fixer lint

* feat: support json_schema grammar constraining and add tests

* fix: bump openapi doc with new grammar option

* fix: adjust test payload

* fix: bump test snaps

---------

Co-authored-by: Alex Weston <[email protected]>
2025-05-01 10:17:16 -04:00
Julien Chaumond 6afe4307ab doc typo (#3206)
typo
2025-05-01 14:31:48 +02:00
Mohit SharmaandNicolas Patry 02715dc53f Add option to configure prometheus port (#3187)
* add prometheus port

* fix doc

* add port for trtllm and llamacpp

* Fixing format after rebase.

---------

Co-authored-by: Nicolas Patry <[email protected]>
2025-04-23 20:43:25 +05:30
Alvaro Bartolome 95ccba3705 Bump sccache to 0.10.0 (#3179)
* Ensure that `sccache` version is 0.10.0 or higher

* Rename `ACTIONS_CACHE_URL` to `ACTIONS_RESULTS_URL`
2025-04-18 12:45:32 +02:00
Nicolas Patry 0b28aabb94 3.2.3 (#3151) 2025-04-08 10:16:37 +02:00
Baptiste Colle 37104acd75 Gaudi: Add Integration Test for Gaudi Backend (#3142)
* feat(gaudi): add integration test

* feat(test): add more models to integration tests

* remove debug comments

* fix typos
2025-04-07 16:55:03 +02:00
Nicolas Patry d23b385eee Preparing for release. (#3147)
* Preparing for release.

* Adding hf-xet dependency.

* Merged tgi-nix update.
2025-04-06 11:36:00 +02:00
Mohit SharmaandNicolas Patry d9bb9bebc9 Add llama4 (#3145)
* initial changes

* Add support for other vlm

* cleanup comment

* Improve attn_implementation

* Add comments for support of models

* add model

* add model

* fixes and improvements

* update docker

* Add cache position

* Add tests

* remove redundant changes

* remove tr version

* Upgrade doc + fix linting.

* Fixing the CI.

---------

Co-authored-by: Nicolas Patry <[email protected]>
2025-04-06 10:20:22 +02:00
Erik KaunismäkiandNicolas Patry e5503eba78 configurable termination timeout (#3126)
* make shard and webserver termination timeouts configurable

* Updating documentation.

* Fmt.

---------

Co-authored-by: Nicolas Patry <[email protected]>
2025-03-20 14:25:56 +01:00
Nicolas Patry 83fe45c15e Prepare for patch release. (#3124) 2025-03-18 15:11:55 +01:00
a35fbdb925 Bug Fix: Sliding Window Attention (#3112)
* (fix) sliding window attention

* (fix) flashinfer

* (typo) collection link

* Add window_size_left param ipex rocm

* Update window size rocm flash decoding

* fix: bump snapshots and improve exceed window test case

* feat: add tests for image types and remove alpha from png

* Upgrading `from_env` to get token from file when necessary + fix
pali_gemma.

* fix: add pillow dependency and bump lock+requirements

* fix: bump org name in gemma3 test

* Fix qwen2.

---------

Co-authored-by: drbh <[email protected]>
Co-authored-by: Nicolas Patry <[email protected]>
2025-03-18 10:37:33 +01:00
Baptiste Colle 8c2c348f3c Gaudi: Sync TGI with the latest changes from the TGI-Gaudi fork (#3117)
feat(gaudi): add all the changes from tgi-gaudi fork up to PR #289
2025-03-18 09:45:52 +01:00
Baptiste Colle 27ed848676 Release of Gaudi Backend for TGI (#3091)
* feat(gaudi): release ready (docs, docker image and vlm ready)

* fix(gaudi): add default argument for the dockerfile

* fix(gaudi): remove use of latest for gaudi docker image + redid gaudi benchmarking section to include best practices
2025-03-13 10:56:01 +01:00
Nicolas Patry 4ac06ddf56 Preparing relase 3.2.0 (#3100)
* Preparing relase 3.2.0

* Forgot the README.

* Update doc.
2025-03-12 10:11:33 +01:00
Mohit Sharma ed46c2c414 Add gemma3 model (#3099) 2025-03-12 09:25:51 +01:00
Nicolas Patry f74c36fe0d Fix tool call3 (#3086)
* Fixing the tool calling convention.

* Update tehe doc.

* Fixing some corner cases.

* Fixing the tool call id.

* Fmt.

* Snapshot update with the new updated tool_call_id.

* More qwen2.
2025-03-12 09:22:53 +01:00
Adrien Gallouët 094975c3a8 Update the llamacpp backend (#3022)
* Build faster

Signed-off-by: Adrien Gallouët <[email protected]>

* Make --model-gguf optional

Signed-off-by: Adrien Gallouët <[email protected]>

* Bump llama.cpp

Signed-off-by: Adrien Gallouët <[email protected]>

* Enable mmap, offload_kqv & flash_attention by default

Signed-off-by: Adrien Gallouët <[email protected]>

* Update doc

Signed-off-by: Adrien Gallouët <[email protected]>

* Better error message

Signed-off-by: Adrien Gallouët <[email protected]>

* Update doc

Signed-off-by: Adrien Gallouët <[email protected]>

* Update installed packages

Signed-off-by: Adrien Gallouët <[email protected]>

* Save gguf in models/MODEL_ID/model.gguf

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix build with Mach-O

Signed-off-by: Adrien Gallouët <[email protected]>

* Quantize without llama-quantize

Signed-off-by: Adrien Gallouët <[email protected]>

* Bump llama.cpp and switch to ggml-org

Signed-off-by: Adrien Gallouët <[email protected]>

* Remove make-gguf.sh

Signed-off-by: Adrien Gallouët <[email protected]>

* Update Cargo.lock

Signed-off-by: Adrien Gallouët <[email protected]>

* Support HF_HUB_USER_AGENT_ORIGIN

Signed-off-by: Adrien Gallouët <[email protected]>

* Bump llama.cpp

Signed-off-by: Adrien Gallouët <[email protected]>

* Add --build-arg llamacpp_native & llamacpp_cpu_arm_arch

Signed-off-by: Adrien Gallouët <[email protected]>

---------

Signed-off-by: Adrien Gallouët <[email protected]>
2025-03-11 09:19:01 +01:00
Alvaro Bartolome 55a6618434 Update --max-batch-total-tokens description (#3083)
* Update `--max-batch-total-tokens` description

* Update docstring in `launcher/src/main.rs` instead
2025-03-07 14:24:26 +01:00
Nicolas Patry 8e92942a18 Making tool_calls a vector. (#3075)
* Making `tool_calls` a vector.

* Update doc.

* Fixing the nix overlay with updated version.

* Add openai dependency.

* Updating the old tests.

* Trying to reduce the logs in the case of errors.

* Less spammy logs too.
2025-03-05 22:32:31 +01:00
Sadra Barikbin 144d99c147 Fix a tiny typo in monitoring.md tutorial (#3056)
Update monitoring.md
2025-03-04 17:06:26 +01:00
Nicolas Patry 08bbfa16a1 Preparing for release. (#3060)
* Preparing for release.

* Upgrade doc.

* Fix docs auto-generated.

* Fix update doc along.
2025-03-04 16:47:10 +01:00
David Corvoysier 5eec3a8bb6 Avoid running neuron integration tests twice (#3054)
* test(neuron): refactor to prepare batch export

* test(neuron): add helper to batch export models

Also rename fixture file fro clarity.

* ci(neuron): do not run tests twice

* ci(neuron): rename precompilation job

* test(neuron): remove redundant subdirectory

* test(neuron): remove erroneous line

* doc(neuron): update links to installation page

* feat(neuron): cleanup Dockerfile

CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse is not required anymore.

* test(neuron): try to reduce download errors
2025-02-26 12:15:01 +01:00
c00add9c03 Add Neuron backend (#3033)
* feat: add neuron backend

* feat(neuron): add server standalone installation

* feat(neuron): add server and integration tests

* fix(neuron): increase ulimit when building image

The base image used to compile the rust components seems to have a low
ulimit for opened files, which leads to errors during compilation.

* test(neuron): merge integration tests and fixtures

* test: add --neuron option

* review: do not use latest tag

* review: remove ureq pinned version

* review: --privileged should be the exception

* feat: add neuron case to build ci

* fix(neuron): export models from container in test fixtures

The neuron tests require models to have been previously exported and
cached on the hub. This is done automatically by the neuron.model
fixture the first time the tests are ran for a specific version.
This fixture used to export the models using optimum-neuron directly,
but this package is not necessarily present on the system.
Instead, it is now done through the neuron TGI itself, since it
contains all the tools required to export the models.
Note that since the CI runs docker in docker (dind) it does not seem
possible to share a volume between the CI container and the container
used to export the model.
For that reason, a specific image with a modified entrypoint is built
on-the-fly when a model export is required.

* refactor: remove sagemaker entry-point

The SageMaker image is built differently anyway.

* fix(neuron): avoid using Levenshtein

* test(neuron): use smaller llama model

* feat(neuron): avoid installing CUDA in image

* test(neuron): no error anymore when requesting too many tokens

* ci: doing a precompilation step (with a different token).

* test(neuron): avoid using image sha when exporting models

We now manually evaluate the apparent hash of the neuron backend by
combining the hash of the neuron backend directory and Dockerfile.
This new hash is used to identify exported neuron models instead of the
image sha.
This has two benefits:
- it changes less frequently (only hwen the neuron backend changes),
  which means less neuron models being pushed to the hub,
- it can be evaluated locally, meaning that running the tests once
  locally will export the models before the CI uses them.

* test(neuron): added a small script to prune test models

---------

Co-authored-by: drbh <[email protected]>
Co-authored-by: Nicolas Patry <[email protected]>
2025-02-24 09:10:05 +01:00
drbhandsailesh duddupudi 1cae3197c4 Improve tool call message processing (#3036)
* make content field optional in chat request

* add tool_calls field to Message struct

* feat: add test and serialize tool messages

* fix: bump utopia, openapi doc version and improve test

* fix: rerun update docs

* fix: suppoer tool call id in template and remove unnecessary changes

* fix: ruff lint remove unused import

* fix: adjust message types in tests

---------

Co-authored-by: sailesh duddupudi <[email protected]>
2025-02-21 10:30:29 +01:00
Adrien Gallouët 3498f6085e Update Gradio ChatInterface configuration in consuming_tgi.md (#3042)
The current code does not work and gives the following message:

    UserWarning: You have not specified a value for the `type` parameter. Defaulting to the 'tuples' format for chatbot messages, but this is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead, which uses openai-style dictionaries with 'role' and 'content' keys.
      warnings.warn(
    Traceback (most recent call last):
      File "/Users/angt/hf/tgi/test-gradio.py", line 22, in <module>
        gr.ChatInterface(
    TypeError: ChatInterface.__init__() got an unexpected keyword argument 'retry_btn'

Signed-off-by: Adrien Gallouët <[email protected]>
2025-02-21 10:11:28 +01:00
drbh d6a0c67e2f feat: add initial qwen2.5-vl model and test (#2971)
* feat: support qwen2.5 vl model

* fix: bump support models doc

* feat: check before rope type adjustment and small refactors

* fix: add transformer overlay for processor support

* fix: vendor processor and config from transformers

* fix: refactor/simplify conditionals
2025-02-19 12:38:20 +01:00
Adrien GallouëtandMorgan Funtowicz cfd4fbb479 [Backend] Add Llamacpp backend (#2975)
* Add llamacpp backend

Signed-off-by: Adrien Gallouët <[email protected]>

* Get rid of llama_batch_get_one()

Signed-off-by: Adrien Gallouët <[email protected]>

* Use max_batch_total_tokens

Signed-off-by: Adrien Gallouët <[email protected]>

* Handle max_batch_size

Signed-off-by: Adrien Gallouët <[email protected]>

* Add some input validation checks

Signed-off-by: Adrien Gallouët <[email protected]>

* Handle ctx args & fix sampling

Signed-off-by: Adrien Gallouët <[email protected]>

* Add GPU args

Signed-off-by: Adrien Gallouët <[email protected]>

* Add --defrag-threshold

Signed-off-by: Adrien Gallouët <[email protected]>

* Add a stupid batch mechanism

Signed-off-by: Adrien Gallouët <[email protected]>

* Cleanup

Signed-off-by: Adrien Gallouët <[email protected]>

* Add --numa

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix args

Signed-off-by: Adrien Gallouët <[email protected]>

* Enable flash attention by default

Signed-off-by: Adrien Gallouët <[email protected]>

* Add --offload-kqv

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix batch_pos

Signed-off-by: Adrien Gallouët <[email protected]>

* backend(llama): add CUDA Dockerfile_llamacpp for now

* Only export the latest logits

Signed-off-by: Adrien Gallouët <[email protected]>

* Output real logprobs

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix batching

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix seq iterations

Signed-off-by: Adrien Gallouët <[email protected]>

* Auto-detect n_threads when not provided

Signed-off-by: Adrien Gallouët <[email protected]>

* Clear request cache after completion

Signed-off-by: Adrien Gallouët <[email protected]>

* Remove warmup

Signed-off-by: Adrien Gallouët <[email protected]>

* Cleanup

Signed-off-by: Adrien Gallouët <[email protected]>

* backend(llama): add CUDA architectures build argument for Dockerfile

* Add specific args for batch

Signed-off-by: Adrien Gallouët <[email protected]>

* Add --type-v & --type-k

Signed-off-by: Adrien Gallouët <[email protected]>

* Bump llamacpp to b4623

Signed-off-by: Adrien Gallouët <[email protected]>

* Disable graceful shutdown in debug mode

Signed-off-by: Adrien Gallouët <[email protected]>

* Update Dockerfile_llamacpp

Signed-off-by: Adrien Gallouët <[email protected]>

* Cleanup Dockerfile

Signed-off-by: Adrien Gallouët <[email protected]>

* Update Cargo.lock

Signed-off-by: Adrien Gallouët <[email protected]>

* Update args

Signed-off-by: Adrien Gallouët <[email protected]>

* Simplify batching logic

Signed-off-by: Adrien Gallouët <[email protected]>

* Set TGI_LLAMA_PKG_CUDA from CUDA_VERSION

Signed-off-by: Adrien Gallouët <[email protected]>

* Rename bindings

Signed-off-by: Adrien Gallouët <[email protected]>

* Remove n_ctx

Signed-off-by: Adrien Gallouët <[email protected]>

* Make max_batch_total_tokens optional

Signed-off-by: Adrien Gallouët <[email protected]>

* Ensure all samplers are freed on error

Signed-off-by: Adrien Gallouët <[email protected]>

* Initialize penalty_last_n with llamacpp default value

Signed-off-by: Adrien Gallouët <[email protected]>

* Cleanup

Signed-off-by: Adrien Gallouët <[email protected]>

* Improve default settings

Signed-off-by: Adrien Gallouët <[email protected]>

* Add doc

Signed-off-by: Adrien Gallouët <[email protected]>

* Update docs

Signed-off-by: Adrien Gallouët <[email protected]>

* Thanks clippy

Signed-off-by: Adrien Gallouët <[email protected]>

* Thanks cargo fmt

Signed-off-by: Adrien Gallouët <[email protected]>

* Update docs

Signed-off-by: Adrien Gallouët <[email protected]>

* Do not use HOSTNAME env

Signed-off-by: Adrien Gallouët <[email protected]>

* Bump llama.cpp & cuda

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix requirements.txt

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix fmt

Signed-off-by: Adrien Gallouët <[email protected]>

* Enable KQV offload by default

Signed-off-by: Adrien Gallouët <[email protected]>

* Remove Ngrok tunneling

Signed-off-by: Adrien Gallouët <[email protected]>

* Remove .cargo/config.toml

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix Dockerfile

Signed-off-by: Adrien Gallouët <[email protected]>

* Add missing cuda prefix

Signed-off-by: Adrien Gallouët <[email protected]>

* Handle custom llama.cpp dir

Signed-off-by: Adrien Gallouët <[email protected]>

* Cleanup

Signed-off-by: Adrien Gallouët <[email protected]>

* Add README.md

Signed-off-by: Adrien Gallouët <[email protected]>

* Add HF transfer

Signed-off-by: Adrien Gallouët <[email protected]>

* Fix bool args

Signed-off-by: Adrien Gallouët <[email protected]>

* Update doc

Signed-off-by: Adrien Gallouët <[email protected]>

* Update doc

Signed-off-by: Adrien Gallouët <[email protected]>

---------

Signed-off-by: Adrien Gallouët <[email protected]>
Co-authored-by: Morgan Funtowicz <[email protected]>
2025-02-14 13:40:57 +01:00
Nicolas Patry c9d68945cc Prepare for release 3.1.0 (#2972)
* Prepare for release 3.1.0

* Back on main flake.

* Fixing stuff.

* Upgrade to moe-kernels 0.8.2 for Hip support.

* Deactivating the flaky test.
2025-01-31 14:19:01 +01:00
Hugo Larcher 065aabb13d doc: Update TRTLLM deployment doc. (#2960)
* doc: Update TRTLLM deployment doc. Update TRTLLM CI to allow release builds when tagging TGI.

* doc: Update TRTLLM deployment doc. Update TRTLLM CI to allow release builds when tagging TGI.

* fix: PR comments
2025-01-30 18:04:42 +01:00
Nicolas PatryandMohit Sharma cb747b33da Add deepseekv3 (#2968)
* Add fp8 support moe models

add deepseekv3

format codfe'

update dockerfile

update doc

* Small modifications.

* Moe kernels 0.8.1

* Upgrade to 0.8.1

* Fixing moe import.

* Black.

* Apply suggestions from code review

Co-authored-by: Mohit Sharma <[email protected]>

* Fixing Mixtral + Nits.

* Put link to ref.

* Fix other call locations.

* Scoring func `softmax` is the only one that works.

---------

Co-authored-by: Mohit Sharma <[email protected]>
2025-01-30 16:40:25 +01:00
Hugo Larcher c690da5973 fix: Telemetry (#2957)
* fix: add telemetry regular pings and fix unhandled errors avoid not sending telemetry stop events.

* fix: simplify error handling

* fix: update ping delay and update doc.

* fix: clippy

* doc: Rephrase properly.
2025-01-28 10:29:18 +01:00
Nicolas Patry 29a0893b67 Tmp tp transformers (#2942)
* Upgrade the version number.

* Remove modifications in Lock.

* Tmp branch to test transformers backend with 2.5.1 and TP>1

* Fixing the transformers backend.

inference_mode forces the use of `aten.matmul` instead of `aten.mm` the
former doesn't have sharding support crashing the transformers TP
support.

`lm_head.forward` also crashes because it skips the hook that
cast/decast the DTensor.

Torch 2.5.1 is required for sharding support.

* Put back the attention impl.

* Revert the flashinfer (this will fails).

* Building AOT.

* Using 2.5 kernels.

* Remove the archlist, it's defined in the docker anyway.
2025-01-23 18:07:30 +01:00
Baptiste Colle 1470aec9d9 Fix typo in TPU docs (#2911)
docs(tpu): fix typo
2025-01-15 18:32:07 +01:00
Baptiste Colle 46994b34fb 📝 add guide on using TPU with TGI in the docs (#2907) 2025-01-15 16:26:11 +01:00