zai-org / glm-4-9b-hf

huggingface.co
Total runs: 1.9K
24-hour runs: 0
7-day runs: -70
30-day runs: -8.5K
Model's Last Updated: January 27 2025
text-generation

Introduction of glm-4-9b-hf

Model Details of glm-4-9b-hf

glm-4-9b-hf

请阅读 中文版本 .

If you are using the weights from this repository, please update to

transformers>=4.46.0

These weights are not compatible with older versions of the transformers library.

Model Introduction

GLM-4-9B is the open-source version of the latest generation of pre-trained models in the GLM-4 series launched by Zhipu AI. In the evaluation of data sets in semantics, mathematics, reasoning, code, and knowledge, GLM-4-9B and its human preference-aligned version GLM-4-9B-Chat have shown superior performance beyond Llama-3-8B. In addition to multi-round conversations, GLM-4-9B-Chat also has advanced features such as web browsing, code execution, custom tool calls (Function Call), and long text reasoning (supporting up to 128K context). This generation of models has added multi-language support, supporting 26 languages including Japanese, Korean, and German. We have also launched the GLM-4-9B-Chat-1M model that supports 1M context length (about 2 million Chinese characters) and the multimodal model GLM-4V-9B based on GLM-4-9B. GLM-4V-9B possesses dialogue capabilities in both Chinese and English at a high resolution of 1120*1120. In various multimodal evaluations, including comprehensive abilities in Chinese and English, perception & reasoning, text recognition, and chart understanding, GLM-4V-9B demonstrates superior performance compared to GPT-4-turbo-2024-04-09, Gemini 1.0 Pro, Qwen-VL-Max, and Claude 3 Opus.

We evaluated the GLM-4-9B base model on some typical tasks, and the results are as follows:

Model MMLU C-Eval GPQA GSM8K MATH HumanEval
Llama-3-8B 66.6 51.2 - 45.8 - -
Llama-3-8B-Instruct 68.4 51.3 34.2 79.6 30.0 62.2
ChatGLM3-6B-Base 61.4 69.0 - 72.3 25.7 -
GLM-4-9B 74.7 77.1 34.3 84.0 30.4 70.1

This repository is the base version of GLM-4-9B, supporting 8K context length.

Quick Start

For more inference code and requirements, please visit our github page .

Please strictly follow the dependencies to install, otherwise it will not run properly

Transformers Lib(4.46.0 and later version) for inference:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
import os

os.environ['CUDA_VISIBLE_DEVICES'] = '0' # Set the GPU number. If a single machine has a single card, specify one. If a single machine has multiple cards, specify multiple GPU numbers.

MODEL_PATH = "THUDM/glm-4-9b-hf"

model = AutoModelForCausalLM.from_pretrained(
    MODEL_PATH,
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    trust_remote_code=True,
    device_map="auto"
).eval()
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code=True)

encoding = tokenizer("what is your name?<|endoftext|>")
inputs = {key: torch.tensor([value]).to(device) for key, value in encoding.items()}

gen_kwargs = {"max_length": 2500, "do_sample": True, "top_k": 1}
with torch.no_grad():
    outputs = model.generate(**inputs, **gen_kwargs)
    outputs = outputs[:, inputs['input_ids'].shape[1]:]
    print(tokenizer.decode(outputs[0], skip_special_tokens=True))
LICENSE

The weights of the GLM-4 model are available under the terms of LICENSE .

Citations

If you find our work useful, please consider citing the following paper.

@misc{glm2024chatglm,
      title={ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools}, 
      author={Team GLM and Aohan Zeng and Bin Xu and Bowen Wang and Chenhui Zhang and Da Yin and Diego Rojas and Guanyu Feng and Hanlin Zhao and Hanyu Lai and Hao Yu and Hongning Wang and Jiadai Sun and Jiajie Zhang and Jiale Cheng and Jiayi Gui and Jie Tang and Jing Zhang and Juanzi Li and Lei Zhao and Lindong Wu and Lucen Zhong and Mingdao Liu and Minlie Huang and Peng Zhang and Qinkai Zheng and Rui Lu and Shuaiqi Duan and Shudan Zhang and Shulin Cao and Shuxun Yang and Weng Lam Tam and Wenyi Zhao and Xiao Liu and Xiao Xia and Xiaohan Zhang and Xiaotao Gu and Xin Lv and Xinghan Liu and Xinyi Liu and Xinyue Yang and Xixuan Song and Xunkai Zhang and Yifan An and Yifan Xu and Yilin Niu and Yuantao Yang and Yueyan Li and Yushi Bai and Yuxiao Dong and Zehan Qi and Zhaoyu Wang and Zhen Yang and Zhengxiao Du and Zhenyu Hou and Zihan Wang},
      year={2024},
      eprint={2406.12793},
      archivePrefix={arXiv},
      primaryClass={id='cs.CL' full_name='Computation and Language' is_active=True alt_name='cmp-lg' in_archive='cs' is_general=False description='Covers natural language processing. Roughly includes material in ACM Subject Class I.2.7. Note that work on artificial languages (programming languages, logics, formal systems) that does not explicitly address natural-language issues broadly construed (natural-language processing, computational linguistics, speech, text retrieval, etc.) is not appropriate for this area.'}
}

Runs of zai-org glm-4-9b-hf on huggingface.co

1.9K
Total runs
0
24-hour runs
-43
3-day runs
-70
7-day runs
-8.5K
30-day runs

More Information About glm-4-9b-hf huggingface.co Model

More glm-4-9b-hf license Visit here:

https://choosealicense.com/licenses/glm-4

glm-4-9b-hf huggingface.co

glm-4-9b-hf huggingface.co is an AI model on huggingface.co that provides glm-4-9b-hf's model effect (), which can be used instantly with this zai-org glm-4-9b-hf model. huggingface.co supports a free trial of the glm-4-9b-hf model, and also provides paid use of the glm-4-9b-hf. Support call glm-4-9b-hf model through api, including Node.js, Python, http.

glm-4-9b-hf huggingface.co Url

https://huggingface.co/zai-org/glm-4-9b-hf

zai-org glm-4-9b-hf online free

glm-4-9b-hf huggingface.co is an online trial and call api platform, which integrates glm-4-9b-hf's modeling effects, including api services, and provides a free online trial of glm-4-9b-hf, you can try glm-4-9b-hf online for free by clicking the link below.

zai-org glm-4-9b-hf online free url in huggingface.co:

https://huggingface.co/zai-org/glm-4-9b-hf

glm-4-9b-hf install

glm-4-9b-hf is an open source model from GitHub that offers a free installation service, and any user can find glm-4-9b-hf on GitHub to install. At the same time, huggingface.co provides the effect of glm-4-9b-hf install, users can directly use glm-4-9b-hf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

glm-4-9b-hf install url in huggingface.co:

https://huggingface.co/zai-org/glm-4-9b-hf

Url of glm-4-9b-hf

glm-4-9b-hf huggingface.co Url

Provider of glm-4-9b-hf huggingface.co

zai-org
ORGANIZATIONS

Other API from zai-org

huggingface.co

Total runs: 5.1M
Run Growth: 4.4M
Growth Rate: 89.42%
Updated:September 07 2026
huggingface.co

Total runs: 1.8M
Run Growth: -162.5K
Growth Rate: -8.84%
Updated:September 11 2026
huggingface.co

Total runs: 1.8M
Run Growth: -73.7K
Growth Rate: -4.07%
Updated:January 29 2026
huggingface.co

Total runs: 1.4M
Run Growth: 1.2M
Growth Rate: 89.00%
Updated:September 04 2026
huggingface.co

Total runs: 731.1K
Run Growth: -433.5K
Growth Rate: -57.68%
Updated:September 01 2026
huggingface.co

Total runs: 531.4K
Run Growth: -788.9K
Growth Rate: -143.16%
Updated:September 01 2026
huggingface.co

Total runs: 463.5K
Run Growth: 12.1K
Growth Rate: 2.60%
Updated:August 04 2024
huggingface.co

Total runs: 260.9K
Run Growth: 131.8K
Growth Rate: 53.24%
Updated:August 11 2025
huggingface.co

Total runs: 243.6K
Run Growth: 172.3K
Growth Rate: 71.67%
Updated:August 11 2026
huggingface.co

Total runs: 191.1K
Run Growth: 103.2K
Growth Rate: 54.47%
Updated:May 13 2026
huggingface.co

Total runs: 114.6K
Run Growth: 27.1K
Growth Rate: 24.11%
Updated:August 11 2025
huggingface.co

