{"record":{"id":"21459898b61397eb","repo":"BerriAI/litellm","slug":"unable-to-map-the-custom-llm-provider-custom-llm","errorCode":null,"errorMessage":"Unable to map the custom llm provider={custom_llm_provider} to a known provider={litellm.provider_list}.","messagePattern":"Unable to map the custom llm provider=(.+?) to a known provider=(.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/main.py","lineNumber":8326,"sourceCode":"\n        response = aws_polly_config.dispatch_text_to_speech(\n            model=model,\n            input=input,\n            voice=voice,\n            optional_params=optional_params,\n            litellm_params_dict=litellm_params_dict,\n            logging_obj=logging_obj,\n            timeout=timeout,\n            extra_headers=extra_headers,\n            base_llm_http_handler=base_llm_http_handler,\n            aspeech=aspeech or False,\n            api_base=api_base,\n            api_key=api_key,\n            **kwargs,\n        )\n\n    if response is None:\n        raise Exception(\n            f\"Unable to map the custom llm provider={custom_llm_provider} to a known provider={litellm.provider_list}.\"\n        )\n    return response\n\n\n##### Health Endpoints #######################\n\n\nasync def ahealth_check(\n    model_params: dict,\n    mode: str | None = \"chat\",\n    prompt: str | None = None,\n    input: list | None = None,\n):\n    \"\"\"\n    Support health checks for different providers. Return remaining rate limit, etc.\n\n    Returns:","sourceCodeStart":8308,"sourceCodeEnd":8344,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/main.py#L8308-L8344","documentation":"In the TTS/speech path, after attempting the provider-specific handlers, response is still None — custom_llm_provider did not map to any known speech-capable provider in litellm.provider_list, so a generic Exception is raised.","triggerScenarios":"litellm.speech(model='myprov/tts', input='text') where 'myprov' has no TTS handler; passing custom_llm_provider of a chat-only provider to speech().","commonSituations":"Assuming every provider supports TTS; typos in the provider prefix; custom handlers where only speech() or only aspeech() is implemented.","solutions":["Use a TTS-capable model: litellm.speech(model='openai/tts-1', voice='alloy', input='hello')","For custom providers, implement speech()/aspeech() on the CustomLLM handler","Verify the provider name against litellm.provider_list","Upgrade litellm"],"exampleFix":"# before\nresp = litellm.speech(model=\"gpt-4o-mini\", input=\"hello\")\n\n# after\nresp = litellm.speech(model=\"openai/tts-1\", voice=\"alloy\", input=\"hello\")","handlingStrategy":"validation","validationCode":"import litellm\n\nprovider = model.partition(\"/\")[0]\nif provider not in litellm.provider_list:\n    raise ValueError(f\"unknown TTS provider: {provider!r}\")\n# also confirm the provider actually implements TTS before calling","typeGuard":null,"tryCatchPattern":"try:\n    audio = litellm.speech(model=model, input=text)\nexcept Exception as e:\n    if \"Unable to map the custom llm provider\" in str(e):\n        raise RuntimeError(f\"{model!r} has no TTS route\") from e\n    raise","preventionTips":["Use known TTS models ('openai/tts-1', 'azure/<tts-deploy>') in config","Smoke-test TTS routes at startup alongside other capability checks"],"tags":["litellm","tts","speech","provider"],"backgroundTag":"unknown-provider","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}