Views
No views yet
model.language_model.*
(a legacy of Qwen3_5ForConditionalGeneration). The vLLM implementation of the text architecture
Qwen3_5ForCausalLM is flat: expects model.layers.*, model.embed_tokens, and model.norm.
Because of this, vLLM doesn't load the original and crashes on startup:ValueError: There is no module or parameter named 'language_model' in Qwen3_5Model.model.language_model. to model. (e.g., model.language_model.layers.0.mlp.gate_proj.weight to
model.layers.0.mlp.gate_proj.weight).config.json, tokenizer, and chat_template.jinja are copies of the original, unchanged.Qwen3_5ForCausalLM architecture,
quantization — AWQ W4A16_ASYM group 128 (compressed-tensors, pack-quantized),
linear_attn (DeltaNet) and lm_head remain in BF16.vllm/vllm-openai:latest), NVIDIA GPU (Blackwell / Ada):
loads and responds to requests.
-Quantization is determined automatically by config.json
(--quantization compressed-tensors can be omitted).--safetensors-load-strategy=prefetch. On a Linux server (standard deployment), the flag is not needed.1vllm serve /models/Qwen3.5-4B-AWQ-text-flat \
2--served-model-name Qwen3.5-9B \
3--max-model-len 16384 \
4--reasoning-parser qwen3 \
5--language-model-only \
6--default-chat-template-kwargs '{"enable_thinking": false}'data_offsets in safetensors are calculated from the start of the data section, so the header can
be changed freely, the data is not shifted):1import json, struct, shutil
2
3SRC = "model.safetensors" # original (kumar2235/Qwen3.5-4B-AWQ)
4DST = "model-flat.safetensors" # result
5
6with open(SRC, "rb") as f:
7n = struct.unpack("<Q", f.read(8))[0]
8header = json.loads(f.read(n))
9
10renamed = {}
11for k, v in header.items():
12if k == "__metadata__":
13renamed[k] = v
14elif k.startswith("model.language_model."):
15renamed["model." + k[len("model.language_model."):]] = v
16else:
17renamed[k] = v
18
19new_header = json.dumps(renamed, separators=(",", ":")).encode()
20with open(SRC, "rb") as fin, open(DST, "wb") as fout:
21fout.write(struct.pack("<Q", len(new_header)))
22fout.write(new_header)
23fin.seek(8 + n) # data section immediately after the original header
24shutil.copyfileobj(fin, fout)language_model left in the header,
and os.path.getsize(DST) should equal
8 + len(new_header) + (os.path.getsize(SRC) - 8 - n).