Skip to content

Conversation

@AnotiaWang
Copy link
Contributor

@AnotiaWang AnotiaWang commented Sep 16, 2025

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • โœจ feat
  • ๐Ÿ› fix
  • โ™ป๏ธ refactor
  • ๐Ÿ’„ style
  • ๐Ÿ‘ท build
  • โšก๏ธ perf
  • โœ… test
  • ๐Ÿ“ docs
  • ๐Ÿ”จ chore

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

ๆ”น่ฟ› SiliconCloud ็š„ model-runtime ๅฎž็Žฐ๏ผŒๆ”ฏๆŒ้…็ฝฎๆ›ดๅคšๆจกๅž‹็š„ๆ€่€ƒๅผ€ๅ…ณๅ’Œ thinking budgetใ€‚

ๆ”ฏๆŒๅฟซๆ…ขๆ€่€ƒ็š„ๆจกๅž‹๏ผš
image

ไป…ๆ”ฏๆŒๆ…ขๆ€่€ƒ็š„ๆจกๅž‹๏ผš
image

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

Summary by Sourcery

Enable advanced reasoning controls for SiliconCloud models by exposing reasoningBudgetToken and enableReasoning settings in model definitions and updating the runtime provider to apply and validate these parameters dynamically.

New Features:

  • Expose reasoningBudgetToken and enableReasoning as configurable extendParams in SiliconCloud model cards

Enhancements:

  • Refactor model-runtime logic to dynamically assign enable_thinking and thinking_budget based on model patterns with proper bounds checking

@vercel
Copy link

vercel bot commented Sep 16, 2025

@AnotiaWang is attempting to deploy a commit to the LobeHub Community Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 16, 2025
@lobehubbot
Copy link
Member

๐Ÿ‘ @AnotiaWang

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚
ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 16, 2025

Reviewer's Guide

Updates SiliconCloud model configurations to support reasoning toggles and budget parameters in model definitions, and refactors the runtime provider to dynamically apply and clamp thinking settings based on model patterns.

Class diagram for updated SiliconCloud model configuration

classDiagram
class AIChatModelCard {
  releasedAt: string
  settings: object
  type: string
}
class Settings {
  extendParams: string[]
}
AIChatModelCard --> Settings : has
Settings : extendParams = ["enableReasoning", "reasoningBudgetToken"]
Loading

Class diagram for SiliconCloud runtime provider changes

classDiagram
class LobeSiliconCloudAI {
  createOpenAICompatibleRuntime()
}
LobeSiliconCloudAI : - thinkingBudget
LobeSiliconCloudAI : - hybridThinkingModels
LobeSiliconCloudAI : + enable_thinking
LobeSiliconCloudAI : + thinking_budget
LobeSiliconCloudAI : + max_tokens
LobeSiliconCloudAI : + model
Loading

Flow diagram for dynamic thinking settings in SiliconCloud runtime

flowchart TD
    A["Input: model, thinking, max_tokens, rest"] --> B["Determine thinkingBudget"]
    B --> C["Create result object with rest, max_tokens, model"]
    C --> D{"Is thinking defined?"}
    D -- Yes --> E["Check if model matches hybridThinkingModels"]
    E -- Yes --> F["Set enable_thinking based on thinking.type"]
    D -- Yes --> G["If thinkingBudget defined, clamp and set thinking_budget"]
    D -- No --> H["Return result"]
    F --> G
    G --> H
    D -- No --> H
Loading

File-Level Changes

Change Details Files
Add reasoning configuration options to AI model cards
  • Insert settings.extendParams with reasoningBudgetToken for chat models
  • Enable enableReasoning flag in settings for select models
packages/model-bank/src/aiModels/siliconcloud.ts
Refactor thinking parameter handling in runtime provider
  • Replace inline conditional with result builder and remove hard-coded model checks
  • Introduce hybridThinkingModels regex list for selective enable_thinking support
  • Clamp thinking_budget to valid range and assign enable_thinking based on type
packages/model-runtime/src/providers/siliconcloud/index.ts

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gru-agent
Copy link
Contributor

gru-agent bot commented Sep 16, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 81deafc ๐Ÿšซ Skipped No files need to be tested {"packages/model-bank/src/aiModels/siliconcloud.ts":"source code too long","packages/model-runtime/src/providers/siliconcloud/index.ts":"Can not find valuable test target.\nLobeSiliconCloudAI: Out of scope - This exported constant is created via a factory function and represents a runtime object for a model provider. It does not export any functions or classes directly, and its internal logic is more suitable for integration testing rather than unit testing."}

