Skills2026年4月28日·1 分钟阅读

ChatGLM — Open Bilingual Chat Model by Tsinghua KEG

ChatGLM is a family of open bilingual language models from Tsinghua University that support English and Chinese conversation, code generation, and tool use, with variants optimized for consumer GPU deployment.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
ChatGLM Overview
直接安装命令
npx -y tokrepo@latest install 98bef1e7-42b9-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

ChatGLM is an open-source bilingual (English/Chinese) language model series developed by the KEG Lab at Tsinghua University and Zhipu AI. Built on the General Language Model architecture, it provides competitive chat, reasoning, and code generation capabilities while remaining small enough to run on a single consumer GPU.

What ChatGLM Does

  • Generates fluent bilingual text for conversation, summarization, and translation
  • Supports function calling and tool-use patterns for agent workflows
  • Runs inference in INT4 quantization on GPUs with as little as 6 GB VRAM
  • Provides a web demo and CLI for interactive chat out of the box
  • Serves as a base model for supervised fine-tuning and RLHF

Architecture Overview

ChatGLM uses a prefix-decoder transformer with rotary position embeddings and multi-query attention. The model is pre-trained on a balanced English-Chinese corpus and aligned via RLHF. Later versions (GLM-4) add a longer context window and vision capabilities. Quantized variants use GPTQ or native INT4 weight compression to reduce memory requirements.

Self-Hosting & Configuration

  • Clone the repo and install dependencies with pip install -r requirements.txt
  • Download weights from Hugging Face Hub or the Tsinghua mirror
  • Launch a Gradio web demo with python web_demo.py or CLI chat with python cli_demo.py
  • INT4 quantization is enabled by loading with AutoModel.from_pretrained(...).quantize(4)
  • Deploy as an OpenAI-compatible API server using the included openai_api.py script

Key Features

  • Strong bilingual performance in both English and Chinese
  • Runs on consumer hardware with INT4 quantization (6 GB VRAM for 6B model)
  • OpenAI-compatible API server included for drop-in integration
  • Supports P-Tuning v2 and LoRA for efficient domain adaptation
  • Active model family with regular upgrades (GLM-2, GLM-3, GLM-4)

Comparison with Similar Tools

  • LLaMA — English-centric; stronger ecosystem but weaker Chinese support
  • Qwen — Alibaba bilingual model; similar size range with different architecture
  • Baichuan — another Chinese-first LLM; focuses on longer context
  • Yi — 01.AI bilingual model; newer with different training data mix
  • Mistral — high performance per parameter; English-only

FAQ

Q: Which ChatGLM version should I use? A: Use the latest available version (GLM-4 or ChatGLM3-6B) for the best performance. Older versions remain available for reproducibility.

Q: Can I fine-tune ChatGLM on my own data? A: Yes. The repository includes P-Tuning v2 scripts, and the model works with standard LoRA tools like PEFT and LLaMA-Factory.

Q: Is it suitable for production APIs? A: The included OpenAI-compatible server works for moderate traffic. For high-throughput serving, use vLLM or TGI with the ChatGLM model.

Q: What license governs commercial use? A: ChatGLM models are released under a custom license that permits commercial use with attribution. Check the specific model card for details.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产