{"data":{"slug":"zai-org-chatglm2-6b","name":"ChatGLM2-6B","tagline":"An Open Bilingual Chat LLM","github_url":"https://github.com/zai-org/ChatGLM2-6B","owner":"zai-org","repo":"ChatGLM2-6B","owner_avatar_url":"https://avatars.githubusercontent.com/u/223098841?v=4","primary_language":"Python","stars":15540,"forks":1794,"topics":["chatglm","chatglm-6b","large-language-models","llm"],"archived":false,"github_pushed_at":"2024-06-27T04:05:08+00:00","maintenance_label":"Dormant","url":"https://www.graphcanon.com/tools/zai-org-chatglm2-6b","markdown_url":"https://www.graphcanon.com/tools/zai-org-chatglm2-6b.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/zai-org-chatglm2-6b","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=zai-org-chatglm2-6b","description":"ChatGLM2-6B: An Open Bilingual Chat LLM | 开源双语对话语言模型","homepage_url":null,"license":"Other","open_issues":450,"watchers":132,"ai_summary":"ChatGLM2-6B is the second generation of an open-source bilingual chat large language model with enhanced performance, longer context length up to 32K tokens, and more efficient inference.","readme_excerpt":"# ChatGLM2-6B\n\n<p align=\"center\">\n🤗 <a href=\"https://huggingface.co/THUDM/chatglm2-6b\" target=\"_blank\">HF Repo</a> • 🐦 <a href=\"https://twitter.com/thukeg\" target=\"_blank\">Twitter</a> • 📃 <a href=\"https://arxiv.org/abs/2103.10360\" target=\"_blank\">[GLM@ACL 22]</a> <a href=\"https://github.com/THUDM/GLM\" target=\"_blank\">[GitHub]</a> • 📃 <a href=\"https://arxiv.org/abs/2210.02414\" target=\"_blank\">[GLM-130B@ICLR 23]</a> <a href=\"https://github.com/THUDM/GLM-130B\" target=\"_blank\">[GitHub]</a> <br>\n</p>\n<p align=\"center\">\n    👋 加入我们的  <a href=\"https://discord.gg/fK2dz4bg\" target=\"_blank\">Discord</a> 和 <a href=\"resources/WECHAT.md\" target=\"_blank\">WeChat</a>\n</p>\n<p align=\"center\">\n📍在 <a href=\"https://www.chatglm.cn\">chatglm.cn</a> 体验更大规模的 ChatGLM 模型。\n</p>\n\n\n*Read this in [English](README_EN.md)*\n\n## GLM-4 开源模型和API\n\n我们已经发布最新的 **GLM-4** 模型，该模型在多个指标上有了新的突破，您可以在以下两个渠道体验我们的最新模型。\n\n+ [GLM-4 开源模型](https://github.com/THUDM/GLM-4) 我们已经开源了 GLM-4-9B 系列模型，在各项指标的ce是上有明显提升，欢迎尝试。\n+ [智谱清言](https://chatglm.cn/main/detail?fr=ecology_x) 体验最新版 GLM-4，包括 **GLMs，All tools**等功能。\n+ [API平台](https://open.bigmodel.cn/?utm_campaign=open&_channel_track_key=OWTVNma9) 新一代 API 平台已经上线，您可以直接在\n  API\n  平台上体验 `GLM-4-0520`、`GLM-4-air`、`GLM-4-airx`、`GLM-4-flash`、`GLM-4`、`GLM-3-Turbo`、`CharacterGLM-3`，`CogView-3`\n  等新模型。\n  其中`GLM-4`、`GLM-3-Turbo`两个模型支持了 `System Prompt`、`Function Call`、 `Retrieval`、`Web_Search`等新功能，欢迎体验。\n\n+ [GLM-4 API 开源教程](https://github.com/MetaGLM/glm-cookbook/) GLM-4 API教程和基础应用，欢迎尝试。\n  API相关问题可以在本开源教程疑问，或者使用 [GLM-4 API AI助手](https://open.bigmodel.cn/shareapp/v1/?share_code=sQwt5qyqYVaNh1O_87p8O)\n  来获得常见问题的帮助。\n\n-----\n\n## 介绍\n\nChatGLM**2**-6B 是开源中英双语对话模型 [ChatGLM-6B](https://github.com/THUDM/ChatGLM-6B) 的第二代版本，在保留了初代模型对话流畅、部署门槛较低等众多优秀特性的基础之上，ChatGLM**2**-6B 引入了如下新特性：\n\n1. **更强大的性能**：基于 ChatGLM 初代模型的开发经验，我们全面升级了 ChatGLM2-6B 的基座模型。ChatGLM2-6B 使用了 [GLM](https://github.com/THUDM/GLM) 的混合目标函数，经过了 1.4T 中英标识符的预训练与人类偏好对齐训练，[评测结果](#评测结果)显示，相比于初代模型，ChatGLM2-6B 在 MMLU（+23%）、CEval（+33%）、GSM8K（+571%） 、BBH（+60%）等数据集上的性能取得了大幅度的提升，在同尺寸开源模型中具有较强的竞争力。\n2. **更长的上下文**：基于 [FlashAttention](https://github.com/HazyResearch/flash-attention) 技术，我们将基座模型的上下文长度（Context Length）由 ChatGLM-6B 的 2K 扩展到了 32K，并在对话阶段使用 8K 的上下文长度训练。对于更长的上下文，我们发布了 [ChatGLM2-6B-32K](https://huggingface.co/THUDM/chatglm2-6b-32k) 模型。[LongBench](https://github.com/THUDM/LongBench) 的测评结果表明，在等量级的开源模型中，ChatGLM2-6B-32K 有着较为明显的竞争优势。\n3. **更高效的推理**：基于 [Multi-Query Attention](http://arxiv.org/abs/1911.02150) 技术，ChatGLM2-6B 有更高效的推理速度和更低的显存占用：在官方的模型实现下，推理速度相比初代提升了 42%，INT4 量化下，6G 显存支持的对话长度由 1K 提升到了 8K。\n4. **更开放的协议**：ChatGLM2-6B 权重对学术研究**完全开放**，在填写[问卷](https://open.bigmodel.cn/mla/form)进行登记后**亦允许免费商业使用**。\n\n-----\n\nChatGLM2-6B 开源模型旨在与开源社区一起推动大模型技术发展，恳请开发者和大家遵守[开源协议](MODEL_LICENSE)，勿将开源模型和代码及基于开源项目产生的衍生物用于任何可能给国家和社会带来危害的用途以及用于任何未经过安全评估和备案的服务。**目前，本项目团队未基于 ChatGLM2-6B 开发任何应用，包括网页端、安卓、苹果 iOS 及 Windows App 等应用。**\n\n尽管模型在训练的各个阶段都尽力确保数据的合规性和准确性，但由于 ChatGLM2-6B 模型规模较小，且模型受概率随机性因素影响，无法保证输出内容的准确性，且模型易被误导。**本项目不承担开源模型和代码导致的数据安全、舆情风险或发生任何模型被误导、滥用、传播、不当利用而产生的风险和责任。**\n\n## 更新信息\n**[2023/07/31]** 发布 [ChatGLM2-6B-32K](https://huggingface.co/THUDM/chatglm2-6b-32k) 模型，提升对于长文本的理解能力。\n\n**[2023/07/25]** 发布 [CodeGeeX2](https://github.com/THUDM/CodeGeeX2) 模型，基于 ChatGLM2-6B 加入代码预训练实现，代码能力全面提升。\n\n**[2023/07/04]** 发布 P-Tuning v2 与 全参数微调脚本，参见 [P-Tuning](./ptuning)。\n\n## 友情链接\n对 ChatGLM2 进行加速的开源项目：\n* [fastllm](https://github.com/ztxz16/fastllm/): 全平台加速推理方案，单GPU批量推理每秒可达10000+token，手机端最低3G内存实时运行（骁龙865上约4~5 token/s）\n* [chatglm.cpp](https://github.com/li-plus/chatglm.cpp): 类似 llama.cpp 的 CPU 量化加速推理方案，实现 Mac 笔记本上实时对话\n* [ChatGLM2-TPU](https://github.com/sophgo/ChatGLM2-TPU): 采用TPU加速推理方案，在算能端侧芯片BM1684X（16T@FP16，内存16G）上实时运行约5 token/s\n\n基于或使用了 ChatGLM2-6B 的开源项目：\n* [Chuanhu Chat](https://github.com/GaiZhenbiao/ChuanhuChatGPT): 为各个大语言模型和在线模型API提供美观易用、功能丰富、快速部署的用户界面，支持ChatGLM2-6B。\n\n支持 ChatGLM-6B 和相关应用在线训练的示例项目：\n* [ChatGLM2-6B 在腾讯云部署教程](https://cloud.tencent.com/document/product/1721/104848)\n* [ChatGLM2-6B 的部署与微调教程](https://www.heywhale.com/mw/project/64984a7b72ebe240516ae7","github_created_at":"2023-06-24T06:21:34+00:00","created_at":"2026-07-07T17:33:36.20739+00:00","updated_at":"2026-08-01T18:00:32.762056+00:00","categories":[{"slug":"llm-frameworks","name":"LLM Frameworks","url":"https://www.graphcanon.com/categories/llm-frameworks","markdown_url":"https://www.graphcanon.com/categories/llm-frameworks.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/llm-frameworks"}],"tags":[{"slug":"chatglm","name":"chatglm"},{"slug":"chatglm-6b","name":"chatglm-6b"},{"slug":"large-language-models","name":"large language models"},{"slug":"llm","name":"llm"}],"trust":{"provenance":{"is_fork":false,"github_id":657895120,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-01T18:00:32.054Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":765,"last_release_at":null},"security_summary":{"status":"findings","scanner":"osv@v1","low_count":76,"high_count":0,"last_scan_at":"2026-07-11T23:08:48.099Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-01T18:00:32.490Z"},"languages":{"value":["python"],"source":"github.language","observed_at":"2026-08-01T18:00:32.490Z"},"license_spdx":{"value":"Other","source":"github.license","observed_at":"2026-08-01T18:00:32.490Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["For applications needing bilingual support with improved accuracy in MMLU, CEval, GSM8K, BBH datasets.","When a longer context window of up to 32K tokens is required for more comprehensive dialogue or text processing."],"when_not_to_use":["Avoid if the use case does not benefit from bilingual capabilities.","Not suitable for applications that need more than free tier commercial usage without registration through provided survey."],"source":"enrich:decision_facts","observed_at":"2026-07-14T18:18:39.226Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"Open bilingual dialogue model with enhanced performance, longer context length up to 32K tokens, and efficient inference."}]}}