vllm.config.utils ¶
 Utility functions for vLLM config dataclasses.
  SupportsHash ¶
    SupportsMetricsInfo ¶
    assert_hashable ¶
  Source code in vllm/config/utils.py
    config ¶
  A decorator that ensures all fields in a dataclass have default values and that each field has a docstring.
If a ConfigT is used as a CLI argument itself, the type keyword argument provided by get_kwargs will be pydantic.TypeAdapter(ConfigT).validate_json(cli_arg) which treats the cli_arg as a JSON string which gets validated by pydantic.
Config validation is performed by the tools/validate_config.py script, which is invoked during the pre-commit checks.
Source code in vllm/config/utils.py
   contains_object_print ¶
  Check if the text looks like a printed Python object, e.g. contains any substring matching the pattern: "at 0xFFFFFFF>" We match against 0x followed by 2-16 hex chars (there's a max of 16 on a 64-bit system).
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
 text  |   str  |    The text to check  |  required | 
Returns:
| Name | Type | Description | 
|---|---|---|
result |   bool  |    
  |  
Source code in vllm/config/utils.py
   get_attr_docs ¶
  Get any docstrings placed after attribute assignments in a class body.
https://davidism.com/mit-license/
Source code in vllm/config/utils.py
   get_field ¶
 get_field(cls: ConfigType, name: str) -> Field
Get the default factory field of a dataclass by name. Used for getting default factory fields in EngineArgs.
Source code in vllm/config/utils.py
   getattr_iter ¶
  A helper function that retrieves an attribute from an object which may have multiple possible names. This is useful when fetching attributes from arbitrary transformers.PretrainedConfig instances.
Source code in vllm/config/utils.py
   is_init_field ¶
 is_init_field(cls: ConfigType, name: str) -> bool