-
Notifications
You must be signed in to change notification settings - Fork 234
Enable/Disable thinking on reasoning models #1768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR introduces a new “thinking” flag throughout the stack to control reasoning-mode behavior, wiring it from default configuration into the CLI, propagating it into the model invocation (by setting a zero reasoning budget when disabled), and updating tests and documentation accordingly. Sequence diagram for CLI propagation of the 'thinking' flag to model invocationsequenceDiagram
actor User
participant CLI as CLI (ramalama/cli.py)
participant Config as BaseConfig
participant Model as llama_serve (ramalama/model.py)
User->>CLI: run command with --thinking flag
CLI->>Config: Read default thinking value
CLI->>Model: Call llama_serve(args)
Model->>Model: if not args.thinking, add --reasoning-budget 0
Model-->>CLI: Model invoked with/without reasoning budget
Class diagram for updated configuration and CLI argument handlingclassDiagram
class BaseConfig {
+bool thinking = True
...
}
class RamalamaSettings {
...
}
class UserConfig {
...
}
BaseConfig --> RamalamaSettings : settings
BaseConfig --> UserConfig : user
class CoerceToBool {
...
}
class argparse.ArgumentParser {
add_argument()
...
}
argparse.ArgumentParser <.. CoerceToBool : uses
argparse.ArgumentParser <.. BaseConfig : uses (default)
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @rhatdan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new capability to explicitly enable or disable a 'thinking mode' for reasoning models within the ramalama
application. This provides users with more granular control over model behavior, allowing them to optimize for either deterministic or more exploratory outputs. The changes involve updates to the command-line interface, configuration files, core model execution logic, and comprehensive documentation.
Highlights
- New Command-Line Option: Introduced a new
--thinking
command-line option forramalama
commands (bench
,perplexity
,run
,serve
) to control the 'thinking mode' of reasoning models. This option defaults toTrue
. - Configuration Support: Added a
thinking
configuration option toramalama.conf
and its corresponding documentation, allowing users to set the default behavior for thinking mode. - Model Execution Logic: Implemented logic within
ramalama/model.py
to translate--thinking False
into the--reasoning-budget 0
argument for the underlyingllama_serve
process, effectively disabling the model's reasoning budget. - System Tests: Added new system tests in
test/system/040-serve.bats
to verify that the--thinking
option correctly influences the arguments passed to the model runtime, ensuring the feature behaves as expected.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a --thinking
flag to enable or disable "thinking mode" in reasoning models, which translates to setting the --reasoning-budget
. The changes include adding the command-line argument, configuration option, implementation logic, tests, and documentation updates.
My review focuses on improving the clarity of the new option for users. The descriptions in the documentation and help texts are a bit vague, and I've suggested more descriptive text. I also found a minor formatting issue.
docs/ramalama-bench.1.md
Outdated
#### **--thinking**=*true* | ||
Enable thinking mode in reasoning models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the --thinking
flag is a bit vague. To improve clarity for users, consider explaining what "thinking mode" entails or what happens when it's disabled. Based on the implementation, disabling it sets the --reasoning-budget
to 0.
#### **--thinking**=*true* | |
Enable thinking mode in reasoning models | |
#### **--thinking**=*true* | |
Enable or disable thinking mode in reasoning models. When disabled, this sets the reasoning budget to 0. |
docs/ramalama-perplexity.1.md
Outdated
#### **--thinking**=*true* | ||
Enable thinking mode in reasoning models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the --thinking
flag is a bit vague. To improve clarity for users, consider explaining what "thinking mode" entails or what happens when it's disabled. Based on the implementation, disabling it sets the --reasoning-budget
to 0.
#### **--thinking**=*true* | |
Enable thinking mode in reasoning models | |
#### **--thinking**=*true* | |
Enable or disable thinking mode in reasoning models. When disabled, this sets the reasoning budget to 0. |
docs/ramalama-run.1.md
Outdated
#### **--thinking**=*true* | ||
Enable thinking mode in reasoning models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the --thinking
flag is a bit vague. To improve clarity for users, please consider explaining what "thinking mode" entails or what happens when it's disabled. Based on the implementation, disabling it sets the --reasoning-budget
to 0.
#### **--thinking**=*true* | |
Enable thinking mode in reasoning models | |
#### **--thinking**=*true* | |
Enable or disable thinking mode in reasoning models. When disabled, this sets the reasoning budget to 0. |
docs/ramalama-serve.1.md
Outdated
#### **--thinking**=*true* | ||
Enable thinking mode in reasoning models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the --thinking
flag is a bit vague. To improve clarity for users, please consider explaining what "thinking mode" entails or what happens when it's disabled. Based on the implementation, disabling it sets the --reasoning-budget
to 0.
#### **--thinking**=*true* | |
Enable thinking mode in reasoning models | |
#### **--thinking**=*true* | |
Enable or disable thinking mode in reasoning models. When disabled, this sets the reasoning budget to 0. |
# Enable thinking mode on reasoning models | ||
# | ||
#thinking = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the thinking
option is a bit vague. To improve clarity for users, please consider explaining what "thinking mode" entails or what happens when it's disabled. Based on the implementation, disabling it sets the --reasoning-budget
to 0.
# Enable thinking mode on reasoning models
#
#thinking = true
# Enable or disable thinking mode on reasoning models. When disabled, this sets the reasoning budget to 0.
**thinking**=true | ||
|
||
Enable thinking mode on reasoning models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the thinking
option is a bit vague. To improve clarity for users, please consider explaining what "thinking mode" entails or what happens when it's disabled. Based on the implementation, disabling it sets the --reasoning-budget
to 0.
**thinking**=true | |
Enable thinking mode on reasoning models | |
**thinking**=true | |
Enable or disable thinking mode on reasoning models. When disabled, this sets the reasoning budget to 0. |
default=CONFIG.thinking, | ||
help="enable/disable thinking mode in reasoning models", | ||
action=CoerceToBool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text for --thinking
is a bit vague. To improve clarity for users, please consider explaining what "thinking mode" entails or what happens when it's disabled. Based on the implementation, disabling it sets the --reasoning-budget
to 0.
default=CONFIG.thinking, | |
help="enable/disable thinking mode in reasoning models", | |
action=CoerceToBool, | |
help="enable/disable thinking mode in reasoning models. When disabled, this sets the reasoning budget to 0.", |
ramalama/cli.py
Outdated
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e3831fc
to
4baba11
Compare
Fixes: containers#1509 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: #1509
Summary by Sourcery
Add support for toggling thinking mode in reasoning models via a new CLI flag and configuration setting, defaulting to enabled and mapping disabled mode to a zero reasoning budget
New Features:
Enhancements:
Documentation:
Tests: