β¨ feat: add GLM-5.1 model and fix KimiCodingPlan issues#13700
Conversation
- Change model id from 'k2p5' to 'kimi-k2.5' to match Moonshot icon keywords - Add deploymentName 'k2p5' for API calls to use original model name - Add KimiCodingPlan to providersWithDeploymentName list This allows the model icon to display correctly while maintaining backward compatibility with the API using the original 'k2p5' name.
Add message normalization for Kimi K2.5 and K2 Thinking models to ensure every assistant message has a thinking block when thinking is enabled. This fixes the issue where regenerating with KimiCodingPlan after using other providers would fail with "thinking is enabled but reasoning_content is missing" error, because historical messages from other providers don't have reasoning fields. The normalization adds a placeholder thinking block when: 1. Thinking is enabled for Kimi K2.5/K2 Thinking models 2. Assistant message doesn't have reasoning content
Add GLM-5.1 (Pro) model configuration with: - 198K context window - Function call and reasoning capabilities - Tiered pricing (0-32k / 32k+) - reasoningBudgetToken32k extension parameter
|
@hardy-one is attempting to deploy a commit to the LobeHub OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
@sxjeru - This PR adds GLM-5.1 model support for SiliconCloud and fixes KimiCodingPlan model provider issues (icon display and message normalization). Please take a look. |
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #13700 +/- ##
==========================================
+ Coverage 66.64% 66.68% +0.03%
==========================================
Files 1998 1998
Lines 169037 169089 +52
Branches 16411 20421 +4010
==========================================
+ Hits 112659 112754 +95
+ Misses 56255 56212 -43
Partials 123 123
Flags with carried forward coverage won't be shown. Click here to find out more.
π New features to boost your workflow:
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f0ad2e344
βΉοΈ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Replace getModelPropertyWithFallback with a simple hardcoded mapping to fix
the issue where max_tokens lookup fails when using deploymentName (k2p5).
The model id is converted to deploymentName in ChatService layer before
reaching the provider, causing getModelPropertyWithFallback('k2p5', ...) to
fail since the model card uses id 'kimi-k2.5'.
By using a hardcoded mapping that supports both model id and deploymentName,
we avoid the lookup issue while keeping the code simple (KimiCodingPlan only
has a few models).
Add comprehensive tests for KimiCodingPlan provider covering: - Hardcoded maxOutput mapping for k2p5, kimi-k2.5, kimi-k2-thinking - Thinking parameter handling for kimi-k2.5 and kimi-k2-thinking models - Message normalization with forceThinking for assistant messages - Tool calls with reasoning content to prevent API error
Add comprehensive tests for KimiCodingPlan provider covering: - Hardcoded maxOutput mapping for k2p5, kimi-k2.5, kimi-k2-thinking - Thinking parameter handling for kimi-k2.5 and kimi-k2-thinking models - Message normalization with forceThinking for assistant messages - Tool calls with reasoning content to prevent API error
|
β€οΈ Great PR @hardy-one β€οΈ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
|
Maybe we can update packages/model-bank/src/aiModels/zhipu.ts by the way. |
π» Change Type
π Related Issue
π Description of Change
feat(siliconcloud): add GLM-5.1 model support - Add GLM-5.1 (Pro) model with 198K context window, function call and reasoning capabilities, tiered pricing (0-32k / 32k+).
fix: fix Kimi K2.5 model icon display - Change model id from 'k2p5' to 'kimi-k2.5' to match Moonshot icon keywords, while using deploymentName 'k2p5' for API calls.
fix: normalize messages for KimiCodingPlan thinking models - Add message normalization for Kimi K2.5 and K2 Thinking models to fix "thinking is enabled but reasoning_content is missing" error when regenerating after using other providers.
π§ͺ How to Test
πΈ Screenshots / Videos
π Additional Information