> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-hi/language-models/glm5.md).

# GLM-5

Clore.ai पर Zhipu AI द्वारा GLM-5 (744B MoE) डिप्लॉय करें — vLLM के साथ API एक्सेस और स्व-होस्टिंग

GLM-5, जिसे Zhipu AI (Z.AI) ने फरवरी 2026 में जारी किया, एक **744-अरब पैरामीटर वाला Mixture-of-Experts** भाषा मॉडल है जो प्रति टोकन केवल 40B पैरामीटर सक्रिय करता है। यह तर्क, कोडिंग, और एजेंटिक कार्यों में सर्वोत्तम-इन-क्लास ओपन-सोर्स प्रदर्शन हासिल करता है — SWE-bench Verified पर 77.8% स्कोर करते हुए और Claude Opus 4.5 तथा GPT-5.2 जैसे फ्रंटियर मॉडलों को टक्कर देता है। मॉडल निम्न के तहत उपलब्ध है **MIT लाइसेंस** HuggingFace पर।

## मुख्य विशेषताएँ

* **कुल 744B / सक्रिय 40B** — अत्यंत कुशल रूटिंग वाला 256-विशेषज्ञ MoE
* **फ्रंटियर स्तर का कोडिंग प्रदर्शन** — SWE-bench Verified पर 77.8%, SWE-bench Multilingual पर 73.3%
* **गहन तर्क** — AIME 2026 पर 92.7%, HMMT Nov 2025 पर 96.9%, अंतर्निहित thinking mode
* **एजेंटिक क्षमताएँ** — मूल टूल कॉलिंग, फ़ंक्शन निष्पादन, और दीर्घ-क्षितिज कार्य योजना
* **200K+ कॉन्टेक्स्ट विंडो** — विशाल कोडबेस और लंबे दस्तावेज़ों को संभालता है
* **MIT लाइसेंस** — पूरी तरह ओपन वेट्स, व्यावसायिक उपयोग अनुमत

## आवश्यकताएँ

