mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[PR #14017] [MERGED] feat: read max_tokens from model config with fallback to 1000 for title and tag generation #62216
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/14017
Author: @athoik
Created: 5/18/2025
Status: ✅ Merged
Merged: 5/18/2025
Merged by: @tjbck
Base:
dev← Head:title_tags📝 Commits (1)
eabdd4afeat: read max_tokens from model config with fallback to 1000 for title and tag generation📊 Changes
1 file changed (+6 additions, -2 deletions)
View changed files
📝
backend/open_webui/routers/tasks.py(+6 -2)📄 Description
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:
devbranch.Changelog Entry
Improves title and tag generation by using the max_tokens value from the model configuration when available, with a fallback to the previous default of 1000.
Description
This change is necessary for models like Gemini Pro that generate longer responses and require a higher token limit to successfully generate titles or tags.
Breaking Changes
Additional Information
The request looks more or less like that:
The response:
Causing the followng exception:
Reading the max_tokens from model (eg 16384), title and tags generation works fine!
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.