[httpx migration] Import httpx from huggingface_hub (#56460)

Signed-off-by: Lucain Pouget <lucain@huggingface.co> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

Lucain committed Sep 11, 2026 at 17:29 UTC b87339888d29329c42c42573e34cc2beebdcc48b
7 files changed +8 -6
requirements/common.txt
+1 -1
@@ -8,7 +8,7 @@ tqdm
8 blake3
9 py-cpuinfo
10 transformers >= 5.10.4
11 -huggingface_hub >= 1.28.0
11 +huggingface_hub >= 1.31.0 # Required for the `huggingface_hub.utils.httpx` re-export
12 tokenizers >= 0.21.1 # Required for fast incremental detokenization.
13 safetensors >= 0.6.2 # MXFP4/MXFP6 dtype support (F8_E8M0, F4) added in 0.6.0: https://github.com/huggingface/safetensors/pull/611
14 protobuf >= 5.29.6, !=6.30.*, !=6.31.*, !=6.32.*, !=6.33.0.*, !=6.33.1.*, !=6.33.2.*, !=6.33.3.*, !=6.33.4.* # Required by LlamaTokenizer, gRPC. CVE-2026-0994
requirements/test/cpu.txt
+1 -1
@@ -342,7 +342,7 @@ httpx==0.27.2
342 # schemathesis
343 httpx2==2.12.0
344 # via mcp
345 -huggingface-hub==1.28.0
345 +huggingface-hub==1.31.0
346 # via
347 # -r requirements/test/../common.txt
348 # accelerate
requirements/test/cuda.txt
+1 -1
@@ -361,7 +361,7 @@ httpx==0.27.2
361 # schemathesis
362 httpx2==2.12.0
363 # via mcp
364 -huggingface-hub==1.28.0
364 +huggingface-hub==1.31.0
365 # via
366 # -c requirements/common.txt
367 # -r requirements/test/../common.txt
requirements/test/rocm.txt
+1 -1
@@ -354,7 +354,7 @@ httpx==0.27.2
354 # schemathesis
355 httpx2==2.12.0
356 # via mcp
357 -huggingface-hub==1.28.0
357 +huggingface-hub==1.31.0
358 # via
359 # -c requirements/common.txt
360 # -r requirements/test/../common.txt
requirements/test/xpu.txt
+1 -1
@@ -232,7 +232,7 @@ httpx2==2.10.0
232 # via
233 # mcp
234 # openai
235 -huggingface-hub==1.28.0
235 +huggingface-hub==1.31.0
236 # via
237 # -c requirements/common.txt
238 # -r requirements/test/../common.txt
vllm/distributed/kv_transfer/kv_connector/v1/mooncake/mooncake_connector.py
+1 -1
@@ -10,12 +10,12 @@ from dataclasses import dataclass
10 from enum import IntEnum
11 from typing import TYPE_CHECKING, Any
12
13 -import httpx
13 import msgspec
14 import numpy as np
15 import torch
16 import zmq
17 import zmq.asyncio
18 +from huggingface_hub.utils import httpx
19
20 from vllm import envs
21 from vllm.config import VllmConfig
vllm/logger.py
+2
@@ -258,8 +258,10 @@ _configure_vllm_root_logger()
258
259 # Transformers uses httpx to access the Hugging Face Hub. httpx is quite verbose,
260 # so we set its logging level to WARNING when vLLM's logging level is INFO.
261 +# httpx2 is the successor huggingface_hub switches to in its 2.x releases.
262 if envs.VLLM_LOGGING_LEVEL == "INFO":
263 logging.getLogger("httpx").setLevel(logging.WARNING)
264 + logging.getLogger("httpx2").setLevel(logging.WARNING)
265
266 logger = init_logger(__name__)
267