-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Do you need to file an issue?
- I have searched the existing issues and this bug is not already filed.
- I believe this is a legitimate bug, not just a question or feature request.
Describe the bug
The Azure embeddings client in LightRAG always returns a 404 Resource Not Found error because the function azure_openai_embed() passes the wrong value to the model parameter in the embeddings API call.
Although the function correctly resolves the Azure deployment name into the deployment variable, it mistakenly calls the embeddings API with:model=model
The model parameter is almost always None, causing Azure to look for a deployment literally named "None", which leads to a 404 error.
The correct value should be: model=deployment
This issue occurs even when all Azure environment variables and deployments are correctly configured.
Steps to reproduce
- Set up environment variables for Azure embeddings:
AZURE_EMBEDDING_ENDPOINT=https://<your-resource>.openai.azure.com/
AZURE_EMBEDDING_DEPLOYMENT=text-embedding-3-small
AZURE_EMBEDDING_API_KEY=<your-key>
AZURE_EMBEDDING_API_VERSION=2023-05-15
-
Run any LightRAG example that uses embeddings,
-
LightRAG attempts to call Azure embeddings.
-
Azure returns the following error:
404: DeploymentNotFound - The deployment 'None' does not existTracing this shows that the embeddings client received model=None instead of the actual deployment name.
Expected Behavior
LightRAG should call embeddings.create() using the resolved Azure deployment name, and embeddings should be generated successfully without a 404 error.
The line: model=model
should instead use:model=deployment
LightRAG Config Used
In .env File
AZURE_EMBEDDING_ENDPOINT=https://<your-resource>.openai.azure.com/
AZURE_EMBEDDING_DEPLOYMENT=text-embedding-3-small
AZURE_EMBEDDING_API_KEY=<your-key>
AZURE_EMBEDDING_API_VERSION=2023-05-15
Example :
LightRAG(
working_dir=str(WORKING_DIR),
llm_model_func=azure_openai_complete,
embedding_func=azure_openai_embed,
)
Logs and screenshots
openai.BadRequestError: 404 - DeploymentNotFound
Message: The API deployment for 'None' does not exist
Additional Information
- LightRAG Version: 1.4.9.8
- Operating System: MacOS
- Python Version: 3.11
- Related Issues: