Vision model issue with Azure OpenAI and serverless mode #6311
Replies: 2 comments 2 replies
-
Can't reproduce the issue. If using a serverless model, it falls back to a vision model if the current model does not support images. In this case, I start with deepseek-r1, attach an image, and since it doesn't support images, it uses my gpt-4o config instead: my config: endpoints:
azureOpenAI:
streamRate: 35
titleModel: "gpt-4o"
titleConvo: true
groups:
- group: "eastus"
apiKey: "${EASTUS_API_KEY}"
instanceName: "my-eastus"
version: "2024-02-15-preview"
models:
gpt-4o:
deploymentName: gpt-4o
- group: "region-eastus"
apiKey: "${EASTUS2_API_KEY}"
instanceName: "my-eastus2"
version: "2024-12-01-preview"
models:
gpt-4o-latest:
deploymentName: "gpt-4o-mini"
version: "2024-02-15-preview"
o1-mini:
deploymentName: "o1-mini"
o1-preview:
deploymentName: "o1-preview"
o3-mini:
deploymentName: "o3-mini"
- group: "region-sweden" # arbitrary name
apiKey: "${SWEDEN_API_KEY}" # arbirary env. var, must be defined in .env file
instanceName: "libre-dall-e" # the instance
version: "2024-12-01-preview"
models:
o1-2024-12-17:
deploymentName: "o1"
- group: "Azure AI Foundry"
apiKey: "${AZURE_DEEPSEEK_API_KEY}"
baseURL: "https://DeepSeek-R1-foundry-endpoint.eastus.models.ai.azure.com/v1/"
version: "2024-08-01-preview"
serverless: true
models:
DeepSeek-R1:
deploymentName: "DeepSeek-R1" |
Beta Was this translation helpful? Give feedback.
-
It's not the model not supporting images, it's more the backend URL (which is not openAI directly but an API in front) does not receive the api-key (and returns a 401 error if this is not present). As I understand the spec, it should.
We are using the baseURL feature to reach an internal API (which supports OpenAI API queries) before going to AzureOpenAI. You can verify the behavior by setting a breakpoint at query time, the headers are different if an image is included (base64 encoded) or not: api-key is not included. When updating the code as written in the initial post, the api-key is present and the model correctly receives the image as expected. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
When using Azure OpenAI in serverless mode and a custom endpoint, the query is sent to the backend URL without api-key in the headers.
This seems to be due to https://github.com/danny-avila/LibreChat/blob/main/api/app/clients/OpenAIClient.js#L1183 resetting the headers, if I instead merge the headers with this code
opts.defaultHeaders = { ...opts.defaultHeaders, ...resolveHeaders(headers) };
the headers are correctly sent and the entire process is resolved. It also works if I remove this line altogether (but I am not familiar enough with the codebase to verify all potential side effects).I can attach a PR with the above fix if bug is confirmed.
Version Information
ded3cd8
Steps to Reproduce
What browsers are you seeing the problem on?
No response
Relevant log output
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions