{"record":{"id":"a39c7b37ad03a8da","repo":"BerriAI/litellm","slug":"either-model-names-or-model-ids-must-be-provided-a","errorCode":null,"errorMessage":"Either model_names or model_ids must be provided and non-empty","messagePattern":"Either model_names or model_ids must be provided and non-empty","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_access_group_management_endpoints.py","lineNumber":382,"sourceCode":"        llm_router,\n        prisma_client,\n    )\n\n    verbose_proxy_logger.debug(\"Creating access group: %s with models: %s\", data.access_group, data.model_names)\n\n    # Validation: Check if access_group is provided\n    if not data.access_group or not data.access_group.strip():\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"access_group is required and cannot be empty\"},\n        )\n\n    # Validation: Check that at least one of model_names or model_ids is provided\n    has_model_names: Final = data.model_names and len(data.model_names) > 0\n    has_model_ids: Final = data.model_ids and len(data.model_ids) > 0\n\n    if not has_model_names and not has_model_ids:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"Either model_names or model_ids must be provided and non-empty\"},\n        )\n\n    # If model_ids is provided, use it (more precise targeting)\n    use_model_ids: Final = has_model_ids\n\n    # Validate model_names exist in router (only if using model_names path)\n    if not use_model_ids and has_model_names:\n        assert data.model_names is not None\n        all_valid, missing_models = validate_models_exist(\n            model_names=data.model_names,\n            llm_router=llm_router,\n        )\n\n        if not all_valid:\n            raise HTTPException(\n                status_code=400,","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py#L364-L400","documentation":"Input guard on access-group creation: neither model_names nor model_ids was supplied (or both were empty lists). A group with no members cannot be applied to any deployment, so the request is rejected up front.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:382 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide at least one entry in model_names or model_ids."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}