{% hint style="warning" %}
**Clore.ai marketplace पर multi-GPU 80GB-class rigs सूचीबद्ध नहीं हैं।** आज सूचीबद्ध सबसे बड़े boxes 4× RTX PRO 6000 Blackwell (प्रत्येक 96GB, कुल 380GB) और 8–11× RTX 5090 (प्रत्येक 32GB) हैं। A100 / H200 / B200 क्षमता [bare metal](https://clore.ai/bare-metal) के रूप में अनुरोध पर बेची जाती है। देखें [GPU मूल्य और उपलब्धता](/guides/guides_v2-hi/getting-started/pricing.md) किसी deployment का आकार तय करने से पहले।
{% endhint %}

GLM-5 को सेल्फ-होस्ट करना एक गंभीर कार्य है — FP8 चेकपॉइंट के लिए आवश्यकता होती है **\~860GB VRAM**.

| घटक   | न्यूनतम (FP8) | अनुशंसित      |
| ----- | ------------- | ------------- |
| GPU   | 8× H100 80GB  | 8× H200 141GB |
| VRAM  | 640GB         | 1,128GB       |
| RAM   | 256GB         | 512GB         |
| डिस्क | 1.5TB NVMe    | 2TB NVMe      |
| CUDA  | 12.8+         | 12.8+         |

**Clore.ai की सिफारिश**: अधिकांश उपयोगकर्ताओं के लिए, **API के माध्यम से GLM-5 तक पहुँचें** (Z.AI, OpenRouter). सेल्फ-होस्टिंग तभी उचित है यदि आप 8× H100/H200 किराए पर ले सकते हैं ([bare metal](https://clore.ai/bare-metal) Clore.ai पर)।

## API एक्सेस (अधिकांश उपयोगकर्ताओं के लिए अनुशंसित)

Clore.ai मशीन या कहीं से भी GLM-5 का उपयोग करने का सबसे व्यावहारिक तरीका:

### Z.AI प्लेटफ़ॉर्म के माध्यम से

```python
from openai import OpenAI

client = OpenAI(
    api_key="your-zai-api-key",
    base_url="https://api.z.ai/v1"
)

response = client.chat.completions.create(
    model="glm-5",
    messages=[
        {"role": "system", "content": "आप एक सहायक सहायक हैं."},
        {"role": "user", "content": "aiohttp और BeautifulSoup का उपयोग करके एक Python async वेब स्क्रैपर लिखिए"}
    ],
    temperature=1.0,
    max_tokens=4096
)
print(response.choices[0].message.content)
```

### OpenRouter के माध्यम से

```python
from openai import OpenAI

client = OpenAI(
    api_key="your-openrouter-key",
    base_url="https://openrouter.ai/api/v1"
)

response = client.chat.completions.create(
    model="zai-org/glm-5",
    messages=[
        {"role": "user", "content": "GLM-5 में उपयोग की गई MoE आर्किटेक्चर को समझाइए"}
    ],
    max_tokens=2048
)
print(response.choices[0].message.content)
```

## vLLM सेटअप (सेल्फ-होस्टिंग)

Clore.ai पर उच्च-स्तरीय मल्टी-GPU मशीनों तक पहुँच रखने वालों के लिए:

```bash
# vLLM इंस्टॉल करें (GLM-5 समर्थन के लिए nightly आवश्यक है)
pip install -U vllm --pre --extra-index-url https://wheels.vllm.ai/nightly

# नवीनतम transformers इंस्टॉल करें (आवश्यक)
pip install git+https://github.com/huggingface/transformers.git
```

### 8× H200 GPU पर FP8 सर्व करें

```bash
vllm serve zai-org/GLM-5-FP8 \\
  --tensor-parallel-size 8 \\
  --speculative-config.method mtp \\
  --speculative-config.num_speculative_tokens 1 \\
  --tool-call-parser glm47 \\
  --reasoning-parser glm45 \\
  --enable-auto-tool-choice \\
  --served-model-name glm-5-fp8 \\
  --gpu-memory-utilization 0.85
```

### सर्वर से क्वेरी करें

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")

# thinking mode के साथ (डिफ़ॉल्ट)
response = client.chat.completions.create(
    model="glm-5-fp8",
    messages=[
        {"role": "system", "content": "आप एक सहायक सहायक हैं."},
        {"role": "user", "content": "हल कीजिए: वे सभी अभाज्य p ज्ञात करें जहाँ p^2 + 2 भी अभाज्य हो"}
    ],
    temperature=1.0,
    max_tokens=4096
)
print(response.choices[0].message.content)

# thinking mode के बिना (तेज़, छोटे उत्तर)
response = client.chat.completions.create(
    model="glm-5-fp8",
    messages=[
        {"role": "user", "content": "Rust में quicksort लिखिए"}
    ],
    temperature=1.0,
    max_tokens=4096,
    extra_body={
        "chat_template_kwargs": {"enable_thinking": False}
    }
)
print(response.choices[0].message.content)
```

## SGLang विकल्प

SGLang भी GLM-5 को सपोर्ट करता है और कुछ हार्डवेयर पर बेहतर प्रदर्शन दे सकता है:

```bash
# Docker का उपयोग करते हुए (Hopper GPU)
docker pull lmsysorg/sglang:glm5-hopper

# सर्वर प्रारंभ करें
python3 -m sglang.launch_server \\
  --model-path zai-org/GLM-5-FP8 \\
  --tp-size 8 \\
  --tool-call-parser glm47 \\
  --reasoning-parser glm45 \\
  --speculative-algorithm EAGLE \\
  --speculative-num-steps 3 \\
  --speculative-eagle-topk 1 \\
  --speculative-num-draft-tokens 4 \\
  --mem-fraction-static 0.85 \\
  --served-model-name glm-5-fp8
```

## Docker त्वरित शुरुआत

```bash
# GLM-5 समर्थन वाला vLLM Docker image
docker run --gpus all -p 8000:8000 \\
  --ipc=host \\
  -v ~/.cache/huggingface:/root/.cache/huggingface \\
  vllm/vllm-openai:glm5 zai-org/GLM-5-FP8 \\
  --tensor-parallel-size 8 \\
  --tool-call-parser glm47 \\
  --reasoning-parser glm45 \\
  --enable-auto-tool-choice \\
  --served-model-name glm5 \\
  --trust-remote-code
```

## टूल कॉलिंग उदाहरण

GLM-5 में मूल टूल-कॉलिंग समर्थन है — एजेंटिक एप्लिकेशन बनाने के लिए आदर्श:

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "किसी शहर के लिए वर्तमान मौसम प्राप्त करें",
        "parameters": {
            "type": "object",
            "required": ["city"],
            "properties": {
                "city": {"type": "string", "description": "शहर का नाम"}
            }
        }
    }
}]

response = client.chat.completions.create(
    model="glm-5-fp8",
    messages=[{"role": "user", "content": "टोक्यो में मौसम कैसा है?"}],
    tools=tools,
    tool_choice="auto"
)
print(response.choices[0].message.tool_calls)
```

## Clore.ai उपयोगकर्ताओं के लिए सुझाव

* **पहले API, बाद में सेल्फ-होस्ट**: GLM-5 के लिए 8× H200 ([bare metal](https://clore.ai/bare-metal) Clore.ai पर)। कभी-कभार उपयोग के लिए, Z.AI API या OpenRouter कहीं अधिक किफायती है। केवल तब सेल्फ-होस्ट करें जब आपको लगातार थ्रूपुट या डेटा गोपनीयता चाहिए।
* **इसके बजाय GLM-4.7 पर विचार करें**: यदि 8× H200 बहुत अधिक है, तो पूर्ववर्ती GLM-4.7 (355B, 32B active) 4× H200 या 4× H100 (\~$4.16/hr) पर चलता है और फिर भी उत्कृष्ट प्रदर्शन देता है।
* **FP8 वेट्स का उपयोग करें**: हमेशा उपयोग करें `zai-org/GLM-5-FP8` — BF16 के समान गुणवत्ता, लेकिन लगभग आधी मेमोरी खपत। BF16 संस्करण के लिए 16× GPU की आवश्यकता होती है।
* **VRAM उपयोग की निगरानी करें**: `nvidia-smi देखें` — लंबे कॉन्टेक्स्ट क्वेरीज़ मेमोरी बढ़ा सकती हैं। सेट करें `--gpu-memory-utilization 0.85` ताकि पर्याप्त हेडरूम रहे।
* **Thinking mode का ट्रेड-ऑफ़**: Thinking mode जटिल कार्यों के लिए बेहतर परिणाम देता है, लेकिन अधिक टोकन और समय लेता है। इसे सरल क्वेरीज़ के लिए इससे अक्षम करें `enable_thinking: false`.

## समस्या निवारण

| समस्या                          | समाधान                                                                                                 |
| ------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `OutOfMemoryError` स्टार्टअप पर | सुनिश्चित करें कि आपके पास 8× H200 (प्रत्येक 141GB) हों। FP8 को कुल \~860GB VRAM चाहिए।                |
| धीमी डाउनलोड गति (\~800GB)      | उपयोग करें `huggingface-cli download zai-org/GLM-5-FP8` के साथ `--local-dir` को पुनः शुरू करने के लिए। |
| vLLM संस्करण मेल नहीं खा रहा    | GLM-5 के लिए vLLM nightly आवश्यक है। इसे इस प्रकार इंस्टॉल करें `pip install -U vllm --pre`.           |
| टूल कॉल्स काम नहीं कर रही हैं   | जोड़ें `--tool-call-parser glm47 --enable-auto-tool-choice` को serve कमांड में जोड़ें।                 |
| DeepGEMM त्रुटियाँ              | FP8 के लिए DeepGEMM इंस्टॉल करें: इसका उपयोग करें `install_deepgemm.sh` स्क्रिप्ट vLLM रेपो से।        |
| Thinking mode का आउटपुट खाली है | सेट करें `temperature=1.0` — thinking mode के लिए शून्य से अधिक temperature आवश्यक है।                 |

## अधिक पढ़ें

* [HuggingFace पर GLM-5](https://huggingface.co/zai-org/GLM-5)
* [GLM-5 FP8 चेकपॉइंट](https://huggingface.co/zai-org/GLM-5-FP8)
* [Z.AI प्लेटफ़ॉर्म](https://chat.z.ai)
* [Z.AI API डॉक्स](https://docs.z.ai/guides/llm/glm-5)
* [vLLM GLM-5 रेसिपी](https://docs.vllm.ai/projects/recipes/en/latest/GLM/GLM5.html)
* [GLM-5 तकनीकी ब्लॉग](https://z.ai/blog/glm-5)
* [Slime RL इन्फ्रास्ट्रक्चर](https://github.com/THUDM/slime)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-hi/language-models/glm5.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
