sgl-project/sglang · critical · ValueError
Invalid projection layers: {config.projection_layers}
Error message
Invalid projection layers: {config.projection_layers} What it means
MiMo audio encoder construction switches on config.projection_layers to choose the projection head architecture; values outside the supported set fall through to this error. It indicates the config was authored for an unsupported or newer projection layout than this code supports.
Source
Thrown at python/sglang/srt/models/mimo_audio.py:1256
)
for i in range(self.audio_channels)
]
)
if config.projection_layers == 1:
self.projection = nn.Linear(
self.audio_input_local_dim * self.audio_group_size,
self.audio_out_hidden_size,
bias=False,
)
elif config.projection_layers == 2:
self.projection = AudioProjection(
self.audio_input_local_dim * self.audio_group_size,
self.audio_input_local_dim * self.audio_group_size * 4,
self.audio_out_hidden_size,
)
else:
raise ValueError(f"Invalid projection layers: {config.projection_layers}")
model_path = get_model().model_path
if not os.path.isdir(model_path):
from huggingface_hub import snapshot_download
model_path = snapshot_download(
model_path,
allow_patterns=["audio_tokenizer/*"],
)
audio_tokenizer_path = os.path.join(model_path, "audio_tokenizer")
dev = torch.device(f"cuda:{torch.cuda.current_device()}")
self.audio_tokenizer = self._load_mimo_audio_tokenizer(
audio_tokenizer_path, dev
)
@staticmethod
def _load_mimo_audio_tokenizer(
path: str, device: torch.deviceView on GitHub (pinned to 0132848349)
Solutions
- Check the supported projection_layers values in mimo_audio.py build_audio_encoder and set config.projection_layers accordingly
- Re-download the audio tokenizer assets matching your sglang version (snapshot_download of the correct repo)
- Pin sglang and the MiMo checkpoint to a compatible release pair
Example fix
// before "projection_layers": "v3" // after "projection_layers": 2 // a value handled by build_audio_encoder
Defensive patterns
Strategy: validation
Validate before calling
from sglang.srt.models.mimo_audio import build_audio_encoder # inspect supported values # before launch, confirm config value is one handled in build_audio_encoder: # print the branch conditions or check release notes for your sglang version
Prevention
- Keep audio tokenizer assets and sglang version in lockstep
- Test-launch the audio model after upgrading either side
When it happens
Trigger: config.projection_layers is an unrecognized value (e.g. an int or string not in the handled branches) when the audio model is constructed during engine init. Typically triggered by a mismatched audio config.json for the MiMo checkpoint.
Common situations: Mixing audio tokenizer weights/config from a different MiMo release; upgrading sglang against an older audio config; hand-edited projection config.
Related errors
- Serve backend {name!r} uses API version {backend.api_version
- scalar_type_id {scalar_type_id} doesn't exists.
- bad compress_ratio {compress_ratio}
- The requested FlashAttention forward configuration exceeds S
- flashinfer_sparse_mla supports only GLM DSA with FP8 KV cach
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/959ed850093036cb.
Report an issue: GitHub.