BerriAI/litellm · error · ValueError
embedding_model is required in litellm_params for Azure AI…
Error message
embedding_model is required in litellm_params for Azure AI Search. Example: litellm_params['embedding_model'] = 'azure/text-embedding-3-large'
What it means
Error "embedding_model is required in litellm_params for Azure AI Search. Example: litellm_params['embedding_model'] = 'azure/text-embedding-3-large'" thrown in BerriAI/litellm.
Solutions
- Set litellm_params['embedding_model'], e.g. 'azure/text-embedding-3-large'.
When it happens
Trigger: Thrown at litellm/llms/azure_ai/vector_stores/transformation.py:131 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/73b08aff21235cc2.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/azure_ai/vector_stores/transformation.py:131
vector_store_search_optional_params: VectorStoreSearchOptionalRequestParams,
api_base: str,
litellm_logging_obj: LiteLLMLoggingObj,
litellm_params: dict,
extra_body: dict[str, Any] | None = None,
) -> tuple[str, dict[str, Any]]:
"""
Transform search request for Azure AI Search API
Generates embeddings using litellm.embeddings and constructs Azure AI Search request
"""
# Convert query to string if it's a list
if isinstance(query, list):
query = " ".join(query)
# Get embedding model from litellm_params (required)
embedding_model: Final = litellm_params.get("litellm_embedding_model")
if not embedding_model:
raise ValueError(
"embedding_model is required in litellm_params for Azure AI Search. "
"Example: litellm_params['embedding_model'] = 'azure/text-embedding-3-large'"
)
embedding_config: Final = litellm_params.get("litellm_embedding_config", {})
if not embedding_config:
raise ValueError(
"embedding_config is required in litellm_params for Azure AI Search. "
"Example: litellm_params['embedding_config'] = {'api_base': 'https://krris-mh44uf7y-eastus2.cognitiveservices.azure.com/', 'api_key': 'os.environ/AZURE_API_KEY', 'api_version': '2025-09-01'}"
)
# Get vector field name (defaults to contentVector)
vector_field: Final = litellm_params.get("azure_search_vector_field", "contentVector")
# Get top_k (number of results to return)
top_k: Final = vector_store_search_optional_params.get("top_k", 10)
# Generate embedding for the query using litellm.embeddingsView on GitHub (pinned to 77b7c6c40c)