vllm.model_executor.models.config
¶
Classes:
-
ColQwen3_5Config–Apply the attention contract declared by a ColQwen3.5 checkpoint.
-
D3ForSequenceClassificationConfig–Apply the contract declared by a Decision 3.0
decision_config.json. -
DiffusionGemmaModelForBlockDiffusionConfig– -
Gemma4Config– -
HybridAttentionMambaModelConfig– -
JinaEmbeddingsV5ModelConfig–Config handler for Jina Embeddings V5 embedding models.
-
KimiK3ForConditionalGenerationConfig–Route MXFP4-checkpointed Kimi-K3 MoE experts to the MXFP4 interface.
-
LlamaNemotronVLConfig–Config handler for LlamaNemotronVL embedding models.
-
MambaModelConfig– -
MiniMaxM3SparseForConditionalGenerationConfig– -
NemotronHForCausalLMConfig– -
Qwen3_5ForConditionalGenerationConfig– -
Qwen4ExpForConditionalGenerationConfig–Apply the Qwen3.5 hybrid-cache contract to Qwen4Exp.
-
Qwen4ExpMTPConfig–Preserve MRoPE for a VL target and use 1D RoPE for a text target.
-
UnlimitedOCRForCausalLMConfig–
ColQwen3_5Config
¶
Bases: Qwen3_5ForConditionalGenerationConfig
Apply the attention contract declared by a ColQwen3.5 checkpoint.
Source code in vllm/model_executor/models/config.py
D3ForSequenceClassificationConfig
¶
Bases: Qwen3_5ForConditionalGenerationConfig
Apply the contract declared by a Decision 3.0 decision_config.json.
Source code in vllm/model_executor/models/config.py
DiffusionGemmaModelForBlockDiffusionConfig
¶
Bases: VerifyAndUpdateConfig
Methods:
-
verify_and_update_config–Set up the diffusion config and defaults for DiffusionGemma.
Source code in vllm/model_executor/models/config.py
verify_and_update_config(vllm_config)
classmethod
¶
Set up the diffusion config and defaults for DiffusionGemma.
Auto-creates DiffusionConfig from the HF config when the user
didn't pass --diffusion-config. Diffusion sampling params are
read straight from generation_config.json at sampler-build time
(see DiffusionGemma's custom_sampler), not injected here.
Source code in vllm/model_executor/models/config.py
Gemma4Config
¶
Bases: VerifyAndUpdateConfig
Methods:
-
verify_and_update_config–Configure attention for heterogeneous head dimensions.
Source code in vllm/model_executor/models/config.py
verify_and_update_config(vllm_config)
staticmethod
¶
Configure attention for heterogeneous head dimensions.
Gemma4 uses different head dimensions for sliding window vs full attention layers. The default FA3 on Hopper cannot handle head_dim > 256.
On SM90 with FP8 KV cache, use FA3 for supported layers and let the generic FlashAttention selector upgrade larger head dimensions to FA4. The multimodal-prefix composite routes image masks to Triton and causal requests to this per-layer FA3/FA4 selection. For other configurations, force FA4 for all layers to avoid the mixed FA3+FA4 penalty. When FA4 is not available, fall back to Triton.
Source code in vllm/model_executor/models/config.py
HybridAttentionMambaModelConfig
¶
Bases: VerifyAndUpdateConfig
Methods:
-
verify_and_update_config–Perform early validation and setup for hybrid attention/mamba models.
Source code in vllm/model_executor/models/config.py
verify_and_update_config(vllm_config)
classmethod
¶
Perform early validation and setup for hybrid attention/mamba models.
Block size alignment with mamba page sizes is handled later by Platform.update_block_size_for_backend(), which runs after model layers are constructed and the attention backend is known.
Parameters:
-
(vllm_config¶VllmConfig) –vLLM Config
Source code in vllm/model_executor/models/config.py
JinaEmbeddingsV5ModelConfig
¶
Bases: VerifyAndUpdateConfig
Config handler for Jina Embeddings V5 embedding models.
Methods:
-
verify_and_update_model_config–Enable the bidirectional encoder backbone for -nano checkpoints.
Source code in vllm/model_executor/models/config.py
verify_and_update_model_config(model_config)
staticmethod
¶
Enable the bidirectional encoder backbone for -nano checkpoints.
The V5 family ships more than one backbone under a single
architectures entry: the -small variants are Qwen3 decoders, while
-nano is a bidirectional EuroBERT encoder. Upstream ships a separate
configuration_*.py per repository, so the config carries no backbone
field and the encoder variants are only identifiable by
is_decoder=False. For encoder checkpoints, set is_causal=False so the
Llama backbone uses EncoderOnlyAttention; JinaEmbeddingsV5Model then
dispatches to its encoder implementation.
Source code in vllm/model_executor/models/config.py
KimiK3ForConditionalGenerationConfig
¶
Bases: VerifyAndUpdateConfig
Route MXFP4-checkpointed Kimi-K3 MoE experts to the MXFP4 interface.
Kimi-K3 ships its routed experts as compressed-tensors
mxfp4-pack-quantized (quant_method="compressed-tensors"), which
lands them on CompressedTensorsW4A4Mxfp4MoEMethod and its narrow kernel
selection. Rewriting quant_method to "mxfp4" selects Mxfp4Config
(hence Mxfp4MoEMethod) with its full backend set, while any non-MXFP4
checkpoint is left untouched. Covers both the main model and the MTP draft.
model_arch_config.quantization_config is a separate dict, snapshotted in
ModelConfig.__init__ before this hook runs, and it is what
_verify_quantization reads when resolving the quant method. Patch it
alongside the hf configs so the rewrite lands before resolution; otherwise
the main model still resolves to compressed-tensors.
Source code in vllm/model_executor/models/config.py
LlamaNemotronVLConfig
¶
Bases: VerifyAndUpdateConfig
Config handler for LlamaNemotronVL embedding models.
Source code in vllm/model_executor/models/config.py
MambaModelConfig
¶
Bases: VerifyAndUpdateConfig
Methods:
-
verify_and_update_config–Enable FULL_AND_PIECEWISE cuda graph mode by default (required
Source code in vllm/model_executor/models/config.py
verify_and_update_config(vllm_config)
classmethod
¶
Enable FULL_AND_PIECEWISE cuda graph mode by default (required to get good performance for mamba layers in V1).
Parameters:
-
(vllm_config¶VllmConfig) –vLLM Config
Source code in vllm/model_executor/models/config.py
MiniMaxM3SparseForConditionalGenerationConfig
¶
Bases: MiniMaxM3SparseConfig
Methods:
-
verify_and_update_model_config–Reject IndexCache overrides set on the outer VL config, where the
Source code in vllm/model_executor/models/config.py
verify_and_update_model_config(model_config)
classmethod
¶
Reject IndexCache overrides set on the outer VL config, where the ROCm text model never reads them.
Source code in vllm/model_executor/models/config.py
NemotronHForCausalLMConfig
¶
Bases: VerifyAndUpdateConfig
Methods:
-
update_mamba_ssm_cache_dtype–Update mamba_ssm_cache_dtype for NemotronH models when set to 'auto'
Attributes:
-
DEFAULT_MAMBA_SSM_CACHE_DTYPE(MambaDType) –Only
float32is known to have no accuracy issues by default.
Source code in vllm/model_executor/models/config.py
DEFAULT_MAMBA_SSM_CACHE_DTYPE = 'float32'
class-attribute
instance-attribute
¶
Only float32 is known to have no accuracy issues by default.
update_mamba_ssm_cache_dtype(*, cache_config, hf_config)
classmethod
¶
Update mamba_ssm_cache_dtype for NemotronH models when set to 'auto'
(or not explicitly set), to the value specified in the HF config, or to
float32 if not specified.
Source code in vllm/model_executor/models/config.py
Qwen3_5ForConditionalGenerationConfig
¶
Bases: VerifyAndUpdateConfig
Methods:
-
verify_and_update_config–Update mamba_ssm_cache_dtype for Qwen3.5 models when set to 'auto'
Source code in vllm/model_executor/models/config.py
verify_and_update_config(vllm_config)
staticmethod
¶
Update mamba_ssm_cache_dtype for Qwen3.5 models when set to 'auto' (or not explicitly set), to the value specified in the HF config's mamba_ssm_dtype field. Warn if the user explicitly overrides it to a different value.
Source code in vllm/model_executor/models/config.py
Qwen4ExpForConditionalGenerationConfig
¶
Bases: Qwen3_5ForConditionalGenerationConfig
Apply the Qwen3.5 hybrid-cache contract to Qwen4Exp.
Source code in vllm/model_executor/models/config.py
Qwen4ExpMTPConfig
¶
Bases: Qwen4ExpForConditionalGenerationConfig
Preserve MRoPE for a VL target and use 1D RoPE for a text target.
Source code in vllm/model_executor/models/config.py
UnlimitedOCRForCausalLMConfig
¶
Bases: VerifyAndUpdateConfig
Methods:
-
verify_and_update_config–Configure Unlimited-OCR attention backends for R-SWA and vision.
Source code in vllm/model_executor/models/config.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | |
verify_and_update_config(vllm_config)
staticmethod
¶
Configure Unlimited-OCR attention backends for R-SWA and vision.
Backend selection — controlled by the standard --attention-config
CLI argument (priority order):
-
--attention-config '{"backend": "FLASH_ATTN"}'→ FA4 + rswa_mask_mod. Exact token-level R-SWA.flash_attn_versionis forced to 4 if not already set (R-SWA mask_mod requires FA4; FA3 cannot express it). Raises if FA4 is not available on this device. -
--attention-config '{"backend": "FLEX_ATTENTION"}'→ FlexAttention R-SWA via Triton block mask. -
--attention-config '{"backend": "TRITON_ATTN"}'→ Triton unified attention with an R-SWA decode mask. -
--attention-config '{"backend": "auto"}'(or omitted) → Auto-detect: FA4 if available (H20/H100 SM90), else TritonAttention.
Regardless of backend, prefix caching is disabled for this model: R-SWA decode-phase KV is not a pure causal function of the prefix (so decode blocks are not reusable), and single-turn image-led OCR prompts rarely hit the prefix cache.
Example — force FlexAttention even on a machine with FA4::
vllm serve baidu/Unlimited-OCR \
--attention-config '{"backend": "FLEX_ATTENTION"}'
Source code in vllm/model_executor/models/config.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
_indexer_sparse_logits_supported(vllm_config)
¶
Whether the DeepSeek V4.1 sparse-logits indexer can run: a two-level (candidate block) model on SM100 with DeepGEMM's sparse MQA kernels and DeepSelect, no decode/prefill context parallelism, and a DeepSelect top-k backend. Mirrors DeepseekV41SparseIndexerMetadataBuilder's checks.
Source code in vllm/model_executor/models/config.py
_set_deepseek_indexer_logits_dtype(vllm_config)
¶
Default DeepSeek indexer logits to BF16 where the MQA logits kernels also reduce in BF16 (SM100) and to FP32 elsewhere.