[BUG] - Groq provider responses rejected: ChatCompletion validation fails on service_tier='on_demand'
First Check
- This is not a feature request.
- I added a very descriptive title to this issue (title field is above this).
- I used the GitHub search to find a similar issue and didn't find it.
- I searched the Mealie documentation, with the integrated search.
- I already read the docs and didn't find an answer.
- This issue can be replicated on the demo site (https://demo.mealie.io/).
What is the issue you are experiencing?
Using Groq (https://api.groq.com/openai/v1) as an AI provider fails on every chat request, even though Groq returns 200 OK. Mealie validates the response with ChatCompletion.model_validate(...) (mealie/services/openai/openai.py, _get_raw_response, line 369 in my build). Groq's response includes "service_tier": "on_demand", which is Groq's documented default tier, but the OpenAI SDK model only accepts 'auto', 'default', 'flex', 'scale', 'priority' or 'fast'. The whole response is discarded with a pydantic ValidationError.
The provider's Test button reproduces it. Because it hits the default provider, it also breaks AI recipe import (webpage fallback, and the transcript-to-recipe step of video imports).
The same Groq account and key work fine in other OpenAI-compatible clients, so this is Mealie's response handling, not the account or model.
Steps to Reproduce
- Group Settings > AI Provider Settings > Create Provider
- Base URL: https://api.groq.com/openai/v1, model: openai/gpt-oss-20b, a valid Groq API key
- Click Test on the provider
- Groq returns "HTTP/1.1 200 OK", then Mealie logs "AI provider connection test failed" with the ValidationError below
- Also reproducible by setting this provider as the default and importing a recipe URL with AI enabled
Please provide relevant logs
INFO 2026-09-26T14:37:24 - HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK" ERROR 2026-09-26T14:37:24 - AI provider connection test failed Traceback (most recent call last): File "/opt/mealie/lib/python3.14/site-packages/mealie/services/openai/openai.py", line 400, in get_response return await self._get_raw_response(prompt, user_messages, response_schema, provider) File "/opt/mealie/lib/python3.14/site-packages/mealie/services/openai/openai.py", line 369, in _get_raw_response completion = ChatCompletion.model_validate(json.loads(await response.text())) File "/opt/mealie/lib/python3.14/site-packages/pydantic/main.py", line 732, in model_validate pydantic_core._pydantic_core.ValidationError: 1 validation error for ChatCompletion service_tier Input should be 'auto', 'default', 'flex', 'scale', 'priority' or 'fast' [type=literal_error, input_value='on_demand', input_type=str] For further information visit https://errors.pydantic.dev/2.13/v/literal_error
Mealie Version
V3.28.0 Build: 0552eaa4a80031b8572849cca0ed95d07f1be001
Deployment
Docker (Linux)
Additional Deployment Details
No response
Source: mealie-recipes/mealie