vllm-project/vllm · error · ValueError
Either vllm_config must be provided, or all of model_config,
Error message
Either vllm_config must be provided, or all of model_config, parallel_config, and cache_config must be provided.
What it means
ValueError from lmcache_get_or_create_engine_metadata-style config assembly in vLLM's LMCache integration utils: the caller passed neither a full vllm_config nor the complete trio of model_config, parallel_config, and cache_config. The function needs all three configs to build LMCacheEngineMetadata (KV dtype, MLA detection, parallelism), so it refuses partial input rather than guessing. It is an API-contract error, almost always a programming mistake in caller code, not a runtime/environment failure.
Source
Thrown at vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/utils.py:134
to vllm_config)
cache_config (CacheConfig): Cache configuration (alternative to
vllm_config)
"""
# Third Party
# First Party
from lmcache.config import LMCacheEngineMetadata
from vllm.utils.torch_utils import get_kv_cache_torch_dtype
config = lmcache_get_or_create_config()
# Support both vllm_config object and individual config parameters
if vllm_config is not None:
model_cfg = vllm_config.model_config
parallel_cfg = vllm_config.parallel_config
cache_cfg = vllm_config.cache_config
else:
if model_config is None or parallel_config is None or cache_config is None:
raise ValueError(
"Either vllm_config must be provided, or all of "
"model_config, parallel_config, and cache_config must be provided."
)
model_cfg = model_config
parallel_cfg = parallel_config
cache_cfg = cache_config
# Get KV cache dtype
kv_dtype = get_kv_cache_torch_dtype(cache_cfg.cache_dtype, model_cfg.dtype)
# Check if MLA is enabled
use_mla = mla_enabled(model_cfg)
# Construct KV shape (for memory pool)
num_layer = model_cfg.get_num_layers(parallel_cfg)
chunk_size = config.chunk_size
num_kv_head = model_cfg.get_num_kv_heads(parallel_cfg)
head_size = model_cfg.get_head_size()View on GitHub (pinned to c794754062)
Solutions
- Pass the complete VllmConfig object — the preferred and simplest path.
- If you must pass individual configs, supply all three: model_config, parallel_config, and cache_config.
- In tests, build a minimal VllmConfig via the standard mock/vllm_config factory instead of hand-assembling configs.
Example fix
# before meta = build_metadata(model_config=mc) # after meta = build_metadata(vllm_config=vllm_config)
Defensive patterns
Strategy: type-guard
Validate before calling
from vllm.config import VllmConfig
assert isinstance(vllm_config, VllmConfig) or all(
c is not None for c in (model_config, parallel_config, cache_config)
) Type guard
def has_full_config(vllm_config, model_config, parallel_config, cache_config) -> bool:
return vllm_config is not None or (
model_config is not None
and parallel_config is not None
and cache_config is not None
) Prevention
- Prefer passing the single vllm_config everywhere
- Keep function signatures in sync with upstream when refactoring config plumbing
When it happens
Trigger: Calling the metadata/config helper with vllm_config=None and one of model_config/parallel_config/cache_config also None; passing only model_config; constructing the adapter manually in tests without a full VllmConfig.
Common situations: Custom scripts or tests that instantiate the LMCache integration directly instead of going through the engine; refactors that changed a function signature from three configs to a single vllm_config and callers were not all updated.
Related errors
- MLA only works with naive serde mode..
- layerwise MLA connector is not supported yet
- LMCacheMPConnector only works without hybrid kv cache manage
- Unknown KVConnectorRole: {self.role}
- The model is not multimodal.
AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14).
Data as JSON: /api/errors/fb1357cc044c7edc.
Report an issue: GitHub.