-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Labels
Description
What happened?
If you pass the path to a custom handler and it contains the substring os anywhere, the handler will fail to load "for security reasons". This is very prone to false positives, e.g. having your handler in a directory tree containing git_repos will trigger it.
Example for having a directory in the tree called tempos below:
litellm_settings:
custom_provider_map:
- custom_handler: /Users/jpaton/temp/tempos/test-litellm-proxy/my_llm.my_llm
yields
ERROR: Traceback (most recent call last):
File "/Users/jpaton/temp/tempos/test-litellm-proxy/.venv/lib/python3.12/site-packages/litellm/proxy/types_utils/utils.py", line 18, in get_instance_fn
security_checks(module_name=module_name)
File "/Users/jpaton/temp/tempos/test-litellm-proxy/.venv/lib/python3.12/site-packages/litellm/proxy/types_utils/utils.py", line 77, in security_checks
raise ImportError(
ImportError: Importing from module /Users/jpaton/temp/tempos/test-litellm-proxy/my_llm is not allowed for security reasons
The checks were introduced in 441c727
Relevant log output
Are you a ML Ops Team?
Yes
What LiteLLM version are you on ?
1.69.2
Twitter / LinkedIn details
No response
nightshiba