vllm.transformers_utils.utils ¶
_maybe_json_dict ¶
_maybe_space_split_dict ¶
Source code in vllm/transformers_utils/utils.py
check_gguf_file ¶
Check if the file is a GGUF model.
Source code in vllm/transformers_utils/utils.py
is_oci_model_with_tag ¶
Detect if model name is an OCI reference with explicit tag or digest.
Returns True for OCI references with explicit tag/digest: - username/model:tag - username/model:v1.0 - registry.io/username/model:tag - registry.io/username/model@sha256:digest
Returns False for: - username/model (ambiguous - could be HuggingFace or OCI with implicit tag) - local/path/to/model (local filesystem paths) - model (single name without repository)
This allows automatic detection of OCI format when the reference is unambiguous (has explicit tag/digest), while requiring explicit load_format="oci" for ambiguous cases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model | str | Model name or path to check | required |
Returns:
| Type | Description |
|---|---|
bool | True if the model name matches OCI reference pattern with tag/digest |
Source code in vllm/transformers_utils/utils.py
is_s3 ¶
maybe_model_redirect cached ¶
Use model_redirect to redirect the model name to a local folder.
:param model: hf model name :return: maybe redirect to a local folder
Source code in vllm/transformers_utils/utils.py
modelscope_list_repo_files ¶
modelscope_list_repo_files(
repo_id: str,
revision: Optional[str] = None,
token: Union[str, bool, None] = None,
) -> list[str]
List files in a modelscope repo.