-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Description
When using Azure as the embedding provider for folders/sources, file uploads fail during the embedding phase with a 404 Resource Not Found error. The root cause is a malformed URL being constructed with a duplicate /embeddings path segment.
The embedding_endpoint stored in EmbeddingConfig is pre-constructed with the full path including /embeddings?api-version=.... However, when the OpenAI Python SDK's client.embeddings.create() method is called, it automatically appends /embeddings to the base URL. This results in the path appearing twice:
Expected URL
POST https://<azure-resource>.cognitiveservices.azure.com/openai/deployments/text-embedding-3-small/embeddings?api-version=2024-02-15-preview
Actual URL
POST https://<azure-resource>.cognitiveservices.azure.com/openai/deployments/text-embedding-3-small/embeddings?api-version=2024-02-15-preview/embeddings
Steps to reproduce
- Configure Letta with Azure embedding provider
- Create an agent with Azure embeddings
- Create a folder using the agent's embedding configuration
- Upload a file to the folder
- Observe 404 errors in the logs during the embedding phase
Suggested Fix
The embedding_endpoint should either not include the /embeddings suffix (letting the SDK add it), or be used as the complete URL without the SDK appending additional path segments. The fix is likely in letta/llm_api/azure_client.py or wherever the Azure embedding endpoint URL is constructed.
Setup
Letta self-hosted 0.16.2