Instructions to use soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture") model = AutoModelForCausalLM.from_pretrained("soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture
- SGLang
How to use soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture with Docker Model Runner:
docker model run hf.co/soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture
GLM-5.3 Tiny NVFP4 MTP Test Fixture
This is a deterministic, random-weight architecture and serving fixture derived
directly from the released zai-org/GLM-5.3 config and tokenizer. It uses the
GlmMoeDsaForCausalLM architecture, four small backbone layers, eight experts,
and one MTP layer in the released model.layers.4 tensor layout. Runtime-critical
sparse MLA and DSA dimensions retain the released GLM-5.3 values.
The checkpoint does not inherit GLM-5.3 model weights and is not suitable for quality evaluation. Its purpose is to test end-to-end NVFP4 compression and vLLM MTP speculative decoding without downloading the full GLM-5.3 checkpoint.
Compression Recipe
The backbone is calibrated and quantized inside oneshot. The mtp_scheme
argument asks the same call to compress the MTP weights during post-processing.
from datasets import Dataset
from transformers import AutoModelForCausalLM
from llmcompressor import oneshot
from llmcompressor.modifiers.quantization import QuantizationModifier
from llmcompressor.utils import load_context
model_id = "/path/to/glm-5.3-tiny-mtp-source"
dataset = Dataset.from_dict(
{
"text": [
"Explain why speculative decoding can reduce inference latency.",
"Write a short Python function that adds two integers.",
"Summarize the benefits of mixture-of-experts language models.",
"What is the capital of France?",
"List three considerations when deploying a language model.",
"Describe the difference between weights and activations.",
"Complete the sequence: one, two, three, four.",
"Give a concise definition of quantization calibration.",
]
}
)
recipe = QuantizationModifier(
targets="Linear",
scheme="NVFP4",
ignore=[
"lm_head",
r"re:.*mlp\.gate$",
r"re:.*self_attn\.indexer\.(?:weights_proj|wk)$",
],
)
with load_context(AutoModelForCausalLM):
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16")
model.generation_config.top_p = None
oneshot(
model=model,
recipe=recipe,
dataset=dataset,
output_dir="GLM-5.3-MTP-NVFP4-Test-Fixture",
max_seq_length=128,
num_calibration_samples=len(dataset),
moe_calibrate_all_experts=True,
mtp_scheme="NVFP4",
)
Transformers does not construct the MTP layer, so it cannot observe MTP activations during calibration. The MTP group is therefore weight-only NVFP4; the backbone remains calibrated W4A4 NVFP4.
Validation
- All 562 indexed tensors are present, with no missing or unindexed tensors.
- 105 backbone linears have NVFP4 packed weights, block scales, global scales, and calibrated input global scales.
- 33 MTP projections have NVFP4 packed weights, block scales, and global scales
in
model_mtp.safetensors; no uncalibrated MTP activation scales are stored. - The NVFP4 checkpoint passed vLLM MTP speculative decoding on H100 with the Marlin FP4 fallback and one speculative token.
- Native W4A4 NVFP4 execution on Blackwell remains the final hardware smoke test.
vLLM
vllm serve soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture \
--speculative-config '{"method":"mtp","num_speculative_tokens":1}'
- Downloads last month
- -
Model tree for soyrsoyr/GLM-5.3-MTP-NVFP4-Test-Fixture
Base model
zai-org/GLM-5.3