diff --git a/docs/providers-and-models.md b/docs/providers-and-models.md index 5979da345d2..8d2a17735ac 100644 --- a/docs/providers-and-models.md +++ b/docs/providers-and-models.md @@ -49,7 +49,7 @@ This document provides an overview of various AI providers and models, including |[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)|❌| |[copilot.microsoft.com](https://copilot.microsoft.com)|Optional API key|`g4f.Provider.Copilot`|`gpt-4, gpt-4o`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)| |[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)| -|[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)| +|[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)| |[chat10.free2gpt.xyz](https://chat10.free2gpt.xyz)|No auth required|`g4f.Provider.Free2GPT`|`mistral-7b`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)| |[freegptsnav.aifree.site](https://freegptsnav.aifree.site)|No auth required|`g4f.Provider.FreeGpt`|`gemini-1.5-pro`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)| |[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 |mixtral-small-28b|Mistral|2+ Providers|[mistral.ai](https://mistral.ai/news/mixtral-small-28b/)| |hermes-2-dpo|NousResearch|2+ Providers|[huggingface.co](https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO)| |phi-3.5-mini|Microsoft|1+ Providers|[huggingface.co](https://huggingface.co/microsoft/Phi-3.5-mini-instruct)| -|wizardlm-2-7b|Microsoft|1+ Providers|[wizardlm.github.io](https://wizardlm.github.io/WizardLM2/)| +|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)| |wizardlm-2-8x22b|Microsoft|2+ Providers|[wizardlm.github.io](https://wizardlm.github.io/WizardLM2/)| |gemini|Google DeepMind|1+|[deepmind.google](http://deepmind.google/technologies/gemini/)| |gemini-exp|Google DeepMind|1+ Providers|[blog.google](https://blog.google/feed/gemini-exp-1206/)| diff --git a/g4f/Provider/DeepInfraChat.py b/g4f/Provider/DeepInfraChat.py index 8c3b8af52e8..9f22ba03014 100644 --- a/g4f/Provider/DeepInfraChat.py +++ b/g4f/Provider/DeepInfraChat.py @@ -10,30 +10,30 @@ class DeepInfraChat(OpenaiTemplate): default_model = 'meta-llama/Llama-3.3-70B-Instruct-Turbo' models = [ - 'meta-llama/Llama-3.3-70B-Instruct', 'meta-llama/Meta-Llama-3.1-8B-Instruct', + 'meta-llama/Llama-3.2-90B-Vision-Instruct', default_model, - 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo', 'deepseek-ai/DeepSeek-V3', - 'Qwen/QwQ-32B-Preview', + 'mistralai/Mistral-Small-24B-Instruct-2501', + 'deepseek-ai/DeepSeek-R1', + 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B', + 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B', + 'microsoft/phi-4', 'microsoft/WizardLM-2-8x22B', - 'microsoft/WizardLM-2-7B', 'Qwen/Qwen2.5-72B-Instruct', - 'Qwen/Qwen2.5-Coder-32B-Instruct', - 'nvidia/Llama-3.1-Nemotron-70B-Instruct', ] model_aliases = { - "llama-3.3-70b": "meta-llama/Llama-3.3-70B-Instruct", "llama-3.1-8b": "meta-llama/Meta-Llama-3.1-8B-Instruct", + "llama-3.2-90b": "meta-llama/Llama-3.2-90B-Vision-Instruct", "llama-3.3-70b": "meta-llama/Llama-3.3-70B-Instruct-Turbo", - "llama-3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo", "deepseek-v3": "deepseek-ai/DeepSeek-V3", - "qwq-32b": "Qwen/QwQ-32B-Preview", + "mixtral-small-28b": "mistralai/Mistral-Small-24B-Instruct-2501", + "deepseek-r1": "deepseek-ai/DeepSeek-R1", + "deepseek-r1": "deepseek-ai/DeepSeek-R1-Distill-Llama-70B", + "deepseek-r1": "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", + "phi-4": "microsoft/phi-4", "wizardlm-2-8x22b": "microsoft/WizardLM-2-8x22B", - "wizardlm-2-7b": "microsoft/WizardLM-2-7B", "qwen-2.5-72b": "Qwen/Qwen2.5-72B-Instruct", - "qwen-2.5-coder-32b": "Qwen/Qwen2.5-Coder-32B-Instruct", - "nemotron-70b": "nvidia/Llama-3.1-Nemotron-70B-Instruct", } @classmethod @@ -41,6 +41,10 @@ async def create_async_generator( cls, model: str, messages: Messages, + stream: bool = True, + top_p: float = 0.9, + temperature: float = 0.7, + max_tokens: int = None, headers: dict = {}, **kwargs ) -> AsyncResult: diff --git a/g4f/models.py b/g4f/models.py index 195e02a246f..b3c1678a5da 100644 --- a/g4f/models.py +++ b/g4f/models.py @@ -230,7 +230,7 @@ class VisionModel(Model): llama_3_2_90b = Model( name = "llama-3.2-90b", base_provider = "Meta Llama", - best_provider = Jmuz + best_provider = IterListProvider([DeepInfraChat, Jmuz]) ) # llama 3.3 @@ -256,7 +256,7 @@ class VisionModel(Model): mixtral_small_28b = Model( name = "mixtral-small-28b", base_provider = "Mistral", - best_provider = IterListProvider([Blackbox, BlackboxAPI]) + best_provider = IterListProvider([Blackbox, BlackboxAPI, DeepInfraChat]) ) ### NousResearch ### @@ -275,13 +275,13 @@ class VisionModel(Model): best_provider = HuggingChat ) -# wizardlm -wizardlm_2_7b = Model( - name = 'wizardlm-2-7b', - base_provider = 'Microsoft', +phi_4 = Model( + name = "phi-4", + base_provider = "Microsoft", best_provider = DeepInfraChat ) +# wizardlm wizardlm_2_8x22b = Model( name = 'wizardlm-2-8x22b', base_provider = 'Microsoft', @@ -420,7 +420,7 @@ class VisionModel(Model): qwen_2_5_coder_32b = Model( name = 'qwen-2.5-coder-32b', base_provider = 'Qwen', - best_provider = IterListProvider([DeepInfraChat, PollinationsAI, Jmuz, HuggingChat]) + best_provider = IterListProvider([PollinationsAI, Jmuz, HuggingChat]) ) qwen_2_5_1m = Model( name = 'qwen-2.5-1m-demo', @@ -432,7 +432,7 @@ class VisionModel(Model): qwq_32b = Model( name = 'qwq-32b', base_provider = 'Qwen', - best_provider = IterListProvider([Blackbox, BlackboxAPI, DeepInfraChat, Jmuz, HuggingChat]) + best_provider = IterListProvider([Blackbox, BlackboxAPI, Jmuz, HuggingChat]) ) qvq_72b = VisionModel( name = 'qvq-72b', @@ -463,7 +463,7 @@ class VisionModel(Model): deepseek_r1 = Model( name = 'deepseek-r1', base_provider = 'DeepSeek', - best_provider = IterListProvider([Blackbox, BlackboxAPI, Glider, PollinationsAI, Jmuz, CablyAI, Liaobots, HuggingChat, HuggingFace]) + best_provider = IterListProvider([Blackbox, BlackboxAPI, DeepInfraChat, Glider, PollinationsAI, Jmuz, CablyAI, Liaobots, HuggingChat, HuggingFace]) ) ### x.ai ### @@ -496,7 +496,7 @@ class VisionModel(Model): nemotron_70b = Model( name = 'nemotron-70b', base_provider = 'Nvidia', - best_provider = IterListProvider([DeepInfraChat, HuggingChat, HuggingFace]) + best_provider = IterListProvider([HuggingChat, HuggingFace]) ) ### Databricks ### @@ -645,9 +645,9 @@ class ModelUtils: ### Microsoft ### # phi phi_3_5_mini.name: phi_3_5_mini, + phi_4.name: phi_4, # wizardlm - wizardlm_2_7b.name: wizardlm_2_7b, wizardlm_2_8x22b.name: wizardlm_2_8x22b, ### Google ###