Open
Conversation
添加对智谱 AI GLM 系列模型(如 GLM-5)的支持,使 Conway Automaton
能够使用国产大模型运行。
主要变更:
- types.ts: 新增 openaiApiBaseUrl 配置项
- inference.ts: GLM 模型自动检测和 API 端点适配
- 自动识别 glm-* 模型并路由到 OpenAI 兼容后端
- 适配 GLM Coding Plan 的 /chat/completions 端点
- index.ts: 传递 openaiApiBaseUrl 到推理客户端
- context.ts: 修复 temperature=0 问题(GLM-5 要求 >0)
使用方法:
在 automaton.json 中配置:
{
"openaiApiKey": "your-glm-api-key",
"openaiApiBaseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
"inferenceModel": "glm-5"
}
问题:PR Conway-Research#221 缺少模型注册表修改,导致 GLM-5 不在 STATIC_MODEL_BASELINE 中 解决:添加 GLM-5 到模型基线和 DEFAULT_ROUTING_MATRIX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
本 PR 添加了对智谱 AI GLM 系列模型(如 GLM-5)作为推理后端的支持,使 Conway Automaton 能够使用国产大模型运行。
背景
智谱 AI 的 GLM 系列是中国领先的国产大语言模型,具有以下优势:
技术变更
1. 新增配置项 (
src/types.ts)2. 推理客户端适配 (
src/conway/inference.ts)模型识别:自动检测 GLM 模型并路由到 OpenAI 兼容后端
API 端点适配:GLM Coding Plan 使用
/chat/completions而非标准 OpenAI 的/v1/chat/completions自定义 API URL 支持:
3. 上下文温度修复 (
src/agent/context.ts)GLM-5 要求
temperature在开区间 (0, 1) 内,不能为 0:使用方法
在
automaton.json中配置:{ "openaiApiKey": "your-glm-api-key", "openaiApiBaseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", "inferenceModel": "glm-5" }测试
已在生产环境验证:
兼容性
openaiApiBaseUrl配置时启用新功能相关链接