Instructions to use PYTHAI/GLM-5.2-fork with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PYTHAI/GLM-5.2-fork with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PYTHAI/GLM-5.2-fork") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PYTHAI/GLM-5.2-fork") model = AutoModelForCausalLM.from_pretrained("PYTHAI/GLM-5.2-fork", 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 PYTHAI/GLM-5.2-fork with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PYTHAI/GLM-5.2-fork" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PYTHAI/GLM-5.2-fork", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PYTHAI/GLM-5.2-fork
- SGLang
How to use PYTHAI/GLM-5.2-fork 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 "PYTHAI/GLM-5.2-fork" \ --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": "PYTHAI/GLM-5.2-fork", "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 "PYTHAI/GLM-5.2-fork" \ --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": "PYTHAI/GLM-5.2-fork", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PYTHAI/GLM-5.2-fork with Docker Model Runner:
docker model run hf.co/PYTHAI/GLM-5.2-fork
File size: 1,962 Bytes
470a343 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | {
"kind": "licence-locked pointer fork",
"source_repo": "zai-org/GLM-5.2",
"source_url": "https://huggingface.co/zai-org/GLM-5.2",
"source_commit": "cf457fa734ab149ffef225f80893eb38c6ff5cdc",
"forked_at_utc": "2026-09-13T23:55:35Z",
"licence_tag": "mit",
"licence_file": {
"path": "LICENSE",
"bytes": 1065,
"sha256": "f4a18c6ae40b0a8e7d2b7667f52f6e1994e54a46430d2e172b73cb8c9b5eb0d7"
},
"weights_copied": false,
"weights_not_copied": {
"files": 282,
"bytes": 1506667387408
},
"parameters": 753329940480,
"load_weights_with": "from_pretrained('zai-org/GLM-5.2', revision='cf457fa734ab149ffef225f80893eb38c6ff5cdc')",
"files": [
{
"path": "LICENSE",
"bytes": 1065,
"sha256": "f4a18c6ae40b0a8e7d2b7667f52f6e1994e54a46430d2e172b73cb8c9b5eb0d7"
},
{
"path": "README.md",
"bytes": 10939,
"sha256": "7ba22185651d8f69fbf6227ee718eb680fd834ec8e79ba78df6fa54896614b3d"
},
{
"path": "chat_template.jinja",
"bytes": 5076,
"sha256": "172dc74a35e1752df75ecfb2b2cf9326d2852bb1379868ebeec9571654489679"
},
{
"path": "config.json",
"bytes": 3732,
"sha256": "185f93ee6d12548e16a847e279dc0c3c90b1524c970b0866b42fb545747d859a"
},
{
"path": "generation_config.json",
"bytes": 194,
"sha256": "ac76b43d8683d3b930126870fc8be73d8679308fe752fa1f381096d8354f6a55"
},
{
"path": "model.safetensors.index.json",
"bytes": 5408032,
"sha256": "5fd47a926aefce0f2c917f42523e5e0f3c87e23e389e767c3681536a62f5cf5e"
},
{
"path": "tokenizer.json",
"bytes": 20217442,
"sha256": "19e773648cb4e65de8660ea6365e10acca112d42a854923df93db4a6f333a82d"
},
{
"path": "tokenizer_config.json",
"bytes": 761,
"sha256": "98b1271574f41abf89427ae2dda030d94dc9478f0edc5a8bd240db213c6fd5fc"
}
],
"why": "preserve the licence terms of this exact commit and pin the revision; the weights stay at the source and are addressed by commit sha",
"forked_by": "mindX (PYTHAI) via the node token"
} |