Skip to content

Thinking settings tweaks#1200

Merged
cte merged 3 commits intomainfrom
cte/thinking-tweaks
Feb 26, 2025
Merged

Thinking settings tweaks#1200
cte merged 3 commits intomainfrom
cte/thinking-tweaks

Conversation

@cte
Copy link
Copy Markdown
Collaborator

@cte cte commented Feb 25, 2025

Description

  • Use the thinking params that OpenRouter is temporarily supporting
  • Break Claude 3.7 Sonnet out into two separate models for the Anthropic provider
  • Get rid of the "Thinking" checkbox, and always show the Thinking Budget for thinking models
Screenshot 2025-02-25 at 3 47 42 PM

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

Support 'thinking' params for OpenRouter, split Claude 3.7 Sonnet into two models, and always show Thinking Budget for thinking models.

  • Behavior:
    • Passes thinking params to OpenRouter in openrouter.ts.
    • Splits claude-3-7-sonnet into two models in anthropic.ts and api.ts.
    • Always displays Thinking Budget slider in ApiOptions.tsx for thinking models.
  • Models:
    • Adds claude-3-7-sonnet:thinking model in api.ts with specific attributes.
  • UI:
    • Removes "Thinking" checkbox in ApiOptions.tsx and directly shows Thinking Budget slider.

This description was created by Ellipsis for 33fd3bd. It will automatically update as commits are pushed.

@cte cte requested a review from mrubens as a code owner February 25, 2025 23:50
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 25, 2025

🦋 Changeset detected

Latest commit: 33fd3bd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
roo-cline Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 25, 2025
type OpenRouterChatCompletionParams = OpenAI.Chat.ChatCompletionCreateParams & {
transforms?: string[]
include_reasoning?: boolean
thinking?: BetaThinkingConfigParam
Copy link
Copy Markdown
Collaborator Author

@cte cte Feb 25, 2025

Choose a reason for hiding this comment

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

Per OpenRouter's Discord, this is supported now. I tested it as well. It defaults to max(min(max_tokens * 0.8, 32000), 1024) if omitted.

@dosubot dosubot bot added the Enhancement New feature or request label Feb 25, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 25, 2025
const maxTokens = this.getModel().info.maxTokens || 8192
let { id: modelId, info: modelInfo } = this.getModel()
const maxTokens = modelInfo.maxTokens || 8192
const budgetTokens = this.options.anthropicThinking ?? Math.min(maxTokens - 1, 8192)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think openrouter had some comment about making this at least 1024 smaller than max tokens

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh I see you mention this below - but maybe want better fallback settings? 🤷

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right - I think you want to allow for non-thinking output tokens. Will fix.

Copy link
Copy Markdown
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Looks good!

I guess the people currently on Anthropic with thinking would lose it temporarily? Not sure if worth trying to handle somehow.

@cte
Copy link
Copy Markdown
Collaborator Author

cte commented Feb 25, 2025

Looks good!

I guess the people currently on Anthropic with thinking would lose it temporarily? Not sure if worth trying to handle somehow.

Yeah - thinking will flip off, but hopefully easy to figure out how to flip it back on, and it will be more consistent with the various routers.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 26, 2025
@cte cte merged commit ebe294b into main Feb 26, 2025
9 checks passed
@cte cte deleted the cte/thinking-tweaks branch February 26, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants