
cohere
#10148
unsupported_model_error
Invalid request: the specified model is not supported by the API. Please verify the model name and version.
This error has been identified and solved.
Reason
The 400 status error you are seeing, specifically the message "invalid request: model 'embed-english-v2.0' is not supported by the generate API," indicates that the model you are trying to use (embed-english-v2.0
) is not compatible with the API endpoint you are calling. The generate
API endpoint likely requires a different type of model, and the embed-english-v2.0
model is designed for embeddings, not for generation tasks.
Solution
To fix the 400 status error due to the model not being supported by the generate API, you need to ensure you are using the correct API endpoint and model type. Here are the key steps:
Use the embeddings API instead of the generate API, as
embed-english-v2.0
is designed for embeddings.Select a model that is supported by the embeddings API, such as
embed-english-v2.0
,embed-multilingual-v2.0
, or other supported embedding models.Verify the input parameters, particularly the
inputType
, to match the requirements of the embeddings API.
Here are some key points to consider:
Ensure the correct API endpoint is used (e.g., embeddings API).
Choose a supported embedding model.
Validate the input parameters according to the API specifications.
Suggested Links
https://github.com/langchain-ai/langchainjs/issues/3894
https://docs.cohere.com/v2/reference/errors
https://en.ryte.com/wiki/Status_Code_400
https://community.openai.com/t/getting-400-response-with-already-working-code/509212
https://docs.cohere.com/docs/cohere-faqs
https://lancedb.github.io/lancedb/embeddings/available_embedding_models/text_embedding_functions/cohere_embedding/
https://cheatsheet.md/chatgpt-cheatsheet/openai-api-error-axioserror-request-failed-status-code-400
https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-cohere.html