fix(ui): update max_tokens input minimum from -2 to 1
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
Target branch: Verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: No documentation updates required.
Dependencies: No new dependencies added.
Testing: Manually tested to confirm correct slider and input behavior.
Agentic AI Code: This PR has been manually written and reviewed.
Code review: Performed self-review to ensure code consistency.
Title Prefix: Verified correct fix prefix.
Changelog Entry
Description
Updated the max_tokens input component to prevent invalid negative values.
Previously, the minimum value was set to -2, which is not supported by any LLM model.
This change updates it to 1 to ensure consistency and proper validation across the UI.
Added
N/A
Changed
Updated the min attribute of the max_tokens range and number input from -2 to 1.
Deprecated
N/A
Removed
N/A
Fixed
Prevented users from setting invalid negative max_tokens values.
Security
N/A
Breaking Changes
None
Additional Information
This fix improves user experience by aligning UI behavior with valid model parameter limits.
Manually verified in the parameter panel to confirm correct input range behavior.
Screenshots or Videos
(Optional — include if you want)
Before: slider allowed -2
After: minimum value starts at 1
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/18436
**Author:** [@acwoo97](https://github.com/acwoo97)
**Created:** 10/20/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `feat/max-token`
---
### 📝 Commits (1)
- [`8c7f205`](https://github.com/open-webui/open-webui/commit/8c7f2052210bdfdf26d573c2623ffbcf54466151) fix: update max_tokens input minimum from -2 to 1
### 📊 Changes
**1 file changed** (+2 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte` (+2 -2)
</details>
### 📄 Description
# fix(ui): update `max_tokens` input minimum from -2 to 1
# Pull Request Checklist
### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request.
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [ ] **Documentation:** No documentation updates required.
- [ ] **Dependencies:** No new dependencies added.
- [x] **Testing:** Manually tested to confirm correct slider and input behavior.
- [x] **Agentic AI Code:** This PR has been manually written and reviewed.
- [x] **Code review:** Performed self-review to ensure code consistency.
- [x] **Title Prefix:** Verified correct `fix` prefix.
---
# Changelog Entry
### Description
- Updated the `max_tokens` input component to prevent invalid negative values.
- Previously, the minimum value was set to `-2`, which is not supported by any LLM model.
- This change updates it to `1` to ensure consistency and proper validation across the UI.
### Added
- N/A
### Changed
- Updated the `min` attribute of the `max_tokens` range and number input from `-2` to `1`.
### Deprecated
- N/A
### Removed
- N/A
### Fixed
- Prevented users from setting invalid negative `max_tokens` values.
### Security
- N/A
### Breaking Changes
- None
---
### Additional Information
- This fix improves user experience by aligning UI behavior with valid model parameter limits.
- Manually verified in the parameter panel to confirm correct input range behavior.
### Screenshots or Videos
*(Optional — include if you want)*
Before: slider allowed `-2`
After: minimum value starts at `1`
---
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/18436
Author: @acwoo97
Created: 10/20/2025
Status: ❌ Closed
Base:
dev← Head:feat/max-token📝 Commits (1)
8c7f205fix: update max_tokens input minimum from -2 to 1📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte(+2 -2)📄 Description
fix(ui): update
max_tokensinput minimum from -2 to 1Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.fixprefix.Changelog Entry
Description
max_tokensinput component to prevent invalid negative values.-2, which is not supported by any LLM model.1to ensure consistency and proper validation across the UI.Added
Changed
minattribute of themax_tokensrange and number input from-2to1.Deprecated
Removed
Fixed
max_tokensvalues.Security
Breaking Changes
Additional Information
Screenshots or Videos
(Optional — include if you want)
Before: slider allowed
-2After: minimum value starts at
1Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.