azure-openai
#10009
model_incompatibility_error
The embeddings operation does not work with the specified model. Please choose a different model and try again. You can learn more about compatible models for each operation here: https://go.microsoft.com/fwlink/?linkid=2197993.
This error has been identified and solved.
Reason
The error you are encountering with a 400 status code in the Azure OpenAI API is due to the following reasons:
Incorrect Model Specification
The error message indicates that the embeddings operation does not work with the specified model, gpt-4
. This model is not designed for embedding operations, which is why the server is returning a "Bad Request" (400 status code).
Invalid Request Configuration
The request configuration, including the model specified, is not valid for the embeddings operation. The server cannot process the request because it does not match the expected syntax or configuration for the embeddings API.
Solution
To resolve the 400 status error in the Azure OpenAI API, you need to address the incorrect model specification and ensure the request configuration is valid for the embeddings operation. Here are the steps to fix this issue:
Choose a compatible model: Select a model that is designed for embedding operations, such as
text-embedding-ada-002
ortext-embedding-3-large
.Update the request configuration: Ensure that the model specified in your request matches the requirements for the embeddings API.
Verify API documentation: Refer to the Azure OpenAI API documentation to confirm which models are supported for the embeddings operation.
Check other request parameters: Ensure all other parameters, such as the
deployment-id
andapi-version
, are correctly specified.
Suggested Links
https://cheatsheet.md/chatgpt-cheatsheet/openai-api-error-axioserror-request-failed-status-code-400
https://learn.microsoft.com/en-us/answers/questions/1275410/ratelimiterror-requests-to-the-embeddings-create-o
https://learn.microsoft.com/en-us/answers/questions/2084649/langchain-azure-openai-problem-the-embeddings-oper
https://learn.microsoft.com/en-us/answers/questions/1479386/azure-openai-api-calling-issue
https://github.com/assafelovic/gpt-researcher/issues/936
https://portkey.ai/error-library/prompt-error-10016
https://learn.microsoft.com/fi-fi/azure/ai-services/openai/reference
https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/TROUBLESHOOTING.md