dify - 💡(How to fix) Fix 422 error when connection embedding model served via Litellm by Openai compatible provider [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35784Fetched 2026-05-05 06:04:01
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
1
Author
Timeline (top)
commented ×1labeled ×1mentioned ×1subscribed ×1

Error Message

3.422 error occurs Litellm return 422 error due to Openai compatible provider set encoding_format to None explicitly, which Litellm only accept float or base64 as value. Here is the complete error message:

Error Code: 422 Message: litellm.BadRequestError: OpenAIException - Error code: 422 - {'detail': [{'type': 'literal_error', 'loc': ['body', 'encoding_format'], 'msg': "Input should be 'float' or 'base64'", 'input': None, 'ctx': {'expected': "'float' or 'base64'"}}]}. Received Model Group=Qwen3-Embedding-8B-4bit-DWQ-mlx Available Model Group Fallbacks=None

RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.13.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Serve a embedding model via Litellm
  2. Use openai compatible provider (version 0.0.47) to connect the embedding model 3.422 error occurs

✔️ Expected Behavior

The embedding model should add to model list successfully

❌ Actual Behavior

Litellm return 422 error due to Openai compatible provider set encoding_format to None explicitly, which Litellm only accept float or base64 as value.

Here is the complete error message:

Error Code: 422 Message: litellm.BadRequestError: OpenAIException - Error code: 422 - {'detail': [{'type': 'literal_error', 'loc': ['body', 'encoding_format'], 'msg': "Input should be 'float' or 'base64'", 'input': None, 'ctx': {'expected': "'float' or 'base64'"}}]}. Received Model Group=Qwen3-Embedding-8B-4bit-DWQ-mlx Available Model Group Fallbacks=None

extent analysis

TL;DR

Set the encoding_format to either 'float' or 'base64' when using the OpenAI compatible provider to connect the embedding model.

Guidance

  • Verify that the OpenAI compatible provider version 0.0.47 is correctly configured to set the encoding_format to a valid value.
  • Check the Litellm documentation to ensure that the encoding_format parameter is correctly formatted as either 'float' or 'base64'.
  • Update the OpenAI compatible provider to set the encoding_format to a valid value, such as 'float' or 'base64', to resolve the 422 error.
  • Test the embedding model connection again after updating the encoding_format to ensure that the model is added to the list successfully.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The issue is specific to the OpenAI compatible provider version 0.0.47 and Litellm, so the solution may not apply to other versions or configurations.

Recommendation

Apply workaround: Set the encoding_format to either 'float' or 'base64' when using the OpenAI compatible provider to connect the embedding model, as this is the most straightforward solution to resolve the 422 error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

dify - 💡(How to fix) Fix 422 error when connection embedding model served via Litellm by Openai compatible provider [1 comments, 2 participants]