Skip to content

vllm_omni.config.config_factory

Config factories for vllm-omni, e.g., StageConfigFactory.

logger module-attribute

logger = init_logger(__name__)

StageConfigFactory

Factory that loads pipeline YAML and merges CLI overrides.

Handles both single-stage and multi-stage models.

Pipelines are declared in vllm_omni/config/pipeline_registry.py and where keys in OMNI_PIPELINES map to either a PipelineConfig, or a callable which accepts a Transformers config as an arg & resolves to a PipelineConfig.

NOTE: Models with generic HF model_type collisions (e.g. MiMo Audio reports qwen2) should declare hf_architectures=(...) on their PipelineConfig so the factory can disambiguate via hf_config.architectures.

create_default_diffusion classmethod

create_default_diffusion(
    kwargs: dict[str, Any],
) -> list[dict[str, Any]]

Single-stage diffusion - no YAML needed.

Creates a default diffusion stage configuration for single-stage diffusion models. Returns a legacy OmegaConf-compatible dict for backward compatibility with OmniStage.

Parameters:

Name Type Description Default
kwargs dict[str, Any]

Engine arguments from CLI/API.

required

Returns:

Type Description
list[dict[str, Any]]

List containing a single config dict for the diffusion stage.

create_from_model classmethod

create_from_model(
    model: str,
    cli_overrides: dict[str, Any] | None = None,
    deploy_config_path: str | None = None,
    **deprecated_kwargs: Any,
) -> list[StageConfig] | None

Load pipeline + deploy config, merge with CLI overrides.

Checks OMNI_PIPELINES first, since supported models should be explicitly registered. If a model is not registered in OMNI_PIPELINES, tries to fall back to using the Transformers config & finding pipelines that have overlapping supported architectures.

resolve_pipeline_config staticmethod

resolve_pipeline_config(
    model_type: str,
    hf_config: PretrainedConfig | None = None,
) -> PipelineConfig | None

Given a model type, resolve to the pipeline to be used. If the pipeline maps to a callable we resolve based on the HF config.