Instructions to use inference-optimization/GLM-5.3-Flash-0.1B-A0.1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inference-optimization/GLM-5.3-Flash-0.1B-A0.1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="inference-optimization/GLM-5.3-Flash-0.1B-A0.1B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("inference-optimization/GLM-5.3-Flash-0.1B-A0.1B") model = AutoModelForMultimodalLM.from_pretrained("inference-optimization/GLM-5.3-Flash-0.1B-A0.1B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inference-optimization/GLM-5.3-Flash-0.1B-A0.1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inference-optimization/GLM-5.3-Flash-0.1B-A0.1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/GLM-5.3-Flash-0.1B-A0.1B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/inference-optimization/GLM-5.3-Flash-0.1B-A0.1B
- SGLang
How to use inference-optimization/GLM-5.3-Flash-0.1B-A0.1B 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 "inference-optimization/GLM-5.3-Flash-0.1B-A0.1B" \ --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": "inference-optimization/GLM-5.3-Flash-0.1B-A0.1B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "inference-optimization/GLM-5.3-Flash-0.1B-A0.1B" \ --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": "inference-optimization/GLM-5.3-Flash-0.1B-A0.1B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use inference-optimization/GLM-5.3-Flash-0.1B-A0.1B with Docker Model Runner:
docker model run hf.co/inference-optimization/GLM-5.3-Flash-0.1B-A0.1B
GLM-5.3-Flash-0.1B-A0.1B
This is a tiny version of zai-org/GLM-5.3-Flash created for testing and development.
Model Details
- Base Model: zai-org/GLM-5.3-Flash
- Architecture: glm5_next (
Glm5NextForConditionalGeneration) - Total Parameters: 0.084B
- Activated Parameters: 0.084B (MoE: 4 of 8 routed experts + 1 shared expert per sparse layer)
This tiny model preserves the full architecture of the base model:
- Hybrid attention: KDA linear attention (
linear_attention) layers and DeepSeek sparse attention / MLA (deepseek_sparse_attention) layers with the token indexer. - Mixed FFN schedule: dense MLP layers (first 3) and sparse MoE layers (routed experts + shared expert).
- Manifold-Constrained Hyper-Connections (mHC) at every attention/FFN site.
- The vision tower (
Glm5NextVisionModel) and multimodal projector.
The model is a bf16 dense checkpoint (the base model's fp8 quantization_config was removed so the tiny model can be randomly initialized and fine-tuned).
Configuration Changes
The following parameters were reduced from the original model:
| Parameter | Original | Tiny |
|---|---|---|
text hidden_size |
4096 | 256 |
text num_hidden_layers |
45 | 5 |
text intermediate_size (dense) |
12288 | 256 |
text moe_intermediate_size |
2048 | 128 |
n_routed_experts |
288 | 8 |
num_experts_per_tok |
8 | 4 |
n_shared_experts |
1 | 1 |
num_attention_heads / num_key_value_heads |
64 | 4 |
q_lora_rank |
1536 | 128 |
kv_lora_rank |
512 | 64 |
qk_nope_head_dim / v_head_dim |
256 | 64 |
index_n_heads |
32 | 4 |
index_head_dim |
128 | 64 |
index_topk |
2048 | 64 |
index_kpool |
4 | 4 |
linear attn num_heads |
64 | 4 |
vision depth |
24 | 2 |
vision hidden_size |
1024 | 128 |
vision out_hidden_size |
4096 | 256 |
vocab_size |
154880 | 154880 (unchanged) |
| quantization | fp8 (block 128×128) | none (bf16) |
Per-layer schedules were regenerated for the reduced depth:
layer_types:[linear, linear, linear, deepseek_sparse_attention, linear]mlp_layer_types:[dense, dense, dense, sparse, sparse]indexer_types:[full, full, full, full, full]
Checkpoint Structure
Single-file model.safetensors (223 tensors). The tensor naming is analogous to the
original sharded checkpoint (model.language_model.layers.*, model.visual.*,
lm_head.weight, hyper-connection params hc_attn_* / hc_ffn_*, MLA params
q_a_proj/q_b_proj/kv_a_proj_with_mqa/kv_b_proj, indexer params, KDA linear-attention
params, and packed MoE mlp.experts.*).
Two intentional differences vs. the original:
- No
weight_scale_invtensors — the tiny model is bf16, not fp8. - No MTP layer (original layer index 45 with
eh_proj/enorm/hnorm/shared_head.norm) — the transformersGlm5Nextmodel does not build the multi-token-prediction layer (_keys_to_ignore_on_load_unexpectedskipslayers.45.*), so no converter is required.
Usage
from transformers import Glm5NextForConditionalGeneration, AutoTokenizer
model = Glm5NextForConditionalGeneration.from_pretrained(
"inference-optimization/GLM-5.3-Flash-0.1B-A0.1B", device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("inference-optimization/GLM-5.3-Flash-0.1B-A0.1B")
input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device)
output = model.generate(input_ids, max_new_tokens=20)
print(tokenizer.decode(output[0]))
Creation Process
This model was created using the llm-compressor create-tiny-model claude skill.
- Built a reduced
Glm5NextConfigfrom the base config (removedquantization_config; shrank hidden/layer/expert/MLA/indexer/vision dims; regenerated per-layer schedules). - Randomly initialized weights (
init_weights+ non-finite/extreme-value fixup) with transformers 5.16.1. - Fine-tuned text-only on a small copypasta dataset until the training perplexity converged well below 3.0.
- Verified the saved checkpoint structure matches the original naming convention (minus fp8 scales and the MTP layer).
Validation
perplexity = 1.05 (target <= 10) PASS
GEN: According to all known laws of aviation, there is no way a bee should be able to fly. Its wings are too small
total params: 84,361,950
Notes
- Requires
transformers >= 5.16.0(which registers theglm5_nextmodel type). - This is a randomly-initialized, fine-tuned-on-toy-data model. It is intended solely for testing/development of tooling (quantization, serving, CI) and has no real language or vision capability.
- Fine-tuning was text-only; the vision tower is randomly initialized.
- Downloads last month
- -
Model tree for inference-optimization/GLM-5.3-Flash-0.1B-A0.1B
Base model
zai-org/GLM-5.3-Flash
docker model run hf.co/inference-optimization/GLM-5.3-Flash-0.1B-A0.1B