Add vLLM library info to Hugging Face Hub requests (#43857)

Signed-off-by: Wauplin <lucainp@gmail.com>
Signed-off-by: Lucain Pouget <lucain@huggingface.co>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lucain
2026-05-29 14:04:58 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 3f6f508e14
commit 11dfa3169d
13 changed files with 78 additions and 43 deletions
@@ -3,13 +3,12 @@
import asyncio
import os
from huggingface_hub import HfApi, snapshot_download
import vllm.envs as envs
from vllm.logger import init_logger
from vllm.lora.request import LoRARequest
from vllm.lora.resolver import LoRAResolverRegistry
from vllm.plugins.lora_resolvers.filesystem_resolver import FilesystemResolver
from vllm.transformers_utils.repo_utils import hf_api
logger = init_logger(__name__)
@@ -49,7 +48,7 @@ class HfHubResolver(FilesystemResolver):
return None
repo_path = await asyncio.to_thread(
snapshot_download,
hf_api().snapshot_download,
repo_id=maybe_repo,
allow_patterns=f"{maybe_subpath}/*" if maybe_subpath != "." else "*",
)
@@ -110,7 +109,10 @@ class HfHubResolver(FilesystemResolver):
Args:
repo_name: Name of the HF hub repo to inspect.
"""
repo_files = await asyncio.to_thread(HfApi().list_repo_files, repo_id=repo_name)
repo_files = await asyncio.to_thread(
hf_api().list_repo_files,
repo_id=repo_name,
)
adapter_dirs = {
os.path.dirname(name)
for name in repo_files