forked from phoenix/litellm-mirror
feat(proxy_server.py): support custom llm handler on proxy
This commit is contained in:
parent
a2d07cfe64
commit
bd7af04a72
4 changed files with 140 additions and 2 deletions
|
@ -1507,6 +1507,21 @@ class ProxyConfig:
|
|||
verbose_proxy_logger.debug(
|
||||
f"litellm.post_call_rules: {litellm.post_call_rules}"
|
||||
)
|
||||
elif key == "custom_provider_map":
|
||||
from litellm.utils import custom_llm_setup
|
||||
|
||||
litellm.custom_provider_map = [
|
||||
{
|
||||
"provider": item["provider"],
|
||||
"custom_handler": get_instance_fn(
|
||||
value=item["custom_handler"],
|
||||
config_file_path=config_file_path,
|
||||
),
|
||||
}
|
||||
for item in value
|
||||
]
|
||||
|
||||
custom_llm_setup()
|
||||
elif key == "success_callback":
|
||||
litellm.success_callback = []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue