Text Generation
Transformers
Safetensors
glm_moe_dsa
compressed-tensors
int4
int8
w4a16
w8a16
Mixture of Experts
glm
dgx-spark
gb10
vllm
conversational
Instructions to use 2wild4tv/GLM-5.3-Int4-Int8Mix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 2wild4tv/GLM-5.3-Int4-Int8Mix with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="2wild4tv/GLM-5.3-Int4-Int8Mix") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("2wild4tv/GLM-5.3-Int4-Int8Mix") model = AutoModelForCausalLM.from_pretrained("2wild4tv/GLM-5.3-Int4-Int8Mix", 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 2wild4tv/GLM-5.3-Int4-Int8Mix with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "2wild4tv/GLM-5.3-Int4-Int8Mix" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "2wild4tv/GLM-5.3-Int4-Int8Mix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/2wild4tv/GLM-5.3-Int4-Int8Mix
- SGLang
How to use 2wild4tv/GLM-5.3-Int4-Int8Mix 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 "2wild4tv/GLM-5.3-Int4-Int8Mix" \ --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": "2wild4tv/GLM-5.3-Int4-Int8Mix", "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 "2wild4tv/GLM-5.3-Int4-Int8Mix" \ --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": "2wild4tv/GLM-5.3-Int4-Int8Mix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 2wild4tv/GLM-5.3-Int4-Int8Mix with Docker Model Runner:
docker model run hf.co/2wild4tv/GLM-5.3-Int4-Int8Mix
Card: verified evidence (structural + byte-for-byte QuantTrio match + coherence), honest no-parity caveat, sm12x overlay serving note
Browse files
README.md
CHANGED
|
@@ -60,18 +60,24 @@ vllm serve <path-to-this-model> \
|
|
| 60 |
--max-model-len 131072 # raise per your KV pool
|
| 61 |
```
|
| 62 |
|
|
|
|
|
|
|
| 63 |
- **Speculative decode:** pairs with **[incoai/GLM-5.3-DFlash2](https://huggingface.co/incoai/GLM-5.3-DFlash2)** (a 4.9 GB DFlash2 drafter) at ~zero extra KV pool — the flagship stack. Native MTP (layer 78) is preserved as a fallback.
|
| 64 |
- **Long context:** add **Decode Context Parallel** (`--decode-context-parallel-size 4`) to split the KV across all four nodes for a ~600K single-request context (the tradeoff is a small cross-node cost per decode step).
|
| 65 |
|
| 66 |
-
##
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
## Credits (what's whose)
|
| 77 |
|
|
|
|
| 60 |
--max-model-len 131072 # raise per your KV pool
|
| 61 |
```
|
| 62 |
|
| 63 |
+
- **⚠️ GB10 / sm121 needs the sm12x kernel overlays** (the sparse-MLA + fp8-KV path is not in stock vLLM for this arch). Get them from the sibling recipe repo: **[tonyd2wild/GLM-5.2-QuantTrio-200K-4x-DGX-Spark](https://github.com/tonyd2wild/GLM-5.2-QuantTrio-200K-4x-DGX-Spark--36tok-s)**. On standard CUDA (H100/A100 etc.), `--quantization compressed-tensors` is all you need.
|
| 64 |
+
- `kv_cache_scheme: None` in the config — KV precision is a **serve-time** choice (`--kv-cache-dtype`), not baked into the weights.
|
| 65 |
- **Speculative decode:** pairs with **[incoai/GLM-5.3-DFlash2](https://huggingface.co/incoai/GLM-5.3-DFlash2)** (a 4.9 GB DFlash2 drafter) at ~zero extra KV pool — the flagship stack. Native MTP (layer 78) is preserved as a fallback.
|
| 66 |
- **Long context:** add **Decode Context Parallel** (`--decode-context-parallel-size 4`) to split the KV across all four nodes for a ~600K single-request context (the tradeoff is a small cross-node cost per decode step).
|
| 67 |
|
| 68 |
+
## Verification (what's proven, and what isn't)
|
| 69 |
|
| 70 |
+
Produced by a shard-streaming RTN quantizer (reads one BF16 shard at a time, quantizes with `compressed_tensors`' own `calculate_qparams` / `quantize` / `pack_to_int32`, writes a 1:1 output shard; peak RAM ~10 GiB, runtime **28.2 min**). NOT `llmcompressor.oneshot` — accelerate disk-offload would need ~1.4 TB of scratch this fleet doesn't have.
|
| 71 |
|
| 72 |
+
**Proven:**
|
| 73 |
+
- **Structural (fail-closed):** 59,585 source tensors → 58,992 quantized modules → 177,569 output tensors (exact). Group counts **57,600 / 616 / 776** match the pre-quant dry-run exactly (75 layers × 256 experts × 3 = 57,600 ✓). Sacred modules (layer 0, `mlp.gate`, indexer, `lm_head`, MTP norms) all plain BF16, zero packed leaks. 282 shards, none missing.
|
| 74 |
+
- **Layout matches QuantTrio byte-for-byte** (verified via HTTP range-reads of their published safetensors headers): expert `down_proj.weight_packed` I32 `[6144,256]`, `weight_scale` BF16 `[6144,16]`, MTP scale BF16 `[6144,1]` — all identical.
|
| 75 |
+
- **Numerical round-trip:** int8 group/128 ≈ 0.70% rel error, int4 ≈ 12% (normal for 16 levels), full range used.
|
| 76 |
+
- **Serves live:** TP4 across 4× DGX Spark (GB10/sm121), vLLM 0.23.1rc1, weights 95.53 GiB/rank, fp8_ds_mla KV, 202,944-token KV pool @ 200K ctx, health 200. Passed the bat-and-ball coherence trap ($0.05 with correct algebra) — a mis-quantized router or indexer cannot do that.
|
| 77 |
+
|
| 78 |
+
**NOT yet done (honest):**
|
| 79 |
+
- **No 69-scenario eval.** Coherence is proven; quality-vs-fp8 parity is NOT measured. Do not assume parity.
|
| 80 |
+
- **Speed:** not benchmarked representatively. Any current number is thinking-ON, no spec-decode, no CUDA graphs = a FLOOR, not the model's real speed. Proper DFlash2 + graphs numbers will be added when measured.
|
| 81 |
|
| 82 |
## Credits (what's whose)
|
| 83 |
|