Skip to content

vllm.plugins.lora_resolvers.hf_hub_resolver

Classes:

Functions:

HfHubResolver

Bases: FilesystemResolver

Methods:

  • resolve_lora –

    Resolves potential LoRA requests in a remote repo on HF Hub.

_get_adapter_dirs(repo_name) async

Gets the subpaths within a HF repo that contain an adapter config.

Parameters:

  • repo_name

    (str) –

    Name of the HF hub repo to inspect.

_resolve_repo(lora_name) async

Given a fully qualified path to a LoRA with respect to its HF Hub repo, match the right repo to potentially download from if one exists.

Parameters:

  • lora_name

    (str) –

    Path to LoRA in HF Hub, e.g., //, match on / (if it contains an adapter directly) or // if it may have one in subdirs.

_resolve_repo_subpath(lora_name, maybe_repo) async

Given the fully qualified path of the LoRA with respect to the HF Repo, get the subpath to download from assuming it's actually got an adapter in it.

Parameters:

  • lora_name

    (str) –

    Path to LoRA in HF Hub, e.g., //

  • maybe_repo

    (str | None) –

    Path to the repo to match against if one exists.

resolve_lora(base_model_name, lora_name) async

Resolves potential LoRA requests in a remote repo on HF Hub. This is effectively the same behavior as the filesystem resolver, but with a snapshot_download on dirs containing an adapter config prior to inspecting the cached dir to build a potential LoRA request.

register_hf_hub_resolver()

Register the Hf hub LoRA Resolver with vLLM.