mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #12549] [MERGED] fix: internal server error when calling completions API with non-existent model names #46013
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/12549
Author: @HoKim98
Created: 4/7/2025
Status: ✅ Merged
Merged: 4/7/2025
Merged by: @tjbck
Base:
dev← Head:fix/500-when-unknown-models📝 Commits (1)
1efae95fix: internal server error when calling completions API with non-existent model names📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
backend/open_webui/main.py(+3 -0)📄 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
Description
metadatavariable is not declared when a 'Model not found' error occurs. However, the code intended to return a 400 error explicitly references the unboundedmetadatavariable. Due to their absence, a 500 error resulted instead. To address this, I have pre-declared the metadata variable as a placeholder and implemented validation of the value within the process intended to utilize them. No side effects occur.Fixed
Additional Information
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.