{"record":{"id":"6e87c35614f6af72","repo":"huggingface/open-r1","slug":"unknown-provider-type-provider-type","errorCode":null,"errorMessage":"Unknown provider type: {provider_type}","messagePattern":"Unknown provider type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/open_r1/utils/code_providers.py","lineNumber":366,"sourceCode":"    \"\"\"\n    num_parallel = kwargs.pop(\"num_parallel\", 2)\n\n    if provider_type == \"e2b\":\n        # Extract E2B-specific arguments\n        e2b_router_url = kwargs.pop(\"e2b_router_url\", None)\n        return E2BProvider(\n            num_parallel=num_parallel,\n            e2b_router_url=e2b_router_url,\n        )\n    elif provider_type == \"morph\":\n        # Extract Morph-specific arguments\n        morph_router_url = kwargs.pop(\"morph_router_url\", None)\n        return MorphProvider(\n            num_parallel=num_parallel,\n            morph_router_url=morph_router_url,\n        )\n    else:\n        raise ValueError(f\"Unknown provider type: {provider_type}\")\n","sourceCodeStart":348,"sourceCodeEnd":367,"githubUrl":"https://github.com/huggingface/open-r1/blob/1416fa0cf21595d2083b399a2a0bbddd7f6e9563/src/open_r1/utils/code_providers.py#L348-L367","documentation":"get_provider is a factory that dispatches on provider_type and raises ValueError for any value it doesn't recognize. Only the explicitly handled provider types (e2b, morph, etc.) are supported; unknown strings fall through to the final else. This is a fail-fast guard against typos and unsupported providers in reward config.","triggerScenarios":"Calling get_provider(...) (e.g. from the code_reward pipeline via kwargs) with a provider_type value not handled by the factory's if/elif chain — misspellings like \"E2B\", \"e2b_code\", \"modal\" (if unimplemented), or an empty/None string.","commonSituations":"Typo in a training config's code_provider field; YAML/CLI value passed with wrong casing; copying a config from a fork that supports extra providers this version doesn't; passing a provider object where a string was expected.","solutions":["Check the provider_type string against the supported values in get_provider's source","Fix casing/typos (values are matched exactly, e.g. \"e2b\" not \"E2B\")","Use a provider implemented in this version of the library","If a new provider is needed, add a branch to get_provider or pass kwargs through an already-supported provider"],"exampleFix":"// before\nprovider = get_provider(\"E2B\", num_parallel=4)  # ValueError: Unknown provider type: E2B\n// after\nprovider = get_provider(\"e2b\", num_parallel=4)","handlingStrategy":"validation","validationCode":"SUPPORTED_PROVIDERS = {\"e2b\", \"morph\"}  # per get_provider's branches\n\ndef pick_provider(provider_type: str, **kwargs):\n    if provider_type not in SUPPORTED_PROVIDERS:\n        raise SystemExit(f\"provider_type must be one of {sorted(SUPPORTED_PROVIDERS)}, got {provider_type!r}\")\n    return get_provider(provider_type, **kwargs)","typeGuard":"def is_known_provider(provider_type) -> bool:\n    return isinstance(provider_type, str) and provider_type in {\"e2b\", \"morph\"}","tryCatchPattern":"try:\n    provider = get_provider(provider_type, **kwargs)\nexcept ValueError as e:\n    if str(e).startswith(\"Unknown provider type\"):\n        logger.error(\"%s — check the code_provider field in your config (case-sensitive)\", e)\n        raise SystemExit(1) from e\n    raise","preventionTips":["Use exact lowercase provider names matching the source (\"e2b\", \"morph\")","Validate config files against a schema that enumerates allowed provider values","When copying configs from forks, diff the supported provider list first","Add a startup assertion that resolves the provider before training begins"],"tags":["python","configuration","invalid-argument","factory"],"backgroundTag":"invalid-enum-value","analyzedSha":"1416fa0cf21595d2083b399a2a0bbddd7f6e9563","analyzedAt":"2026-08-30T08:56:53.400Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}