add dashscope support
This commit is contained in:
@@ -51,6 +51,8 @@ class LiteLLMProvider(LLMProvider):
|
||||
os.environ.setdefault("GEMINI_API_KEY", api_key)
|
||||
elif "zhipu" in default_model or "glm" in default_model or "zai" in default_model:
|
||||
os.environ.setdefault("ZHIPUAI_API_KEY", api_key)
|
||||
elif "dashscope" in default_model or "qwen" in default_model.lower():
|
||||
os.environ.setdefault("DASHSCOPE_API_KEY", api_key)
|
||||
elif "groq" in default_model:
|
||||
os.environ.setdefault("GROQ_API_KEY", api_key)
|
||||
|
||||
@@ -95,6 +97,13 @@ class LiteLLMProvider(LLMProvider):
|
||||
model.startswith("openrouter/")
|
||||
):
|
||||
model = f"zhipu/{model}"
|
||||
|
||||
# For DashScope/Qwen, ensure prefix is present
|
||||
if ("qwen" in model.lower() or "dashscope" in model.lower()) and not (
|
||||
model.startswith("dashscope/") or
|
||||
model.startswith("openrouter/")
|
||||
):
|
||||
model = f"dashscope/{model}"
|
||||
|
||||
# For vLLM, use hosted_vllm/ prefix per LiteLLM docs
|
||||
# Convert openai/ prefix to hosted_vllm/ if user specified it
|
||||
|
||||
Reference in New Issue
Block a user