14
14
from langchain_ollama import ChatOllama
15
15
from langchain_openai import AzureChatOpenAI , ChatOpenAI
16
16
17
- from .llm import DeepSeekR1ChatOpenAI , DeepSeekR1ChatOllama
17
+ from .llm import DeepSeekR1ChatOpenAI , DeepSeekR1ChatOllama , SiliconFlowChat
18
18
19
19
PROVIDER_DISPLAY_NAMES = {
20
20
"openai" : "OpenAI" ,
@@ -165,9 +165,26 @@ def get_llm_model(provider: str, **kwargs):
165
165
return ChatOpenAI (
166
166
model = kwargs .get ("model_name" , "gpt-4o-mini" ),
167
167
temperature = kwargs .get ("temperature" , 0.0 ),
168
- base_url = os .getenv ("UNBOUND_ENDPOINT" , "https://api.getunbound.ai" ),
168
+ base_url = os .getenv ("UNBOUND_ENDPOINT" , "https://api.getunbound.ai" ),
169
169
api_key = api_key ,
170
170
)
171
+ elif provider == "siliconflow" :
172
+ if not kwargs .get ("api_key" , "" ):
173
+ api_key = os .getenv ("SiliconFLOW_API_KEY" , "" )
174
+ else :
175
+ api_key = kwargs .get ("api_key" )
176
+ if not kwargs .get ("base_url" , "" ):
177
+ base_url = os .getenv ("SiliconFLOW_ENDPOINT" , "" )
178
+ else :
179
+ base_url = kwargs .get ("base_url" )
180
+ return SiliconFlowChat (
181
+ api_key = api_key ,
182
+ base_url = base_url ,
183
+ model_name = kwargs .get ("model_name" , "Qwen/QwQ-32B" ),
184
+ temperature = kwargs .get ("temperature" , 0.0 ),
185
+ max_tokens = kwargs .get ("max_tokens" , 512 ),
186
+ frequency_penalty = kwargs .get ("frequency_penalty" , 0.5 ),
187
+ )
171
188
else :
172
189
raise ValueError (f"Unsupported provider: { provider } " )
173
190
@@ -185,7 +202,40 @@ def get_llm_model(provider: str, **kwargs):
185
202
"mistral" : ["pixtral-large-latest" , "mistral-large-latest" , "mistral-small-latest" , "ministral-8b-latest" ],
186
203
"alibaba" : ["qwen-plus" , "qwen-max" , "qwen-turbo" , "qwen-long" ],
187
204
"moonshot" : ["moonshot-v1-32k-vision-preview" , "moonshot-v1-8k-vision-preview" ],
188
- "unbound" : ["gemini-2.0-flash" ,"gpt-4o-mini" , "gpt-4o" , "gpt-4.5-preview" ]
205
+ "unbound" : ["gemini-2.0-flash" , "gpt-4o-mini" , "gpt-4o" , "gpt-4.5-preview" ],
206
+ "siliconflow" : [
207
+ "deepseek-ai/DeepSeek-R1" ,
208
+ "deepseek-ai/DeepSeek-V3" ,
209
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B" ,
210
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B" ,
211
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B" ,
212
+ "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B" ,
213
+ "deepseek-ai/DeepSeek-V2.5" ,
214
+ "deepseek-ai/deepseek-vl2" ,
215
+ "Qwen/Qwen2.5-72B-Instruct-128K" ,
216
+ "Qwen/Qwen2.5-72B-Instruct" ,
217
+ "Qwen/Qwen2.5-32B-Instruct" ,
218
+ "Qwen/Qwen2.5-14B-Instruct" ,
219
+ "Qwen/Qwen2.5-7B-Instruct" ,
220
+ "Qwen/Qwen2.5-Coder-32B-Instruct" ,
221
+ "Qwen/Qwen2.5-Coder-7B-Instruct" ,
222
+ "Qwen/Qwen2-7B-Instruct" ,
223
+ "Qwen/Qwen2-1.5B-Instruct" ,
224
+ "Qwen/QwQ-32B-Preview" ,
225
+ "Qwen/Qwen2-VL-72B-Instruct" ,
226
+ "Qwen/Qwen2.5-VL-32B-Instruct" ,
227
+ "Qwen/Qwen2.5-VL-72B-Instruct" ,
228
+ "TeleAI/TeleChat2" ,
229
+ "THUDM/glm-4-9b-chat" ,
230
+ "Vendor-A/Qwen/Qwen2.5-72B-Instruct" ,
231
+ "internlm/internlm2_5-7b-chat" ,
232
+ "internlm/internlm2_5-20b-chat" ,
233
+ "Pro/Qwen/Qwen2.5-7B-Instruct" ,
234
+ "Pro/Qwen/Qwen2-7B-Instruct" ,
235
+ "Pro/Qwen/Qwen2-1.5B-Instruct" ,
236
+ "Pro/THUDM/chatglm3-6b" ,
237
+ "Pro/THUDM/glm-4-9b-chat" ,
238
+ ],
189
239
}
190
240
191
241
0 commit comments