Instructions to use zai-org/GLM-5.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-5.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zai-org/GLM-5.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zai-org/GLM-5.1") model = AutoModelForCausalLM.from_pretrained("zai-org/GLM-5.1", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zai-org/GLM-5.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zai-org/GLM-5.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zai-org/GLM-5.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zai-org/GLM-5.1
- SGLang
How to use zai-org/GLM-5.1 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 "zai-org/GLM-5.1" \ --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": "zai-org/GLM-5.1", "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 "zai-org/GLM-5.1" \ --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": "zai-org/GLM-5.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use zai-org/GLM-5.1 with Docker Model Runner:
docker model run hf.co/zai-org/GLM-5.1
Add files using upload-large-folder tool
Browse files- model-00219-of-00282.safetensors +3 -0
- model-00220-of-00282.safetensors +3 -0
- model-00221-of-00282.safetensors +3 -0
- model-00222-of-00282.safetensors +3 -0
- model-00223-of-00282.safetensors +3 -0
- model-00224-of-00282.safetensors +3 -0
- model-00225-of-00282.safetensors +3 -0
- model-00226-of-00282.safetensors +3 -0
- model-00227-of-00282.safetensors +3 -0
- model-00228-of-00282.safetensors +3 -0
- model-00229-of-00282.safetensors +3 -0
- model-00230-of-00282.safetensors +3 -0
- model-00231-of-00282.safetensors +3 -0
- model-00232-of-00282.safetensors +3 -0
- model-00233-of-00282.safetensors +3 -0
- model-00234-of-00282.safetensors +3 -0
- model-00235-of-00282.safetensors +3 -0
- model-00236-of-00282.safetensors +3 -0
- model-00237-of-00282.safetensors +3 -0
- model-00238-of-00282.safetensors +3 -0
- model-00239-of-00282.safetensors +3 -0
- model-00240-of-00282.safetensors +3 -0
- model-00241-of-00282.safetensors +3 -0
- model-00242-of-00282.safetensors +3 -0
- model-00243-of-00282.safetensors +3 -0
- model-00244-of-00282.safetensors +3 -0
- model-00245-of-00282.safetensors +3 -0
- model-00246-of-00282.safetensors +3 -0
- model-00247-of-00282.safetensors +3 -0
- model-00248-of-00282.safetensors +3 -0
- model-00249-of-00282.safetensors +3 -0
- model-00250-of-00282.safetensors +3 -0
- model-00251-of-00282.safetensors +3 -0
- model-00252-of-00282.safetensors +3 -0
- model-00253-of-00282.safetensors +3 -0
- model-00254-of-00282.safetensors +3 -0
- model-00255-of-00282.safetensors +3 -0
- model-00256-of-00282.safetensors +3 -0
model-00219-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c9230c7bdda94aa10bdfa45af08db1a1b66c3acb151470c5046f60fc12c6fecb
|
| 3 |
+
size 5359985360
|
model-00220-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8b00b3f058b8d53e5127f7063d8ddf1cb895da294401fc69faf3e3cd92cca53
|
| 3 |
+
size 5360347320
|
model-00221-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4ae18dd32bc17540684b93e758e35ca9d9926bcdca5f2967b3f9b31d33abf0c3
|
| 3 |
+
size 5360347320
|
model-00222-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4502616963796f2df2ae42fad18821c36090039ccfacae658650c7ce64dbdb22
|
| 3 |
+
size 5360347128
|
model-00223-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f819810025293f20456a03331053353a00aaab5a0c793b111c99fa2ea88abc40
|
| 3 |
+
size 5359985424
|
model-00224-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab4a7b143aa87574a2f235942dc16bad0a2cbcde9dd30e1270d424c7bb665117
|
| 3 |
+
size 5360347320
|
model-00225-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08b84a1d93579a64a1ca0cbfeb4f03adf4dd76663d293557b6103d8972968fa5
|
| 3 |
+
size 5360347280
|
model-00226-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b6c11c1efc7ca836149c195884b0fc1566464f23c26c492e3309093d7489251
|
| 3 |
+
size 5192196784
|
model-00227-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6570f8a9e5aee08f2defa55547e5c2ff3830adb3d7c0b222b51407a5d63bcaad
|
| 3 |
+
size 5351974184
|
model-00228-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f841d4ad813d2f2da03aec4dc7d506a6526f36214476d2f5d02be49fe4ab3dd
|
| 3 |
+
size 5360347312
|
model-00229-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94a96b52b47c848afbc51ce1f885b28a2f29ed734e31c0d6807320cb746219ad
|
| 3 |
+
size 5360347224
|
model-00230-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5fc299ad78eb5b976da28dd693b67764e4401631db51dd6b2c802ac7b8d5d3a3
|
| 3 |
+
size 5359985336
|
model-00231-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae6b1f57c3152ec29aaf2ed12ebd498db1a8a7a5f666787593d75352e240268f
|
| 3 |
+
size 5360347320
|
model-00232-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:42d737d9dd249973d43489d193f8dd02ac7be7c335132ad772736d282079dac9
|
| 3 |
+
size 5360347312
|
model-00233-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2da8909da9bd2f01e053fd92b858aa4913290d7d5b8df8bcae541d6cf5cc0152
|
| 3 |
+
size 5360347152
|
model-00234-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a6e22f06b9baa12db2090abf2be112ad38d52d725ddfd106a391b1f5b16e187
|
| 3 |
+
size 5359985408
|
model-00235-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6ceec0e4bd19b7049e9ac7ba6b0df5711bd4376b54cb6c0c289e63060caa0b55
|
| 3 |
+
size 5360347320
|
model-00236-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b966c895eceab2eba8177063e0291c981a83ce4adff202ee76a525bd256e76eb
|
| 3 |
+
size 5360347288
|
model-00237-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bfc35243f886137ab4bf328365da59d6abc7ee29233610a3feed24739394ef28
|
| 3 |
+
size 5360347112
|
model-00238-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f3f95d68d93d1cee5d287810334222a92c6ba07acf372dafd82cf4e22b7cde1
|
| 3 |
+
size 5359985280
|
model-00239-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d62837c4ca85be394c380b86dba4c05011a3e02c48a005324d7b53bbbdab187c
|
| 3 |
+
size 5360347104
|
model-00240-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7835b52963447a239328394bf2d8574236c8fe28c88679003caab72d65f5d86f
|
| 3 |
+
size 5360347016
|
model-00241-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4cfd4c2f569230f4bd1bb1f5ecdb1c4699d2cc67aa3bdc80d6dabe7d832c77f3
|
| 3 |
+
size 5359985160
|
model-00242-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca456d8c7d82f1e5db8ed729b8e125ea08d35eadcb2d36b87a1ce1172b8841b6
|
| 3 |
+
size 5360347320
|
model-00243-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e9b699854541d3a7e2f3ad12601a5f3cf6dda5aeda3536598a4def58da4d1a7
|
| 3 |
+
size 5360347320
|
model-00244-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eac6c30fbaa12e410e6fce46a981b8bf511015c0b0a5a870cd4797ec9d93daf4
|
| 3 |
+
size 5360347160
|
model-00245-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53a6bf409a5e3474b2383f3b5c8c34b6b792255d53e9ab7141c1877cdf7677a2
|
| 3 |
+
size 5359985392
|
model-00246-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3d98d4d9835d3df1d766d9057f5c22a407137d97926a7cd89e028fc2adb9020
|
| 3 |
+
size 5360347320
|
model-00247-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45c3bcd45468a0e542313b3feee6ad51afc51785e359318b97445c476b0156ad
|
| 3 |
+
size 5360347304
|
model-00248-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:867d29ff3d85e810e942fdf77672ccbdf2d6ac2af70eb8509e5b958cb00108b8
|
| 3 |
+
size 5360347104
|
model-00249-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d7cfaf8492761b9b537c28065f08f99cccbb887bdac0d8b47ee7c840432291ee
|
| 3 |
+
size 5359985456
|
model-00250-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c7907ef45aef7533b75ab1224750c8fe3c5a8c1f7263838e497435e62b52d449
|
| 3 |
+
size 5360347320
|
model-00251-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cad993cbcaa0593051d57430e32a55d4ce7759c9b40234e2122ce17c7c3b8c57
|
| 3 |
+
size 5360347248
|
model-00252-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2172a7c6042b819bd4f48aa7d09390ee95e4b9bfe1d3e5ec592d1eedc4b2280
|
| 3 |
+
size 5359985312
|
model-00253-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:13a415624410bacb79d8ce20cc60c15646ad3e63a3f29cad5e733c3655e11974
|
| 3 |
+
size 5360347320
|
model-00254-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:534ee1d72567b55b656656f40439d70a79a41293076d8dc1488d3ddabed710dc
|
| 3 |
+
size 5360347320
|
model-00255-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4752ae7bee4c474c3ecb68e881d41747bf3a975cb99a3ae20cc562dcc93a8103
|
| 3 |
+
size 5360347176
|
model-00256-of-00282.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:909b31fbe93ce89a2ca6a2861ae3048c064e841edce6a0d041a795dbe2accf39
|
| 3 |
+
size 5359985384
|