{"record":{"id":"9025a2c67799cef1","repo":"microsoft/graphrag","slug":"azure-deployment-name-should-not-be-specified-for","errorCode":null,"errorMessage":"azure_deployment_name should not be specified for non-Azure model providers.","messagePattern":"azure_deployment_name should not be specified for non-Azure model providers\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-llm/graphrag_llm/config/model_config.py","lineNumber":96,"sourceCode":"    metrics: MetricsConfig | None = Field(\n        default_factory=MetricsConfig,\n        description=\"Specify and configure the metric services.\",\n    )\n\n    mock_responses: list[str] | list[float] = Field(\n        default_factory=list,\n        description=\"List of mock responses for testing.\",\n    )\n\n    def _validate_lite_llm_config(self) -> None:\n        \"\"\"Validate LiteLLM specific configuration.\"\"\"\n        if self.model_provider == \"azure\" and not self.api_base:\n            msg = \"api_base must be specified with the 'azure' model provider.\"\n            raise ValueError(msg)\n\n        if self.model_provider != \"azure\" and self.azure_deployment_name is not None:\n            msg = \"azure_deployment_name should not be specified for non-Azure model providers.\"\n            raise ValueError(msg)\n\n        if self.auth_method == AuthMethod.AzureManagedIdentity:\n            if self.api_key is not None:\n                msg = \"api_key should not be set when using Azure Managed Identity.\"\n                raise ValueError(msg)\n        elif not self.api_key:\n            msg = \"api_key must be set when auth_method=api_key.\"\n            raise ValueError(msg)\n\n    @model_validator(mode=\"after\")\n    def _validate_model(self):\n        \"\"\"Validate model configuration after initialization.\"\"\"\n        if self.type == LLMProviderType.LiteLLM:\n            self._validate_lite_llm_config()\n        return self\n","sourceCodeStart":78,"sourceCodeEnd":112,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-llm/graphrag_llm/config/model_config.py#L78-L112","documentation":"ModelConfig validation rejects azure_deployment_name when model_provider is not 'azure'. The deployment name is only meaningful for Azure routing; specifying it with another provider indicates a mixed-up config.","triggerScenarios":"ModelConfig(model_provider=\"openai\", azure_deployment_name=\"my-deployment\") or a settings.yaml that sets azure_deployment_name while the provider was changed away from azure.","commonSituations":"Leftover azure_deployment_name after switching providers in settings.yaml; copying an Azure example config and only changing model_provider.","solutions":["Remove the azure_deployment_name field from the config","Or, if you actually target Azure, set model_provider: azure (and provide api_base)"],"exampleFix":"# before\ncfg = ModelConfig(model_provider=\"openai\", model=\"gpt-4o\", azure_deployment_name=\"deploy1\")\n# after\ncfg = ModelConfig(model_provider=\"openai\", model=\"gpt-4o\")","handlingStrategy":"validation","validationCode":"if cfg.get(\"azure_deployment_name\") and cfg.get(\"model_provider\") != \"azure\":\n    cfg.pop(\"azure_deployment_name\")  # or fail loudly\n    # raise ValueError(\"azure_deployment_name set without azure provider\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep provider-specific keys grouped in commented blocks in settings.yaml","Run a pre-flight script that strips/flags azure_* keys when provider != azure","Document which fields are azure-only in your project README"],"tags":["azure","litellm","config-validation","conflicting-fields"],"backgroundTag":"invalid-config-combination","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}