Find answers from the community

Updated 4 months ago

milvus + azure openai

At a glance

The community member is trying to follow the Milvus tutorial but is using Azure OpenAI instead of OpenAI. The code is trying to connect to OpenAI during the embedding step, which is causing an authentication error. The community members suggest that the issue is likely due to the default service context being set to OpenAI, and that the community member should configure the service context for Azure OpenAI. After trying this, the community members confirm that this resolved the issue. However, they note that the Azure OpenAI embedding model seems to be problematic, and they recommend using a local embedding model instead.

Useful resources
i'm trying to follow the Milvus tutorial but I am using Azure OpenAI and not OpenAI, but it keeps trying to talk to OpenAI during the embedding step:
Plain Text
Retrying llama_index.embeddings.openai.base.get_embeddings in 0.275948059787665 seconds as it raised AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: xxx. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}.
t
L
7 comments
ohh i probably have to configure the service context
bc the default is likely openai when not configured
trying that now
that seems like it was the issue
ok, interesting. it specifically is related to the embed_model setting (or lack thereof). looks like azure openai embed is a hot mess. will use local for now
sorry for the noise!
Yea with azure, I really recommend setting a global service context

Its a little more straight forward in v0.10.x, you can explicitly pass in the embedding model for certain steps, and more easily set a global default
Add a reply
Sign up and join the conversation on Discord