Skip to content

vllm_omni.config.yaml_util

Centralized OmegaConf wrapper for vLLM-Omni.

All OmegaConf usage in the project MUST go through this module. Other modules should import these wrapper functions instead of using OmegaConf directly.

create_config

create_config(data: Any) -> DictConfig

Wrap a dict (or list) into a DictConfig.

Parameters:

Name Type Description Default
data Any

Dict, list, or other structure to wrap.

required

Returns:

Type Description
DictConfig

OmegaConf DictConfig / ListConfig.

load_yaml_config

load_yaml_config(path: str | Any) -> DictConfig

Load a YAML file and return it as a DictConfig.

Parameters:

Name Type Description Default
path str | Any

Path to the YAML file.

required

Returns:

Type Description
DictConfig

OmegaConf DictConfig with attribute-style access.

merge_configs

merge_configs(*cfgs: Any) -> dict

Deep-merge multiple configs and return a plain dict.

Parameters:

Name Type Description Default
*cfgs Any

DictConfig or dict objects to merge (left to right).

()

Returns:

Type Description
dict

Plain dict with merged, resolved values.

to_dict

to_dict(obj: Any, *, resolve: bool = True) -> Any

Convert a DictConfig (or similar) to a plain dict.

Parameters:

Name Type Description Default
obj Any

OmegaConf container to convert.

required
resolve bool

Whether to resolve interpolations (default True).

True

Returns:

Type Description
Any

Plain dict.