> 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

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

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

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

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

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.0+         | 12.4+         |

**Clore.ai सिफारिश**: अधिकांश उपयोगकर्ताओं के लिए, **GLM-5 तक पहुँच प्राप्त करें API के माध्यम से** (Z.AI, OpenRouter)। स्वयं होस्ट करना केवल तब समझदारी है जब आप 8× H100/H200 किराए पर ले सकें (\~Clore.ai पर \~$24–48/दिन)।

## 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": "You are a helpful assistant."},
        {"role": "user", "content": "Write a Python async web scraper using aiohttp and BeautifulSoup"}
    ],
    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": "Explain the MoE architecture used in GLM-5"}
    ],
    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 GPUs पर 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")

# सोच/थिंकिंग मोड के साथ (डिफ़ॉल्ट)
response = client.chat.completions.create(
    model="glm-5-fp8",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Solve: find all primes p where p^2 + 2 is also prime"}
    ],
    temperature=1.0,
    max_tokens=4096
)
print(response.choices[0].message.content)

# बिना सोच मोड के (तेज़, संक्षिप्त उत्तर)
response = client.chat.completions.create(
    model="glm-5-fp8",
    messages=[
        {"role": "user", "content": "Write a quicksort in Rust"}
    ],
    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 GPUs)
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
# vLLM Docker इमेज जिसमें GLM-5 समर्थन है
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": "City name"}
            }
        }
    }
}]

response = client.chat.completions.create(
    model="glm-5-fp8",
    messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
    tools=tools,
    tool_choice="auto"
)
print(response.choices[0].message.tool_calls)
```

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

* **पहले API, फिर स्वयं-होस्ट**: GLM-5 के लिए 8× H200 की आवश्यकता होती है (\~Clore.ai पर \~$24–48/दिन)। कभी-कभी उपयोग के लिए, Z.AI API या OpenRouter कहीं अधिक किफायती हैं। स्वयं-होस्ट केवल तब करें जब आपको निरंतर थ्रूपुट या डेटा गोपनीयता की जरूरत हो।
* **बिल्कुल GLM-4.7 पर विचार करें**: यदि 8× H200 बहुत अधिक है, तो पूर्ववर्ती GLM-4.7 (355B, 32B सक्रिय) 4× H200 या 4× H100 (\~$12–24/दिन) पर चलता है और अभी भी उत्कृष्ट प्रदर्शन देता है।
* **FP8 वज़न का उपयोग करें**: हमेशा उपयोग करें `zai-org/GLM-5-FP8` — BF16 के समान गुणवत्ता पर लेकिन लगभग आधा मेमोरी फुटप्रिंट। BF16 संस्करण के लिए 16× GPUs की आवश्यकता होती है।
* **VRAM उपयोग की निगरानी करें**: `watch nvidia-smi` — लंबी संदर्भ क्वेरी मेमोरी को अचानक बढ़ा सकती हैं। सेट करें `--gpu-memory-utilization 0.85` ताकि हेडरूम छोड़ा जा सके।
* **थिंकिंग मोड का ट्रेडऑफ़**: थिंकिंग मोड जटिल कार्यों के लिए बेहतर परिणाम देता है लेकिन अधिक टोकन और समय लेता है। सरल प्रश्नों के लिए इसे अक्षम करें with `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 आवश्यक है। इंस्टॉल करें via `pip install -U vllm --pre`.                    |
| टूल कॉल काम नहीं कर रहे         | जोड़ें `--tool-call-parser glm47 --enable-auto-tool-choice` सेवार्थ कमांड चलाने के लिए।               |
| DeepGEMM त्रुटियाँ              | FP8 के लिए DeepGEMM इंस्टॉल करें: उपयोग करें `install_deepgemm.sh` स्क्रिप्ट vLLM रेपो से।            |
| थिंकिंग मोड आउटपुट खाली         | सेट करें `temperature=1.0` — थिंकिंग मोड के लिए गैर-शून्य तापमान आवश्यक है।                           |

## अधिक पढ़ने के लिए

* [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.