History Assignment

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@dosubot dosubot bot added the ๐Ÿ’„ Design Design and style issues label Sep 16, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `packages/model-runtime/src/providers/siliconcloud/index.ts:61-62` </location>
<code_context>
+          /DeepSeek-V3\.1/,
+          /Hunyuan-A13B-Instruct/,
+        ];
+        if (hybridThinkingModels.some((regexp) => regexp.test(model))) {
+          result.enable_thinking = thinking.type === 'enabled';
+        }
+        if (typeof thinkingBudget !== 'undefined') {
</code_context>

<issue_to_address>
**issue:** Potential case sensitivity issue in model matching.

Consider normalizing the model string or using case-insensitive regexes to prevent mismatches due to case sensitivity.
</issue_to_address>

### Comment 2
<location> `packages/model-bank/src/aiModels/siliconcloud.ts:87-88` </location>
<code_context>
       ],
     },
     releasedAt: '2025-08-20',
+    settings: {
+      extendParams: ['reasoningBudgetToken'],
+    },
     type: 'chat',
</code_context>

<issue_to_address>
**question:** Inconsistent extendParams for similar models.

If the difference in extendParams is intentional, please document the reasoning to help future maintainers.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them โœจ
Help me be more useful! Please click ๐Ÿ‘ or ๐Ÿ‘Ž on each comment and I'll use the feedback to improve your reviews.

