From 69e09d9bc76b743108d5fc596afde7316d3500e6 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Wed, 24 Dec 2025 23:46:27 +0800 Subject: [PATCH 1/3] docs(readme): update GLM model version from 4.6 to 4.7 in README and README_CN --- README.md | 2 +- README_CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0122bbe4..b3ce03cb 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ So you can use local or multi-account CLI access with OpenAI(include Responses)/ This project is sponsored by Z.ai, supporting us with their GLM CODING PLAN. -GLM CODING PLAN is a subscription service designed for AI coding, starting at just $3/month. It provides access to their flagship GLM-4.6 model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences. +GLM CODING PLAN is a subscription service designed for AI coding, starting at just $3/month. It provides access to their flagship GLM-4.7 model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences. Get 10% OFF GLM CODING PLAN:https://z.ai/subscribe?ic=8JVLJQFSKB diff --git a/README_CN.md b/README_CN.md index 5d19b986..dacf9b6b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -14,7 +14,7 @@ 本项目由 Z智谱 提供赞助, 他们通过 GLM CODING PLAN 对本项目提供技术支持。 -GLM CODING PLAN 是专为AI编码打造的订阅套餐,每月最低仅需20元,即可在十余款主流AI编码工具如 Claude Code、Cline、Roo Code 中畅享智谱旗舰模型GLM-4.6,为开发者提供顶尖的编码体验。 +GLM CODING PLAN 是专为AI编码打造的订阅套餐,每月最低仅需20元,即可在十余款主流AI编码工具如 Claude Code、Cline、Roo Code 中畅享智谱旗舰模型GLM-4.7,为开发者提供顶尖的编码体验。 智谱AI为本软件提供了特别优惠,使用以下链接购买可以享受九折优惠:https://www.bigmodel.cn/claude-code?ic=RRVJPB5SII From 8e749ac22d358233330f88d466201b510dba9d96 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Wed, 24 Dec 2025 23:59:48 +0800 Subject: [PATCH 2/3] docs(readme): update GLM model version from 4.6 to 4.7 in README and README_CN --- README.md | 2 +- README_CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3ce03cb..fc75e57f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ So you can use local or multi-account CLI access with OpenAI(include Responses)/ ## Sponsor -[![z.ai](https://assets.router-for.me/english.png)](https://z.ai/subscribe?ic=8JVLJQFSKB) +[![z.ai](https://assets.router-for.me/english-4.7.png)](https://z.ai/subscribe?ic=8JVLJQFSKB) This project is sponsored by Z.ai, supporting us with their GLM CODING PLAN. diff --git a/README_CN.md b/README_CN.md index dacf9b6b..dbb9609d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -10,7 +10,7 @@ ## 赞助商 -[![bigmodel.cn](https://assets.router-for.me/chinese.png)](https://www.bigmodel.cn/claude-code?ic=RRVJPB5SII) +[![bigmodel.cn](https://assets.router-for.me/chinese-4.7.png)](https://www.bigmodel.cn/claude-code?ic=RRVJPB5SII) 本项目由 Z智谱 提供赞助, 他们通过 GLM CODING PLAN 对本项目提供技术支持。 From 443c4538bb6b88bfc65ed4ad3a1c8a29e23b8036 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Thu, 25 Dec 2025 21:05:01 +0800 Subject: [PATCH 3/3] feat(config): add `commercial-mode` to optimize HTTP middleware for lower memory usage --- config.example.yaml | 3 +++ internal/api/server.go | 16 +++++++++------- internal/config/config.go | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/config.example.yaml b/config.example.yaml index f6390d2f..f0af19dc 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -39,6 +39,9 @@ api-keys: # Enable debug logging debug: false +# When true, disable high-overhead HTTP middleware features to reduce per-request memory usage under high concurrency. +commercial-mode: false + # When true, write application logs to rotating files instead of stdout logging-to-file: false diff --git a/internal/api/server.go b/internal/api/server.go index 80c30ebc..bd2f55eb 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -209,13 +209,15 @@ func NewServer(cfg *config.Config, authManager *auth.Manager, accessManager *sdk // Resolve logs directory relative to the configuration file directory. var requestLogger logging.RequestLogger var toggle func(bool) - if optionState.requestLoggerFactory != nil { - requestLogger = optionState.requestLoggerFactory(cfg, configFilePath) - } - if requestLogger != nil { - engine.Use(middleware.RequestLoggingMiddleware(requestLogger)) - if setter, ok := requestLogger.(interface{ SetEnabled(bool) }); ok { - toggle = setter.SetEnabled + if !cfg.CommercialMode { + if optionState.requestLoggerFactory != nil { + requestLogger = optionState.requestLoggerFactory(cfg, configFilePath) + } + if requestLogger != nil { + engine.Use(middleware.RequestLoggingMiddleware(requestLogger)) + if setter, ok := requestLogger.(interface{ SetEnabled(bool) }); ok { + toggle = setter.SetEnabled + } } } diff --git a/internal/config/config.go b/internal/config/config.go index bc6ae9d8..1dcac109 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -39,6 +39,9 @@ type Config struct { // Debug enables or disables debug-level logging and other debug features. Debug bool `yaml:"debug" json:"debug"` + // CommercialMode disables high-overhead HTTP middleware features to minimize per-request memory usage. + CommercialMode bool `yaml:"commercial-mode" json:"commercial-mode"` + // LoggingToFile controls whether application logs are written to rotating files or stdout. LoggingToFile bool `yaml:"logging-to-file" json:"logging-to-file"`