#23352 [Bug]: Custom LLM providers silently bypassed when model name matches built-in provider
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
## Bug Description
Custom LLM providers registered via `custom_provider_map` are **silently bypassed** when the underlying model name (after prefix stripping by `get_llm_provider()`) matches a known built-in model. The request goes directly to the built-in provider (e.g. OpenAI) instead of the custom handler. No error is raised.
## Fix
Move the `_custom_providers` dispatch block to the **top** of the `if/elif` chain — before all built-in provider checks. Explicitly registered custom providers should always take priority.
I have a PR ready with this fix.
### Steps to Reproduce
### 1. Custom provider (`mcs_provider.py`)
```python from litellm.llms.custom_llm import CustomLLM from litellm.utils import ModelResponse
class MCSProvider(CustomLLM): async def acompletion(self, model, messages, model_response, **kwargs) -> ModelResponse: # This method is NEVER called model_response.choices[0].message.content = "Hello from custom provider" model_response.choices[0].finish_reason = "stop" return model_response …