Merge pull request #12549 from ulagbulag/fix/500-when-unknown-models

fix: internal server error when calling completions API with non-existent model names
This commit is contained in:
Timothy Jaeryang Baek 2025-04-07 00:58:02 -07:00 committed by GitHub
commit d1a77a9110
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1053,6 +1053,9 @@ async def chat_completion(
model_item = form_data.pop("model_item", {})
tasks = form_data.pop("background_tasks", None)
# placeholder
metadata = {}
try:
if not model_item.get("direct", False):
model_id = form_data.get("model", None)