diff --git a/request_llms/bridge_all.py b/request_llms/bridge_all.py index 642638c3..372a8e42 100644 --- a/request_llms/bridge_all.py +++ b/request_llms/bridge_all.py @@ -1257,24 +1257,27 @@ for model in [m for m in AVAIL_LLM_MODELS if m.startswith("openrouter-")]: # -=-=-=-=-=-=- 硅基智能SiliconFlow在线API -=-=-=-=-=-=- siliconflow_models = [ - "deepseek-ai/DeepSeek-R1","deepseek-ai/DeepSeek-V3", - "deepseek-ai/DeepSeek-R1-Distill-Llama-70B","deepseek-ai/DeepSeek-R1-Distill-Llama-8B", - "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B","deepseek-ai/DeepSeek-R1-Distill-Qwen-14B","deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", + "deepseek-ai/DeepSeek-R1", "Pro/deepseek-ai/DeepSeek-R1", "deepseek-ai/DeepSeek-V3", "Pro/deepseek-ai/DeepSeek-V3", + "deepseek-ai/DeepSeek-R1-Distill-Llama-70B", "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", + "deepseek-ai/DeepSeek-R1-Distill-Llama-8B", "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B", "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", "Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B","Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", - "meta-llama/Llama-3.3-70B-Instruct", - "deepseek-ai/DeepSeek-V2.5", + "meta-llama/Llama-3.3-70B-Instruct","AIDC-AI/Marco-o1","deepseek-ai/DeepSeek-V2.5", "Qwen/Qwen2.5-72B-Instruct-128K","Qwen/Qwen2.5-72B-Instruct","Qwen/Qwen2.5-32B-Instruct","Qwen/Qwen2.5-14B-Instruct","Qwen/Qwen2.5-7B-Instruct", "Qwen/Qwen2.5-Coder-32B-Instruct","Qwen/Qwen2.5-Coder-7B-Instruct", - "Qwen/QwQ-32B-Preview", + "Qwen/Qwen2-7B-Instruct","Qwen/Qwen2-1.5B-Instruct","Qwen/QwQ-32B-Preview", "TeleAI/TeleChat2", "01-ai/Yi-1.5-34B-Chat-16K","01-ai/Yi-1.5-9B-Chat-16K","01-ai/Yi-1.5-6B-Chat", - "THUDM/glm-4-9b-chat", - "Vendor-A/Qwen/Qwen2.5-72B-Instruct", - "google/gemma-2-27b-it","google/gemma-2-9b-it","Pro/google/gemma-2-9b-it", + "THUDM/glm-4-9b-chat","Vendor-A/Qwen/Qwen2.5-72B-Instruct", + "internlm/internlm2_5-7b-chat","internlm/internlm2_5-20b-chat", + "nvidia/Llama-3.1-Nemotron-70B-Instruct", + "meta-llama/Meta-Llama-3.1-405B-Instruct","meta-llama/Meta-Llama-3.1-70B-Instruct","meta-llama/Meta-Llama-3.1-8B-Instruct", + "google/gemma-2-27b-it","google/gemma-2-9b-it", "Pro/Qwen/Qwen2.5-7B-Instruct","Pro/Qwen/Qwen2-7B-Instruct","Pro/Qwen/Qwen2-1.5B-Instruct", - "THUDM/glm-4-9b-chat","Pro/THUDM/chatglm3-6b","Pro/THUDM/glm-4-9b-chat", - "meta-llama/Meta-Llama-3.1-405B-Instruct","meta-llama/Meta-Llama-3.1-70B-Instruct","meta-llama/Meta-Llama-3.1-8B-Instruct" + "Pro/THUDM/chatglm3-6b","Pro/THUDM/glm-4-9b-chat", + "Pro/meta-llama/Meta-Llama-3.1-8B-Instruct", + "Pro/google/gemma-2-9b-it", ] + if any(item in siliconflow_models for item in AVAIL_LLM_MODELS): try: siliconflow_noui, siliconflow_ui = get_predict_function( @@ -1282,381 +1285,36 @@ if any(item in siliconflow_models for item in AVAIL_LLM_MODELS): max_output_token=4096, disable_proxy=False, ) - model_info.update( - { - "deepseek-ai/DeepSeek-R1": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "deepseek-ai/DeepSeek-V3": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "eepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "deepseek-ai/DeepSeek-R1-Distill-Llama-8B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - "enable_reasoning": True, - }, - "meta-llama/Llama-3.3-70B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "deepseek-ai/DeepSeek-V2.5": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/Qwen2.5-72B-Instruct-128K": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/Qwen2.5-72B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/Qwen2.5-32B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/Qwen2.5-14B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/Qwen2.5-7B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/Qwen2.5-Coder-32B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/Qwen2.5-Coder-7B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Qwen/QwQ-32B-Preview": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "TeleAI/TeleChat2": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "01-ai/Yi-1.5-34B-Chat-16K": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "01-ai/Yi-1.5-9B-Chat-16K": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "01-ai/Yi-1.5-6B-Chat": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "THUDM/glm-4-9b-chat": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Vendor-A/Qwen/Qwen2.5-72B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "internlm/internlm2_5-7b-chat": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "internlm/internlm2_5-20b-chat": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "meta-llama/Meta-Llama-3.1-405B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "meta-llama/Meta-Llama-3.1-70B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "meta-llama/Meta-Llama-3.1-8B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "google/gemma-2-27b-it": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "google/gemma-2-9b-it": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Pro/Qwen/Qwen2.5-7B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Pro/Qwen/Qwen2-7B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Pro/Qwen/Qwen2-1.5B-Instruct": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Pro/THUDM/chatglm3-6b": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Pro/THUDM/glm-4-9b-chat": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - "Pro/google/gemma-2-9b-it": { - "fn_with_ui": siliconflow_ui, - "fn_without_ui": siliconflow_noui, - "endpoint": siliconflow_endpoint, - "can_multi_thread": True, - "max_token": 8000, - "tokenizer": tokenizer_gpt35, - "token_cnt": get_token_num_gpt35, - }, - } - ) - + for item in (set(siliconflow_models) & set(AVAIL_LLM_MODELS)): + if "DeepSeek-R1" in item: + model_info.update( + { + item: { + "fn_with_ui": siliconflow_ui, + "fn_without_ui": siliconflow_noui, + "endpoint": siliconflow_endpoint, + "can_multi_thread": True, + "max_token": 8000, + "tokenizer": tokenizer_gpt35, + "token_cnt": get_token_num_gpt35, + "enable_reasoning": True, + }, + } + ) + else: + model_info.update( + { + item: { + "fn_with_ui": siliconflow_ui, + "fn_without_ui": siliconflow_noui, + "endpoint": siliconflow_endpoint, + "can_multi_thread": True, + "max_token": 8000, + "tokenizer": tokenizer_gpt35, + "token_cnt": get_token_num_gpt35, + }, + } + ) except: logger.error(trimmed_format_exc())