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)# 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") 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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
GLM5.1角色问题-重要
#17
by liuyt6515 - opened
这还是2026年吗,给我干哪来了
如果是对应 APP 的系统提示的话,提 Issue 给对应的 APP,如果是想说模型的蒸馏什么的问题的话,个人观点,省省吧,性能好就行,管它什么地缘政治,问问 OpenAI 以外的随便哪个开源的模型开发者:如果你制作的模型因为输出有 ChatGPT 就一直被别人挑说抄袭抄袭,你心情好不好?在智谱到底有没有蒸馏之前,这是站位的问题:还想不想要好的开源模型了?OpenAI 没有给我们大家钱,原本的目标也是垄断,在 HF 社区对这种问题提意见,本质上来说就是和所有开源模型工作者叫板,或许你也不是坏心,但哪怕你去和 GLM 私发或是随便去哪里评论,不要在 HF 上面这么说,给你提个醒,不如说,最好 HF 上再也不要有这类言论了。
实话说,本来我是根本不可能对这种 Issue 评论的,本来也很少评论,但转念一想,万一 HF 上面大家都慢慢带节奏,火上浇油,最后就和 OpenAI、Google、Anthropic 想要的一样,给商模立法知识产权,简单想象一下,那结果会怎样?LLM 大概率会变成和音视频编码器一样的专利泥潭,你敢做免费模型给大家用?不用怕,告死你。
这就是像你这样发这种 Issue 所会引向的未来。
月经贴
重要在哪?
lowB 问题
i love this
ZHANGYUXUAN-zR changed discussion status to closed