Total runs: 103.6K
Run Growth: 21.5K
Growth Rate: 20.67%
Updated:December 10 2025
huggingface.co

Total runs: 102.1K
Run Growth: 43.2K
Growth Rate: 39.89%
Updated:January 29 2026
huggingface.co

Total runs: 73.2K
Run Growth: -9.1K
Growth Rate: -11.54%
Updated:March 13 2025
huggingface.co

Total runs: 67.7K
Run Growth: -11.8K
Growth Rate: -17.43%
Updated:December 05 2024
huggingface.co

Total runs: 40.2K
Run Growth: -10.3K
Growth Rate: -25.65%
Updated:October 25 2025
huggingface.co

Total runs: 32.9K
Run Growth: 28.2K
Growth Rate: 85.71%
Updated:September 04 2026
huggingface.co

Total runs: 31.0K
Run Growth: -335.8K
Growth Rate: -757.48%
Updated:April 16 2026
huggingface.co

Total runs: 21.3K
Run Growth: -722.9K
Growth Rate: -3358.46%
Updated:April 05 2026
huggingface.co

Total runs: 20.4K
Run Growth: 4.2K
Growth Rate: 20.47%
Updated:November 23 2024
huggingface.co

Total runs: 17.9K
Run Growth: 2.0K
Growth Rate: 11.48%
Updated:September 30 2025
huggingface.co

Total runs: 17.7K
Run Growth: -3.4K
Growth Rate: -18.93%
Updated:March 03 2025
huggingface.co

Total runs: 17.5K
Run Growth: -3.5K
Growth Rate: -19.96%
Updated:November 23 2024
huggingface.co

Total runs: 16.2K
Run Growth: -12.2K
Growth Rate: -74.40%
Updated:April 14 2025
huggingface.co

Total runs: 14.7K
Run Growth: -5.5K
Growth Rate: -38.16%
Updated:December 23 2025
huggingface.co

Total runs: 12.1K
Run Growth: 7.3K
Growth Rate: 60.24%
Updated:December 09 2025
huggingface.co

Total runs: 7.9K
Run Growth: -3.6K
Growth Rate: -45.36%
Updated:April 22 2025
huggingface.co

Total runs: 7.6K
Run Growth: -1.5K
Growth Rate: -19.53%
Updated:March 11 2025
huggingface.co

Total runs: 7.3K
Run Growth: 932
Growth Rate: 12.91%
Updated:October 16 2025
huggingface.co

Total runs: 6.7K
Run Growth: -2.4K
Growth Rate: -33.85%
Updated:January 15 2026
huggingface.co

Total runs: 3.8K
Run Growth: -306
Growth Rate: -8.33%
Updated:December 09 2025
huggingface.co

Total runs: 2.9K
Run Growth: 1.8K
Growth Rate: 59.64%
Updated:August 12 2025
huggingface.co

Total runs: 2.5K
Run Growth: -281
Growth Rate: -11.43%
Updated:August 04 2024
huggingface.co

Total runs: 2.1K
Run Growth: -803
Growth Rate: -39.54%
Updated:October 25 2025
huggingface.co

Total runs: 983
Run Growth: 666
Growth Rate: 68.87%
Updated:October 20 2023
huggingface.co

Total runs: 486
Run Growth: 227
Growth Rate: 46.71%
Updated:December 10 2024
huggingface.co

Total runs: 459
Run Growth: -269
Growth Rate: -57.11%
Updated:August 11 2025
huggingface.co

Total runs: 444
Run Growth: -97
Growth Rate: -20.12%
Updated:March 02 2023
huggingface.co

Total runs: 392
Run Growth: -1.0K
Growth Rate: -260.97%
Updated:January 02 2025
huggingface.co

Total runs: 387
Run Growth: 142
Growth Rate: 37.47%
Updated:October 25 2025
huggingface.co

Total runs: 326
Run Growth: 30
Growth Rate: 9.46%
Updated:January 13 2026
huggingface.co

Total runs: 230
Run Growth: -47
Growth Rate: -20.43%
Updated:November 20 2023
huggingface.co

Total runs: 228
Run Growth: -4
Growth Rate: -1.85%
Updated:October 20 2023
huggingface.co

Total runs: 227
Run Growth: 7
Growth Rate: 3.24%
Updated:October 20 2023