An Open WebUI pipe that lists every model on a LiteLLM proxy, with a prefix you choose (Lite: gpt-4o).
- Open WebUI → Admin Panel → Functions → +, paste in
litellm_pipe.py. - Set the valves:
LITELLM_API_BASE_URL(defaulthttp://localhost:4000) andLITELLM_API_KEY. - Change the prefix with
self.namein the file.
The model list is cached for CACHE_DURATION_MINUTES (default 60). Connection errors show up in the model list.
Needs pydantic and requests, both already in Open WebUI.
MIT