XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update g4f/Provider/DeepInfraChat.py

95821b5b
kqlio67 <>
提交于

代码差异

3 个文件 +29 -25
Modified docs/providers-and-models.md +2 -2
@@ -49,7 +49,7 @@ This document provides an overview of various AI providers and models, including
49 49 |[playground.ai.cloudflare.com](https://playground.ai.cloudflare.com)|[Automatic cookies](https://playground.ai.cloudflare.com)|`g4f.Provider.Cloudflare`|`llama-2-7b, llama-3-8b, llama-3.1-8b, llama-3.2-1b, qwen-1.5-7b`|❌|❌|✔|![Error](https://img.shields.io/badge/Active-brightgreen)|❌|
50 50 |[copilot.microsoft.com](https://copilot.microsoft.com)|Optional API key|`g4f.Provider.Copilot`|`gpt-4, gpt-4o`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
51 51 |[duckduckgo.com/aichat](https://duckduckgo.com/aichat)|No auth required|`g4f.Provider.DDG`|`gpt-4, gpt-4o-mini, claude-3-haiku, llama-3.1-70b, mixtral-8x7b`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
52 |[deepinfra.com/chat](https://deepinfra.com/chat)|No auth required|`g4f.Provider.DeepInfraChat`|`llama-3.1-8b, llama-3.1-70b, deepseek-chat, qwq-32b, wizardlm-2-8x22b, wizardlm-2-7b, qwen-2.5-72b, qwen-2.5-coder-32b, nemotron-70b`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
52 |[deepinfra.com/chat](https://deepinfra.com/chat)|No auth required|`g4f.Provider.DeepInfraChat`|`llama-3.1-8b, llama-3.2-90b, llama-3.3-70b, deepseek-v3, mixtral-small-28b, deepseek-r1, phi-4, wizardlm-2-8x22b, qwen-2.5-72b`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
53 53 |[chat10.free2gpt.xyz](https://chat10.free2gpt.xyz)|No auth required|`g4f.Provider.Free2GPT`|`mistral-7b`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
54 54 |[freegptsnav.aifree.site](https://freegptsnav.aifree.site)|No auth required|`g4f.Provider.FreeGpt`|`gemini-1.5-pro`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
55 55 |[app.giz.ai/assistant](https://app.giz.ai/assistant)|No auth required|`g4f.Provider.GizAI`|`gemini-1.5-flash`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
@@ -149,7 +149,7 @@ This document provides an overview of various AI providers and models, including
149 149 |mixtral-small-28b|Mistral|2+ Providers|[mistral.ai](https://mistral.ai/news/mixtral-small-28b/)|
150 150 |hermes-2-dpo|NousResearch|2+ Providers|[huggingface.co](https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO)|
151 151 |phi-3.5-mini|Microsoft|1+ Providers|[huggingface.co](https://huggingface.co/microsoft/Phi-3.5-mini-instruct)|
152 |wizardlm-2-7b|Microsoft|1+ Providers|[wizardlm.github.io](https://wizardlm.github.io/WizardLM2/)|
152 |phi-4|Microsoft|1+ Providers|[techcommunity.microsoft.com](https://techcommunity.microsoft.com/blog/aiplatformblog/introducing-phi-4-microsoft%E2%80%99s-newest-small-language-model-specializing-in-comple/4357090)|
153 153 |wizardlm-2-8x22b|Microsoft|2+ Providers|[wizardlm.github.io](https://wizardlm.github.io/WizardLM2/)|
154 154 |gemini|Google DeepMind|1+|[deepmind.google](http://deepmind.google/technologies/gemini/)|
155 155 |gemini-exp|Google DeepMind|1+ Providers|[blog.google](https://blog.google/feed/gemini-exp-1206/)|
Modified g4f/Provider/DeepInfraChat.py +16 -12
@@ -10,30 +10,30 @@ class DeepInfraChat(OpenaiTemplate):
10 10
11 11 default_model = 'meta-llama/Llama-3.3-70B-Instruct-Turbo'
12 12 models = [
13 'meta-llama/Llama-3.3-70B-Instruct',
14 13 'meta-llama/Meta-Llama-3.1-8B-Instruct',
14 'meta-llama/Llama-3.2-90B-Vision-Instruct',
15 15 default_model,
16 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
17 16 'deepseek-ai/DeepSeek-V3',
18 'Qwen/QwQ-32B-Preview',
17 'mistralai/Mistral-Small-24B-Instruct-2501',
18 'deepseek-ai/DeepSeek-R1',
19 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
20 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
21 'microsoft/phi-4',
19 22 'microsoft/WizardLM-2-8x22B',
20 'microsoft/WizardLM-2-7B',
21 23 'Qwen/Qwen2.5-72B-Instruct',
22 'Qwen/Qwen2.5-Coder-32B-Instruct',
23 'nvidia/Llama-3.1-Nemotron-70B-Instruct',
24 24 ]
25 25 model_aliases = {
26 "llama-3.3-70b": "meta-llama/Llama-3.3-70B-Instruct",
27 26 "llama-3.1-8b": "meta-llama/Meta-Llama-3.1-8B-Instruct",
27 "llama-3.2-90b": "meta-llama/Llama-3.2-90B-Vision-Instruct",
28 28 "llama-3.3-70b": "meta-llama/Llama-3.3-70B-Instruct-Turbo",
29 "llama-3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
30 29 "deepseek-v3": "deepseek-ai/DeepSeek-V3",
31 "qwq-32b": "Qwen/QwQ-32B-Preview",
30 "mixtral-small-28b": "mistralai/Mistral-Small-24B-Instruct-2501",
31 "deepseek-r1": "deepseek-ai/DeepSeek-R1",
32 "deepseek-r1": "deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
33 "deepseek-r1": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
34 "phi-4": "microsoft/phi-4",
32 35 "wizardlm-2-8x22b": "microsoft/WizardLM-2-8x22B",
33 "wizardlm-2-7b": "microsoft/WizardLM-2-7B",
34 36 "qwen-2.5-72b": "Qwen/Qwen2.5-72B-Instruct",
35 "qwen-2.5-coder-32b": "Qwen/Qwen2.5-Coder-32B-Instruct",
36 "nemotron-70b": "nvidia/Llama-3.1-Nemotron-70B-Instruct",
37 37 }
38 38
39 39 @classmethod
@@ -41,6 +41,10 @@ class DeepInfraChat(OpenaiTemplate):
41 41 cls,
42 42 model: str,
43 43 messages: Messages,
44 stream: bool = True,
45 top_p: float = 0.9,
46 temperature: float = 0.7,
47 max_tokens: int = None,
44 48 headers: dict = {},
45 49 **kwargs
46 50 ) -> AsyncResult:
Modified g4f/models.py +11 -11
@@ -230,7 +230,7 @@ llama_3_2_11b = VisionModel(
230 230 llama_3_2_90b = Model(
231 231 name = "llama-3.2-90b",
232 232 base_provider = "Meta Llama",
233 best_provider = Jmuz
233 best_provider = IterListProvider([DeepInfraChat, Jmuz])
234 234 )
235 235
236 236 # llama 3.3
@@ -256,7 +256,7 @@ mistral_nemo = Model(
256 256 mixtral_small_28b = Model(
257 257 name = "mixtral-small-28b",
258 258 base_provider = "Mistral",
259 best_provider = IterListProvider([Blackbox, BlackboxAPI])
259 best_provider = IterListProvider([Blackbox, BlackboxAPI, DeepInfraChat])
260 260 )
261 261
262 262 ### NousResearch ###
@@ -275,13 +275,13 @@ phi_3_5_mini = Model(
275 275 best_provider = HuggingChat
276 276 )
277 277
278 # wizardlm
279 wizardlm_2_7b = Model(
280 name = 'wizardlm-2-7b',
281 base_provider = 'Microsoft',
278 phi_4 = Model(
279 name = "phi-4",
280 base_provider = "Microsoft",
282 281 best_provider = DeepInfraChat
283 282 )
284 283
284 # wizardlm
285 285 wizardlm_2_8x22b = Model(
286 286 name = 'wizardlm-2-8x22b',
287 287 base_provider = 'Microsoft',
@@ -420,7 +420,7 @@ qwen_2_5_72b = Model(
420 420 qwen_2_5_coder_32b = Model(
421 421 name = 'qwen-2.5-coder-32b',
422 422 base_provider = 'Qwen',
423 best_provider = IterListProvider([DeepInfraChat, PollinationsAI, Jmuz, HuggingChat])
423 best_provider = IterListProvider([PollinationsAI, Jmuz, HuggingChat])
424 424 )
425 425 qwen_2_5_1m = Model(
426 426 name = 'qwen-2.5-1m-demo',
@@ -432,7 +432,7 @@ qwen_2_5_1m = Model(
432 432 qwq_32b = Model(
433 433 name = 'qwq-32b',
434 434 base_provider = 'Qwen',
435 best_provider = IterListProvider([Blackbox, BlackboxAPI, DeepInfraChat, Jmuz, HuggingChat])
435 best_provider = IterListProvider([Blackbox, BlackboxAPI, Jmuz, HuggingChat])
436 436 )
437 437 qvq_72b = VisionModel(
438 438 name = 'qvq-72b',
@@ -463,7 +463,7 @@ deepseek_v3 = Model(
463 463 deepseek_r1 = Model(
464 464 name = 'deepseek-r1',
465 465 base_provider = 'DeepSeek',
466 best_provider = IterListProvider([Blackbox, BlackboxAPI, Glider, PollinationsAI, Jmuz, CablyAI, Liaobots, HuggingChat, HuggingFace])
466 best_provider = IterListProvider([Blackbox, BlackboxAPI, DeepInfraChat, Glider, PollinationsAI, Jmuz, CablyAI, Liaobots, HuggingChat, HuggingFace])
467 467 )
468 468
469 469 ### x.ai ###
@@ -496,7 +496,7 @@ sonar_reasoning = Model(
496 496 nemotron_70b = Model(
497 497 name = 'nemotron-70b',
498 498 base_provider = 'Nvidia',
499 best_provider = IterListProvider([DeepInfraChat, HuggingChat, HuggingFace])
499 best_provider = IterListProvider([HuggingChat, HuggingFace])
500 500 )
501 501
502 502 ### Databricks ###
@@ -645,9 +645,9 @@ class ModelUtils:
645 645 ### Microsoft ###
646 646 # phi
647 647 phi_3_5_mini.name: phi_3_5_mini,
648 phi_4.name: phi_4,
648 649
649 650 # wizardlm
650 wizardlm_2_7b.name: wizardlm_2_7b,
651 651 wizardlm_2_8x22b.name: wizardlm_2_8x22b,
652 652
653 653 ### Google ###