Comment on lines +61 to +62
if (hybridThinkingModels.some((regexp) => regexp.test(model))) {
result.enable_thinking = thinking.type === 'enabled';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Potential case sensitivity issue in model matching.

Consider normalizing the model string or using case-insensitive regexes to prevent mismatches due to case sensitivity.

Comment on lines +87 to +88
settings: {
extendParams: ['reasoningBudgetToken'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Inconsistent extendParams for similar models.

If the difference in extendParams is intentional, please document the reasoning to help future maintainers.

@codecov
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

โŒ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.
โœ… Project coverage is 79.80%. Comparing base (28f84d5) to head (81deafc).
โš ๏ธ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9287      +/-   ##
==========================================
- Coverage   79.81%   79.80%   -0.01%     
==========================================
  Files         819      819              
  Lines       52930    52936       +6     
  Branches     5482     5482              
==========================================
  Hits        42246    42246              
- Misses      10684    10690       +6     
Flag Coverage ฮ”
app 78.15% <รธ> (รธ)
database 98.29% <รธ> (รธ)
packages/agent-runtime 62.53% <รธ> (รธ)
packages/context-engine 62.29% <รธ> (รธ)
packages/electron-server-ipc 93.76% <รธ> (รธ)
packages/file-loaders 88.00% <รธ> (รธ)
packages/model-bank 100.00% <รธ> (รธ)
packages/model-runtime 77.37% <0.00%> (-0.06%) โฌ‡๏ธ
packages/prompts 100.00% <รธ> (รธ)
packages/utils 94.92% <รธ> (รธ)
packages/web-crawler 97.07% <รธ> (รธ)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage ฮ”
Store 71.97% <รธ> (รธ)
Services 62.39% <รธ> (รธ)
Server 65.14% <รธ> (รธ)
Libs 51.60% <รธ> (รธ)
Utils 75.00% <รธ> (รธ)
๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • ๐Ÿ“ฆ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vercel
Copy link

vercel bot commented Sep 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lobe-chat-preview Ready Ready Preview Comment Sep 16, 2025 11:07am

@arvinxx arvinxx merged commit b47bb5b into lobehub:main Sep 16, 2025
43 of 46 checks passed
@lobehubbot
Copy link
Member

โค๏ธ Great PR @AnotiaWang โค๏ธ

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.
้กน็›ฎ็š„ๆˆ้•ฟ็ฆปไธๅผ€็”จๆˆทๅ้ฆˆๅ’Œ่ดก็Œฎ๏ผŒๆ„Ÿ่ฐขๆ‚จ็š„่ดก็Œฎ! ๅฆ‚ๆžœๆ‚จๅฏน LobeHub ๅผ€ๅ‘่€…็คพๅŒบๆ„Ÿๅ…ด่ถฃ๏ผŒ่ฏทๅŠ ๅ…ฅๆˆ‘ไปฌ็š„ discord๏ผŒ็„ถๅŽ็งไฟก @arvinxx ๆˆ– @canisminor1990ใ€‚ไป–ไปฌไผš้‚€่ฏทๆ‚จๅŠ ๅ…ฅๆˆ‘ไปฌ็š„็งๅฏ†ๅผ€ๅ‘่€…้ข‘้“ใ€‚ๆˆ‘ไปฌๅฐ†ไผš่ฎจ่ฎบๅ…ณไบŽ Lobe Chat ็š„ๅผ€ๅ‘๏ผŒๅˆ†ไบซๅ’Œ่ฎจ่ฎบๅ…จ็ƒ่Œƒๅ›ดๅ†…็š„ AI ๆถˆๆฏใ€‚

lobehubbot pushed a commit that referenced this pull request Sep 16, 2025
### [Version&nbsp;1.129.1](v1.129.0...v1.129.1)
<sup>Released on **2025-09-16**</sup>

#### โ™ป Code Refactoring

- **misc**: Improve db sql performance.

#### ๐Ÿ’„ Styles

- **misc**: Update SiliconCloud reasoning models.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

* **misc**: Improve db sql performance, closes [#9283](#9283) ([cee555a](cee555a))

#### Styles

* **misc**: Update SiliconCloud reasoning models, closes [#9287](#9287) ([b47bb5b](b47bb5b))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

๐ŸŽ‰ This PR is included in version 1.129.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

JamieStivala pushed a commit to jaworldwideorg/OneJA-Bot that referenced this pull request Sep 17, 2025
## [Version&nbsp;1.127.0](v1.126.0...v1.127.0)
<sup>Released on **2025-09-17**</sup>

#### โ™ป Code Refactoring

- **misc**: Improve db sql performance, refactor message proccesser to the context engine.

#### โœจ Features

- **misc**: Support Vercel AI Gateway provider.

#### ๐Ÿ› Bug Fixes

- **misc**: Add qwen provider support for image-edit model, fix azure ai runtime error, fix open chat page with float link modal, Google stream error unable to abort request, improve db migrations sql.

#### ๐Ÿ’„ Styles

- **misc**: Enable toggling search on/off via search button click & historyCount button, fix discover plugin link, improve error handle with agent config, support `.doc` file parse, update i18n, update i18n, update i18n, Update model configs, update SiliconCloud reasoning models.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

* **misc**: Improve db sql performance, closes [lobehub#9283](https://github.com/jaworldwideorg/OneJA-Bot/issues/9283) ([cee555a](cee555a))
* **misc**: Refactor message proccesser to the context engine, closes [lobehub#9230](https://github.com/jaworldwideorg/OneJA-Bot/issues/9230) ([dacfffd](dacfffd))

#### What's improved

* **misc**: Support Vercel AI Gateway provider, closes [lobehub#8883](https://github.com/jaworldwideorg/OneJA-Bot/issues/8883) ([5a4b0fd](5a4b0fd))

#### What's fixed

* **misc**: Add qwen provider support for image-edit model, closes [lobehub#9277](https://github.com/jaworldwideorg/OneJA-Bot/issues/9277) [lobehub#9184](https://github.com/jaworldwideorg/OneJA-Bot/issues/9184) ([e137b33](e137b33))
* **misc**: Fix azure ai runtime error, closes [lobehub#9276](https://github.com/jaworldwideorg/OneJA-Bot/issues/9276) ([c21c14e](c21c14e))
* **misc**: Fix open chat page with float link modal, closes [lobehub#9235](https://github.com/jaworldwideorg/OneJA-Bot/issues/9235) ([2c677e5](2c677e5))
* **misc**: Google stream error unable to abort request, closes [lobehub#9180](https://github.com/jaworldwideorg/OneJA-Bot/issues/9180) ([78eaead](78eaead))
* **misc**: Improve db migrations sql, closes [lobehub#9295](https://github.com/jaworldwideorg/OneJA-Bot/issues/9295) ([96ff5aa](96ff5aa))

#### Styles

* **misc**: Enable toggling search on/off via search button click & historyCount button, closes [lobehub#9173](https://github.com/jaworldwideorg/OneJA-Bot/issues/9173) ([240c7b7](240c7b7))
* **misc**: Fix discover plugin link, closes [lobehub#9240](https://github.com/jaworldwideorg/OneJA-Bot/issues/9240) ([cfb2246](cfb2246))
* **misc**: Improve error handle with agent config, closes [lobehub#9263](https://github.com/jaworldwideorg/OneJA-Bot/issues/9263) ([6656217](6656217))
* **misc**: Support `.doc` file parse, closes [lobehub#8182](https://github.com/jaworldwideorg/OneJA-Bot/issues/8182) ([ed42753](ed42753))
* **misc**: Update i18n, closes [lobehub#9294](https://github.com/jaworldwideorg/OneJA-Bot/issues/9294) ([c018f3d](c018f3d))
* **misc**: Update i18n, closes [lobehub#9243](https://github.com/jaworldwideorg/OneJA-Bot/issues/9243) ([04764ad](04764ad))
* **misc**: Update i18n, closes [lobehub#9237](https://github.com/jaworldwideorg/OneJA-Bot/issues/9237) ([642dc3b](642dc3b))
* **misc**: Update model configs, closes [lobehub#9170](https://github.com/jaworldwideorg/OneJA-Bot/issues/9170) ([f89b730](f89b730))
* **misc**: Update SiliconCloud reasoning models, closes [lobehub#9287](https://github.com/jaworldwideorg/OneJA-Bot/issues/9287) ([b47bb5b](b47bb5b))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

๐Ÿ’„ Design Design and style issues released size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants