add friendli_ai provider

This commit is contained in:
wslee 2024-06-10 17:27:15 +09:00
parent 90ae7f040a
commit fe8d59f5eb
6 changed files with 71 additions and 3 deletions

View file

@ -6607,6 +6607,11 @@ def get_llm_provider(
or get_secret("TOGETHERAI_API_KEY")
or get_secret("TOGETHER_AI_TOKEN")
)
elif custom_llm_provider == "friendli_ai":
api_base = "https://inference.friendli.ai/v1"
dynamic_api_key = get_secret("FRIENDLI_AI_API_KEY") or get_secret(
"FRIENDLI_TOKEN"
)
if api_base is not None and not isinstance(api_base, str):
raise Exception(
"api base needs to be a string. api_base={}".format(api_base)
@ -6654,6 +6659,11 @@ def get_llm_provider(
elif endpoint == "api.deepseek.com/v1":
custom_llm_provider = "deepseek"
dynamic_api_key = get_secret("DEEPSEEK_API_KEY")
elif endpoint == "inference.friendli.ai/v1":
custom_llm_provider = "friendli_ai"
dynamic_api_key = get_secret(
"FRIENDLI_AI_API_KEY"
) or get_secret("FRIENDLI_TOKEN")
if api_base is not None and not isinstance(api_base, str):
raise Exception(