{"record":{"id":"234225fea51d1f0d","repo":"BerriAI/litellm","slug":"cancel-run-is-not-supported-for-custom-llm-provid","errorCode":null,"errorMessage":"CANCEL run is not supported for {custom_llm_provider}","messagePattern":"CANCEL run is not supported for (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/evals/main.py","lineNumber":1723,"sourceCode":"    try:\n        litellm_logging_obj: Final[LiteLLMLoggingObj] = kwargs.get(\"litellm_logging_obj\")\n        litellm_call_id: Final[str | None] = kwargs.get(\"litellm_call_id\", None)\n        _is_async: Final = kwargs.pop(\"acancel_run\", False) is True\n\n        # Get LiteLLM parameters\n        litellm_params: Final = GenericLiteLLMParams(**kwargs)\n\n        # Determine provider\n        if custom_llm_provider is None:\n            custom_llm_provider = \"openai\"\n\n        # Get provider config\n        evals_api_provider_config: BaseEvalsAPIConfig | None = ProviderConfigManager.get_provider_evals_api_config(\n            provider=litellm.LlmProviders(custom_llm_provider),\n        )\n\n        if evals_api_provider_config is None:\n            raise ValueError(f\"CANCEL run is not supported for {custom_llm_provider}\")\n\n        # Validate environment and get headers\n        headers = extra_headers or {}\n        headers = evals_api_provider_config.validate_environment(headers=headers, litellm_params=litellm_params)\n\n        # Transform request\n        api_base: Final = litellm_params.api_base or DEFAULT_OPENAI_API_BASE\n        (\n            url,\n            headers,\n            request_body,\n        ) = evals_api_provider_config.transform_cancel_run_request(\n            eval_id=eval_id,\n            run_id=run_id,\n            api_base=api_base,\n            litellm_params=litellm_params,\n            headers=headers,\n        )","sourceCodeStart":1705,"sourceCodeEnd":1741,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/evals/main.py#L1705-L1741","documentation":"Raised in litellm.evals.cancel_run (litellm/evals/main.py:1723) when get_provider_evals_api_config finds no config for the provider. Cancelling a specific eval run is OpenAI-only in LiteLLM; any other custom_llm_provider fails before validate_environment or transform_cancel_run_request execute.","triggerScenarios":"Calling litellm.evals.cancel_run(eval_id=..., run_id=..., custom_llm_provider=<non-openai>); abort actions wired to generic provider config in an eval orchestration tool.","commonSituations":"Orchestration platforms (Airflow DAGs, background workers) that pass one provider env var to every litellm call; assuming cancel parity because create_run worked with 'openai' but cancel code reuses a different constant.","solutions":["Call cancel_run with custom_llm_provider='openai' or omit the argument","Cancel non-OpenAI runs through the provider's REST API","Add a unit assertion that your evals module always uses the 'openai' provider constant"],"exampleFix":"# before\nlitellm.evals.cancel_run(eval_id=\"eval_123\", run_id=\"run_abc\", custom_llm_provider=\"azure\")\n\n# after\nlitellm.evals.cancel_run(eval_id=\"eval_123\", run_id=\"run_abc\", custom_llm_provider=\"openai\")","handlingStrategy":"validation","validationCode":"if custom_llm_provider != \"openai\":\n    raise ValueError(\"cancel_run requires the OpenAI provider\")\nlitellm.evals.cancel_run(eval_id=eval_id, run_id=run_id, custom_llm_provider=\"openai\")","typeGuard":"def evals_provider_supported(provider: str) -> bool:\n    return provider == \"openai\"","tryCatchPattern":"try:\n    litellm.evals.cancel_run(eval_id=eval_id, run_id=run_id)\nexcept ValueError as e:\n    if \"CANCEL run is not supported\" in str(e):\n        raise UnsupportedProviderError(\"run cancellation is OpenAI-only in litellm\")","preventionTips":["Use one pinned 'openai' constant for the entire evals module","Fail fast on unsupported providers instead of letting jobs hit the API layer","Add regression tests that all evals code paths pass a supported provider"],"tags":["evals","runs","provider-support","openai","validation","cancel"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}