litellm/tests/unit/llms/huggingface
Abel Yagubyan 331a673114
fix(huggingface): honor HUGGINGFACE_API_BASE and env endpoints for chat (#51449)
* fix(huggingface): honor HUGGINGFACE_API_BASE and env endpoints for chat

With only HUGGINGFACE_API_BASE set, the chat URL became the string 'None'. With either HF_API_BASE or HUGGINGFACE_API_BASE set, a model name without a slash such as huggingface/tgi failed with 'not enough values to unpack' because the request was still routed through the Inference Providers mapping. Treat an endpoint from the environment the same way as an explicit api_base.

* fix(huggingface): keep string image_url conversion when the endpoint comes from HF_API_BASE

* fix(huggingface): build the endpoint request once so the type gate count stays flat

---------

Co-authored-by: Abelo9996 <Abelo9996@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-13 10:35:34 -08:00
..
chat fix(huggingface): honor HUGGINGFACE_API_BASE and env endpoints for chat (#51449) 2026-11-13 10:35:34 -08:00
embedding refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
rerank fix(huggingface): stop forcing truncate=false on TEI rerank and pass truncate params through (#48706) 2026-10-28 09:27:26 -07:00
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00