[GH-ISSUE #9402] Hi models with system prompts no longer work via /api/chat/completions in v0.5.9 return Error 400 Bad Request #102483

Closed
opened 2026-05-17 23:48:57 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @spammenotinoz on GitHub (Feb 5, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9402

Hi minor bug in v0.5.9 impacting models with system prompts via API.

Post;
{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
}

Returns:
{
"detail": "'NoneType' object has no attribute 'items'"
}

Workaround: Login to Open-WebUI and clear the system prompt, for impacted models.

Kind regards

Originally created by @spammenotinoz on GitHub (Feb 5, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/9402 Hi minor bug in v0.5.9 impacting models with system prompts via API. Post; { "model": "gpt-4o-mini", "messages": [ { "role": "user", "content": "What is the meaning of life?" } ] } Returns: { "detail": "'NoneType' object has no attribute 'items'" } Workaround: Login to Open-WebUI and clear the system prompt, for impacted models. Kind regards
Author
Owner

@dpk-it commented on GitHub (Feb 5, 2025):

I have the same issue

<!-- gh-comment-id:2637260334 --> @dpk-it commented on GitHub (Feb 5, 2025): I have the same issue
Author
Owner

@Yppiti commented on GitHub (Feb 5, 2025):

+1 for having this same issue. Removing the system prompt fixes this but defeats the purpose of using a custom model. No form of "refreshing" fixes this for multiple users so far.

<!-- gh-comment-id:2637307452 --> @Yppiti commented on GitHub (Feb 5, 2025): +1 for having this same issue. Removing the system prompt fixes this but defeats the purpose of using a custom model. No form of "refreshing" fixes this for multiple users so far.
Author
Owner

@spammenotinoz commented on GitHub (Feb 5, 2025):

It seems like this was able to be fixed for me by issuing a hard refresh. It appears that when open-webui updated, my browser continued to use cached files - under the Settings -> About panel it still showed 0.5.7, after hard refresh it showed 0.5.9.

I can repeat via curl and postman. Sure you were not testing against a model that doesn’t have a custom system prompt?

<!-- gh-comment-id:2637848133 --> @spammenotinoz commented on GitHub (Feb 5, 2025): > It seems like this was able to be fixed for me by issuing a hard refresh. It appears that when open-webui updated, my browser continued to use cached files - under the Settings -> About panel it still showed 0.5.7, after hard refresh it showed 0.5.9. I can repeat via curl and postman. Sure you were not testing against a model that doesn’t have a custom system prompt?
Author
Owner

@spammenotinoz commented on GitHub (Feb 5, 2025):

I think you misunderstood the.bug, it impacts api users not web interface users.

<!-- gh-comment-id:2637916218 --> @spammenotinoz commented on GitHub (Feb 5, 2025): I think you misunderstood the.bug, it impacts api users not web interface users.
Author
Owner

@tjbck commented on GitHub (Feb 5, 2025):

Addressed with ff84c120f5, 0.5.10 will be released shortly

<!-- gh-comment-id:2638044966 --> @tjbck commented on GitHub (Feb 5, 2025): Addressed with ff84c120f5260e7b40cc31b9f60a2afe8ba9e3c8, 0.5.10 will be released shortly
Author
Owner

@spammenotinoz commented on GitHub (Feb 5, 2025):

Thank-you.

<!-- gh-comment-id:2638074176 --> @spammenotinoz commented on GitHub (Feb 5, 2025): Thank-you.
Author
Owner

@Yppiti commented on GitHub (Feb 5, 2025):

Just a heads up that I applied this as a hotfix directly to the affected file ("utils/payload.py") with success. Will officially patch when release is out.

<!-- gh-comment-id:2638104257 --> @Yppiti commented on GitHub (Feb 5, 2025): Just a heads up that I applied this as a hotfix directly to the affected file ("utils/payload.py") with success. Will officially patch when release is out.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#102483