{"record":{"id":"935f49b91fa75822","repo":"BerriAI/litellm","slug":"embedding-config-is-required-in-litellm-params-for","errorCode":null,"errorMessage":"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'}","messagePattern":"embedding_config is required in litellm_params for Azure AI Search\\. Example: litellm_params\\['embedding_config'\\] = (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/vector_stores/transformation.py","lineNumber":138,"sourceCode":"        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\n        try:\n            embedding_response: Final = litellm.embedding(\n                model=embedding_model,\n                input=[query],\n                **embedding_config,\n            )\n            query_vector: Final = embedding_response.data[0][\"embedding\"]","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/azure_ai/vector_stores/transformation.py#L120-L156","documentation":"Alongside the embedding model, the search transform requires the connection settings for it. litellm_params.get('litellm_embedding_config', {}) returns an empty dict by default, and an empty dict is falsy, so both a missing key and an explicitly empty dict raise this error.","triggerScenarios":"Configuring litellm_embedding_model but omitting litellm_embedding_config; or setting it to {} — both fail. The config must contain at minimum the api_base and api_key (and typically api_version) for the embedding deployment.","commonSituations":"Assuming the embedding call reuses the vector store's api_key; supplying the config under embedding_config without the litellm_ prefix; leaving a placeholder {} while migrating.","solutions":["Set litellm_params['litellm_embedding_config'] = {'api_base': 'https://<resource>.cognitiveservices.azure.com/', 'api_key': os.environ['AZURE_API_KEY'], 'api_version': '2025-09-01'}","Note the key prefix: it is litellm_embedding_config, not embedding_config","If the embedding deployment lives in the same resource as OCR/chat, reuse those credentials explicitly — they are not inherited"],"exampleFix":"# before\nlitellm_params={..., 'litellm_embedding_model': 'azure/text-embedding-3-large'}  # no config\n\n# after\nlitellm_params={..., 'litellm_embedding_model': 'azure/text-embedding-3-large', 'litellm_embedding_config': {'api_base': 'https://my-resource.cognitiveservices.azure.com/', 'api_key': os.environ['AZURE_API_KEY'], 'api_version': '2025-09-01'}}","handlingStrategy":"validation","validationCode":"emb_cfg = litellm_params.get('litellm_embedding_config')\nif not emb_cfg or not isinstance(emb_cfg, dict):\n    raise ValueError('litellm_embedding_config must be a non-empty dict with api_base/api_key')","typeGuard":"def is_valid_embedding_config(cfg) -> bool:\n    return isinstance(cfg, dict) and bool(cfg.get('api_base')) and bool(cfg.get('api_key'))","tryCatchPattern":null,"preventionTips":["Remember both a missing key and {} fail — always populate the dict","Note the litellm_ prefix on both embedding keys"],"tags":["azure","vector-stores","azure-search","embeddings","configuration"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}