{"record":{"id":"73b08aff21235cc2","repo":"BerriAI/litellm","slug":"embedding-model-is-required-in-litellm-params-for","errorCode":null,"errorMessage":"embedding_model is required in litellm_params for Azure AI Search. Example: litellm_params['embedding_model'] = 'azure/text-embedding-3-large'","messagePattern":"embedding_model is required in litellm_params for Azure AI Search\\. Example: litellm_params\\['embedding_model'\\] = 'azure/text-embedding-3-large'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/vector_stores/transformation.py","lineNumber":131,"sourceCode":"        vector_store_search_optional_params: VectorStoreSearchOptionalRequestParams,\n        api_base: str,\n        litellm_logging_obj: LiteLLMLoggingObj,\n        litellm_params: dict,\n        extra_body: dict[str, Any] | None = None,\n    ) -> tuple[str, dict[str, Any]]:\n        \"\"\"\n        Transform search request for Azure AI Search API\n\n        Generates embeddings using litellm.embeddings and constructs Azure AI Search request\n        \"\"\"\n        # Convert query to string if it's a list\n        if isinstance(query, list):\n            query = \" \".join(query)\n\n        # Get embedding model from litellm_params (required)\n        embedding_model: Final = litellm_params.get(\"litellm_embedding_model\")\n        if not embedding_model:\n            raise ValueError(\n                \"embedding_model is required in litellm_params for Azure AI Search. \"\n                \"Example: litellm_params['embedding_model'] = 'azure/text-embedding-3-large'\"\n            )\n\n        embedding_config: Final = litellm_params.get(\"litellm_embedding_config\", {})\n        if not embedding_config:\n            raise ValueError(\n                \"embedding_config is required in litellm_params for Azure AI Search. \"\n                \"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'}\"\n            )\n\n        # Get vector field name (defaults to contentVector)\n        vector_field: Final = litellm_params.get(\"azure_search_vector_field\", \"contentVector\")\n\n        # Get top_k (number of results to return)\n        top_k: Final = vector_store_search_optional_params.get(\"top_k\", 10)\n\n        # Generate embedding for the query using litellm.embeddings","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/azure_ai/vector_stores/transformation.py#L113-L149","documentation":"Azure AI Search vector similarity search must embed the query before searching, so the config requires an embedding model. transform_search_vector_store_request reads litellm_params['litellm_embedding_model'] and raises when it is missing, with the expected format shown in the message.","triggerScenarios":"Calling vector store search against an azure_ai_search store whose litellm_params lacks litellm_embedding_model — the create-time config skipped embedding setup even though search requires it.","commonSituations":"Copying a vector-store config example that omitted the embedding block; renaming the key to embedding_model instead of litellm_embedding_model; only using the store for document indexing and later adding search.","solutions":["Add litellm_params['litellm_embedding_model'] = 'azure/text-embedding-3-large' (or any deployment you can embed with)","Pair it with litellm_embedding_config containing that model's api_base/api_key/api_version","Confirm the embedding model name is callable via litellm.embedding(model=..., input=['ping']) before wiring search"],"exampleFix":"# before\nlitellm_params={'api_key': k, 'azure_search_service_name': svc}\n\n# after\nlitellm_params={'api_key': k, 'azure_search_service_name': svc, 'litellm_embedding_model': 'azure/text-embedding-3-large', 'litellm_embedding_config': {'api_base': emb_base, 'api_key': emb_key, 'api_version': '2025-09-01'}}","handlingStrategy":"validation","validationCode":"if not litellm_params.get('litellm_embedding_model'):\n    raise ValueError('azure_ai_search search requires litellm_params[\"litellm_embedding_model\"]')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat embedding model + config as a mandatory pair when creating the vector store","Smoke-test litellm.embedding(model=..., input=['ping']) during deployment checks"],"tags":["azure","vector-stores","azure-search","embeddings","configuration"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}