vllm_omni.diffusion.models.cosmos3.guardrails ¶
Cosmos3 guardrail hooks for vllm-omni.
Thin adapter around the cosmos_guardrail package's CosmosSafetyChecker (Blocklist + Qwen3Guard for text, RetinaFace face-blur for video).
Enabled by default. Disable server-wide with --cosmos3-no-guardrails (which sets od_config.model_config["guardrails"] = False); per-request overrides ride on sampling_params.extra_args["guardrails"].
is_guardrails_enabled ¶
is_guardrails_enabled(
od_config: OmniDiffusionConfig,
sampling_params: OmniDiffusionSamplingParams
| None = None,
) -> bool
Resolve the active guardrail gate.
Server-level od_config.model_config["guardrails"] decides whether the guardrail models are loaded at all (eager load at pipeline build time). When that is False, no per-request override can turn checks back on, because the singletons in this module are never populated.
When the server gate is on, sampling_params.extra_args["guardrails"] may override on a per-request basis: False skips the check for that request, anything else (or missing) keeps the default behavior.