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

XFEstudio/gpt4free

docs: update providers documentation and enhance support for Blackbox HAR auth

- Added "No auth / HAR file" authentication type in providers-and-models.md - Added "Video generation" column to provider tables for future capability - Updated model counts and provider capabilities throughout documentation - Fixed ARTA provider with improved error handling and response validation - Enhanced AllenAI provider with vision model support and proper image handling - Significantly improved Blackbox provider: - Added HAR file authentication support - Added subscription status checking - Added premium/demo model differentiation - Improved session handling and error recovery - Enhanced DDG provider with better error handling for challenges - Improved PollinationsAI and PollinationsImage providers' model handling - Added VideoModel class in g4f/models.py - Added audio/video generation indicators in GUI components - Added new Ai2 models: olmo-1-7b, olmo-2-32b, olmo-4-synthetic - Added new commit message generation tool in etc/tool/commit.py

54ef1a51
kqlio67 <kqlio67@users.noreply.github.com>
提交于

代码差异

12 个文件 +929 -429
Modified docs/providers-and-models.md +102 -97
@@ -26,6 +26,7 @@ This document provides an overview of various AI providers and models, including
26 26 - **Optional API key** - Works without authentication, but you can provide an API key for better rate limits or additional features. The service is usable without an API key.
27 27 - **API key / Cookies** - Supports both authentication methods. You can use either an API key or browser cookies for authentication.
28 28 - **No auth required** - No authentication needed. The service is publicly available without any credentials.
29 - **No auth / HAR file** - Supports both authentication methods. The service works without authentication, but you can also use HAR file authentication for potentially enhanced features or capabilities.
29 30
30 31 **Symbols:**
31 32 - ✔ - Feature is supported
@@ -34,108 +35,110 @@ This document provides an overview of various AI providers and models, including
34 35
35 36 ---
36 37 ### Providers No auth required
37 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Vision (Image Upload) | Status |
38 |----------|-------------|--------------|---------------|--------|--------|------|------|
39 |[playground.allenai.org](https://playground.allenai.org)|No auth required|`g4f.Provider.AllenAI`|`tulu-3-405b, olmo-2-13b, tulu-3-1-8b, tulu-3-70b, olmoe-0125`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
40 |[ai-arta.com](https://ai-arta.com)|No auth required|`g4f.Provider.ARTA`|❌|✔ _**(17+)**_|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
41 |[blackbox.ai](https://www.blackbox.ai)|No auth required|`g4f.Provider.Blackbox`|`blackboxai, blackboxai-pro, gpt-4o-mini, deepseek-chat, deepseek-v3, deepseek-r1, gpt-4o, o1, o3-mini, claude-3.7-sonnet` _**(40+)**_|`flux`|❌|`blackboxai, gpt-4o, o1, o3-mini, deepseek-v3` _**(7+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
42 |[chatglm.cn](https://chatglm.cn)|No auth required|`g4f.Provider.ChatGLM`|`glm-4`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
43 |[chatgpt.com](https://chatgpt.com)|No auth required|`g4f.Provider.ChatGpt`|✔ _**(7+)**_|❌|❌|❌|![Error](https://img.shields.io/badge/HTTPError-f48d37)|
44 |[chatgpt.es](https://chatgpt.es)|No auth required|`g4f.Provider.ChatGptEs`|`gpt-4, gpt-4o, gpt-4o-mini`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
45 |[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)|
46 |[copilot.microsoft.com](https://copilot.microsoft.com)|Optional API key|`g4f.Provider.Copilot`|`gpt-4, o1`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
47 |[duckduckgo.com/aichat](https://duckduckgo.com/aichat)|No auth required|`g4f.Provider.DDG`|`gpt-4, gpt-4o-mini, llama-3.3-70b, claude-3-haiku, o3-mini, mixtral-small-24b`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
48 |[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-24b, deepseek-r1, phi-4, wizardlm-2-8x22b, qwen-2.5-72b, yi-34b, qwen-2-72b, dolphin-2.6, dolphin-2.9, dbrx-instruct, airoboros-70b, lzlv-70b, wizardlm-2-7b, mixtral-8x22b, minicpm-2.5`|❌|❌|`llama-3.2-90b, minicpm-2.5`|![](https://img.shields.io/badge/Active-brightgreen)|
49 |[dynaspark.onrender.com](https://dynaspark.onrender.com)|No auth required|`g4f.Provider.Dynaspark`|`gemini-1.5-flash, gemini-2.0-flash`|❌|❌|`gemini-1.5-flash, gemini-2.0-flash`|![](https://img.shields.io/badge/Active-brightgreen)|
50 |[chat10.free2gpt.xyz](https://chat10.free2gpt.xyz)|No auth required|`g4f.Provider.Free2GPT`|`gemini-1.5-pro, gemini-1.5-flash`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
51 |[freegptsnav.aifree.site](https://freegptsnav.aifree.site)|No auth required|`g4f.Provider.FreeGpt`|`gemini-1.5-pro, gemini-1.5-flash`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
52 |[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)|
53 |[glider.so](https://glider.so)|No auth required|`g4f.Provider.Glider`|`llama-3.1-70b, llama-3.1-8b, llama-3.2-3b, deepseek-r1`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
54 |[goabror.uz](https://goabror.uz)|No auth required|`g4f.Provider.Goabror`|`gpt-4`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
55 |[hailuo.ai](https://www.hailuo.ai)|No auth required|`g4f.Provider.HailuoAI`|`MiniMax` _**(1+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
56 |[editor.imagelabs.net](editor.imagelabs.net)|No auth required|`g4f.Provider.ImageLabs`|❌|`sdxl-turbo`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
57 |[huggingface.co/spaces](https://huggingface.co/spaces)|Optional API key|`g4f.Provider.HuggingSpace`|`qvq-72b, qwen-2-72b, command-r, command-r-plus, command-r7b, command-a`|`flux-dev, flux-schnell, sd-3.5`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
58 |[jmuz.me](https://jmuz.me)|Optional API key|`g4f.Provider.Jmuz`|`claude-3-haiku, claude-3-opus, claude-3.5-sonnet, deepseek-r1, deepseek-chat, gemini-exp, gemini-1.5-flash, gemini-1.5-pro, gemini-2.0-flash-thinking, gpt-4, gpt-4o, gpt-4o-mini, llama-3-70b, llama-3-8b, llama-3.1-405b, llama-3.1-70b, llama-3.1-8b, llama-3.2-11b, llama-3.2-90b, llama-3.3-70b, mixtral-8x7b, qwen-2.5-72b, qwen-2.5-coder-32b, qwq-32b, wizardlm-2-8x22b`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
59 |[lambda.chat](https://lambda.chat)|No auth required|`g4f.Provider.LambdaChat`|`deepseek-v3, deepseek-r1, hermes-3, nemotron-70b, llama-3.3-70b`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
60 |[liaobots.work](https://liaobots.work)|[Automatic cookies](https://liaobots.work)|`g4f.Provider.Liaobots`|`claude-3.5-sonnet, claude-3.7-sonnet, claude-3.7-sonnet-thinking, claude-3-opus, claude-3-sonnet, deepseek-r1, deepseek-v3, gemini-2.0-flash, gemini-2.0-flash-thinking, gemini-2.0-pro, gpt-4, gpt-4o, gpt-4o-mini, grok-3, grok-3-r1, o3-mini`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
61 |[oi-vscode-server.onrender.com](https://oi-vscode-server.onrender.com)|No auth required|`g4f.Provider.OIVSCode`|`gpt-4o-mini, deepseek-v3`|❌|❌|`gpt-4o-mini`|![](https://img.shields.io/badge/Active-brightgreen)|
62 |[labs.perplexity.ai](https://labs.perplexity.ai)|No auth required|`g4f.Provider.PerplexityLabs`|`sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro`|❌|❌|❌|![Error](https://img.shields.io/badge/Active-brightgreen)|
63 |[pi.ai/talk](https://pi.ai/talk)|[Manual cookies](https://pi.ai/talk)|`g4f.Provider.Pi`|`pi`|❌|❌|❌|![Error](https://img.shields.io/badge/Active-brightgreen)|
64 |[pizzagpt.it](https://www.pizzagpt.it)|No auth required|`g4f.Provider.Pizzagpt`|`gpt-4o-mini`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
65 |[pollinations.ai](https://pollinations.ai)|No auth required|`g4f.Provider.PollinationsAI`|`gpt-4o-mini, gpt-4o, o1-mini, qwen-2.5-coder-32b, llama-3.3-70b, mistral-nemo, llama-3.1-8b, deepseek-r1, phi-4` _**(9+)**_|`flux, flux-pro, flux-dev, flux-schnell, dall-e-3, sdxl-turbo`|`gpt-4o-audio`|`gpt-4o, gpt-4o-mini, o1-mini, o3-mini`|![](https://img.shields.io/badge/Active-brightgreen)|
66 |[pollinations.ai](https://pollinations.ai)|No auth required|`g4f.Provider.PollinationsImage`|❌|`flux, flux-pro, flux-dev, flux-schnell, dall-e-3, sdxl-turbo`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
67 |[teach-anything.com](https://www.teach-anything.com)|No auth required|`g4f.Provider.TeachAnything`|`gemini-1.5-pro, gemini-1.5-flash`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
68 |[chat.typegpt.net](https://chat.typegpt.net)|No auth required|`g4f.Provider.TypeGPT`|`gpt-3.5-turbo, o3-mini, deepseek-r1, deepseek-v3, evil, o1`|❌|❌|`gpt-3.5-turbo, o3-mini`|![](https://img.shields.io/badge/Active-brightgreen)|
69 |[you.com](https://you.com)|[Manual cookies](https://you.com)|`g4f.Provider.You`|✔|✔|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
70 |[websim.ai](https://websim.ai)|No auth required|`g4f.Provider.Websim`|`gemini-1.5-pro, gemini-1.5-flash`|`flux`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
71 |[chat9.yqcloud.top](https://chat9.yqcloud.top)|No auth required|`g4f.Provider.Yqcloud`|`gpt-4`|✔|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
38 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
39 |----------|-------------|--------------|---------------|--------|--------|------|------|------|
40 |[playground.allenai.org](https://playground.allenai.org)|No auth required|`g4f.Provider.AllenAI`|`tulu-3-405b, olmo-2-13b, tulu-3-1-8b, tulu-3-70b, olmoe-0125, olmo-2-32b`|❌|❌|❌|`olmo-4-synthetic`|![](https://img.shields.io/badge/Active-brightgreen)|
41 |[ai-arta.com](https://ai-arta.com)|No auth required|`g4f.Provider.ARTA`|❌|`flux` _**(16+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
42 |[blackbox.ai](https://www.blackbox.ai)|No auth / HAR file|`g4f.Provider.Blackbox`|`blackboxai, blackboxai-pro, gpt-4o-mini, deepseek-chat, deepseek-v3, deepseek-r1, gpt-4o, o1, o3-mini, claude-3.7-sonnet, llama-3.3-70b, mixtral-small-24b, qwq-32b` _**(40+)**_|`flux`|❌|❌|`blackboxai, gpt-4o, o1, o3-mini, deepseek-v3` _**(7+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
43 |[chatglm.cn](https://chatglm.cn)|No auth required|`g4f.Provider.ChatGLM`|`glm-4`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
44 |[chatgpt.com](https://chatgpt.com)|No auth required|`g4f.Provider.ChatGpt`|✔ _**(7+)**_|❌|❌|❌|❌|![Error](https://img.shields.io/badge/HTTPError-f48d37)|
45 |[chatgpt.es](https://chatgpt.es)|No auth required|`g4f.Provider.ChatGptEs`|`gpt-4, gpt-4o, gpt-4o-mini`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
46 |[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)|
47 |[copilot.microsoft.com](https://copilot.microsoft.com)|Optional API key|`g4f.Provider.Copilot`|`gpt-4, o1`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
48 |[duckduckgo.com/aichat](https://duckduckgo.com/aichat)|No auth required|`g4f.Provider.DDG`|`gpt-4, gpt-4o-mini, llama-3.3-70b, claude-3-haiku, o3-mini, mixtral-small-24b`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
49 |[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-24b, deepseek-r1, phi-4, wizardlm-2-8x22b, qwen-2.5-72b, yi-34b, qwen-2-72b, dolphin-2.6, dolphin-2.9, dbrx-instruct, airoboros-70b, lzlv-70b, wizardlm-2-7b, mixtral-8x22b, minicpm-2.5`|❌|❌|❌|`llama-3.2-90b, minicpm-2.5`|![](https://img.shields.io/badge/Active-brightgreen)|
50 |[dynaspark.onrender.com](https://dynaspark.onrender.com)|No auth required|`g4f.Provider.Dynaspark`|`gemini-1.5-flash, gemini-2.0-flash`|❌|❌|❌|`gemini-1.5-flash, gemini-2.0-flash`|![](https://img.shields.io/badge/Active-brightgreen)|
51 |[chat10.free2gpt.xyz](https://chat10.free2gpt.xyz)|No auth required|`g4f.Provider.Free2GPT`|`gemini-1.5-pro, gemini-1.5-flash`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
52 |[freegptsnav.aifree.site](https://freegptsnav.aifree.site)|No auth required|`g4f.Provider.FreeGpt`|`gemini-1.5-pro, gemini-1.5-flash`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
53 |[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)|
54 |[glider.so](https://glider.so)|No auth required|`g4f.Provider.Glider`|`llama-3.1-70b, llama-3.1-8b, llama-3.2-3b, deepseek-r1`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
55 |[goabror.uz](https://goabror.uz)|No auth required|`g4f.Provider.Goabror`|`gpt-4`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
56 |[hailuo.ai](https://www.hailuo.ai)|No auth required|`g4f.Provider.HailuoAI`|`MiniMax` _**(1+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
57 |[editor.imagelabs.net](editor.imagelabs.net)|No auth required|`g4f.Provider.ImageLabs`|❌|`sdxl-turbo`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
58 |[huggingface.co/spaces](https://huggingface.co/spaces)|Optional API key|`g4f.Provider.HuggingSpace`|`qvq-72b, qwen-2-72b, command-r, command-r-plus, command-r7b, command-a`|`flux-dev, flux-schnell, sd-3.5`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
59 |[jmuz.me](https://jmuz.me)|Optional API key|`g4f.Provider.Jmuz`|`claude-3-haiku, claude-3-opus, claude-3.5-sonnet, deepseek-r1, deepseek-chat, gemini-exp, gemini-1.5-flash, gemini-1.5-pro, gemini-2.0-flash-thinking, gpt-4, gpt-4o, gpt-4o-mini, llama-3-70b, llama-3-8b, llama-3.1-405b, llama-3.1-70b, llama-3.1-8b, llama-3.2-11b, llama-3.2-90b, llama-3.3-70b, mixtral-8x7b, qwen-2.5-72b, qwen-2.5-coder-32b, qwq-32b, wizardlm-2-8x22b`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
60 |[lambda.chat](https://lambda.chat)|No auth required|`g4f.Provider.LambdaChat`|`deepseek-v3, deepseek-r1, hermes-3, nemotron-70b, llama-3.3-70b`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
61 |[liaobots.work](https://liaobots.work)|[Automatic cookies](https://liaobots.work)|`g4f.Provider.Liaobots`|`claude-3.5-sonnet, claude-3.7-sonnet, claude-3.7-sonnet-thinking, claude-3-opus, claude-3-sonnet, deepseek-r1, deepseek-v3, gemini-2.0-flash, gemini-2.0-flash-thinking, gemini-2.0-pro, gpt-4, gpt-4o, gpt-4o-mini, grok-3, grok-3-r1, o3-mini`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
62 |[oi-vscode-server.onrender.com](https://oi-vscode-server.onrender.com)|No auth required|`g4f.Provider.OIVSCode`|`gpt-4o-mini, deepseek-v3`|❌|❌|❌|`gpt-4o-mini`|![](https://img.shields.io/badge/Active-brightgreen)|
63 |[labs.perplexity.ai](https://labs.perplexity.ai)|No auth required|`g4f.Provider.PerplexityLabs`|`sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro`|❌|❌|❌|❌|![Error](https://img.shields.io/badge/Active-brightgreen)|
64 |[pi.ai/talk](https://pi.ai/talk)|[Manual cookies](https://pi.ai/talk)|`g4f.Provider.Pi`|`pi`|❌|❌|❌|❌|![Error](https://img.shields.io/badge/Active-brightgreen)|
65 |[pizzagpt.it](https://www.pizzagpt.it)|No auth required|`g4f.Provider.Pizzagpt`|`gpt-4o-mini`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
66 |[pollinations.ai](https://pollinations.ai)|No auth required|`g4f.Provider.PollinationsAI`|`gpt-4o-mini, gpt-4o, o1-mini, qwen-2.5-coder-32b, llama-3.3-70b, mistral-nemo, llama-3.1-8b, deepseek-r1, phi-4. qwq-32b, deepseek-v3, llama-3.2-11b` _**(9+)**_|`flux, flux-pro, flux-dev, flux-schnell, dall-e-3, sdxl-turbo`|`gpt-4o-audio` _**(3+)**_|❌|`gpt-4o, gpt-4o-mini, o1-mini, o3-mini`|![](https://img.shields.io/badge/Active-brightgreen)|
67 |[pollinations.ai](https://pollinations.ai)|No auth required|`g4f.Provider.PollinationsImage`|❌|`flux, flux-pro, flux-dev, flux-schnell, dall-e-3, sdxl-turbo`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
68 |[teach-anything.com](https://www.teach-anything.com)|No auth required|`g4f.Provider.TeachAnything`|`gemini-1.5-pro, gemini-1.5-flash`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
69 |[chat.typegpt.net](https://chat.typegpt.net)|No auth required|`g4f.Provider.TypeGPT`|`gpt-3.5-turbo, o3-mini, deepseek-r1, deepseek-v3, evil, o1`|❌|❌|❌|`gpt-3.5-turbo, o3-mini`|![](https://img.shields.io/badge/Active-brightgreen)|
70 |[you.com](https://you.com)|[Manual cookies](https://you.com)|`g4f.Provider.You`|✔|✔|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
71 |[websim.ai](https://websim.ai)|No auth required|`g4f.Provider.Websim`|`gemini-1.5-pro, gemini-1.5-flash`|`flux`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
72 |[chat9.yqcloud.top](https://chat9.yqcloud.top)|No auth required|`g4f.Provider.Yqcloud`|`gpt-4`|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
72 73
73 74 ---
74 75 ### Providers HuggingFace
75 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Vision (Image Upload) | Status |
76 |----------|-------------|--------------|---------------|--------|--------|------|------|
77 |[huggingface.co/chat](https://huggingface.co/chat)|[Manual cookies](https://huggingface.co/chat)|`g4f.Provider.HuggingChat`|`qwen-2.5-72b, llama-3.3-70b, command-r-plus, deepseek-r1, qwq-32b, nemotron-70b, llama-3.2-11b, mistral-nemo, phi-3.5-mini`|`flux-dev, flux-schnell`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
78 |[huggingface.co/chat](https://huggingface.co/chat)|[API key / Cookies](https://huggingface.co/settings/tokens)|`g4f.Provider.HuggingFace`|✔ _**(47+)**_|✔ _**(9+)**_|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
79 |[api-inference.huggingface.co](https://api-inference.huggingface.co)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.HuggingFaceAPI`|✔ _**(9+)**_|✔ _**(2+)**_|❌|✔ _**(1+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
76 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
77 |----------|-------------|--------------|---------------|--------|--------|------|------|------|
78 |[huggingface.co/chat](https://huggingface.co/chat)|[Manual cookies](https://huggingface.co/chat)|`g4f.Provider.HuggingChat`|`qwen-2.5-72b, llama-3.3-70b, command-r-plus, deepseek-r1, qwq-32b, nemotron-70b, llama-3.2-11b, mistral-nemo, phi-3.5-mini`|`flux-dev, flux-schnell`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
79 |[huggingface.co/chat](https://huggingface.co/chat)|[API key / Cookies](https://huggingface.co/settings/tokens)|`g4f.Provider.HuggingFace`|✔ _**(47+)**_|✔ _**(9+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
80 |[api-inference.huggingface.co](https://api-inference.huggingface.co)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.HuggingFaceAPI`|✔ _**(9+)**_|✔ _**(2+)**_|❌|❌|✔ _**(1+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
80 81
81 82 ---
82 83 ### Providers HuggingSpace
83 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Vision (Image Upload) | Status |
84 |----------|-------------|--------------|---------------|--------|--------|------|------|
85 |[black-forest-labs-flux-1-dev.hf.space](https://black-forest-labs-flux-1-dev.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.BlackForestLabs_Flux1Dev`|❌|`flux, flux-dev`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
86 |[black-forest-labs-flux-1-schnell.hf.space](https://black-forest-labs-flux-1-schnell.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.BlackForestLabs_Flux1Schnell`|❌|`flux, flux-schnell`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
87 |[cohereforai-c4ai-command.hf.space](https://cohereforai-c4ai-command.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.CohereForAI_C4AI_Command`|`command-r, command-r-plus, command-r7b`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
88 |[huggingface.co/spaces/deepseek-ai/Janus-Pro-7B](https://huggingface.co/spaces/deepseek-ai/Janus-Pro-7B)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.DeepseekAI_Janus_Pro_7b`|✔|✔|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
89 |[roxky-flux-1-dev.hf.space](https://roxky-flux-1-dev.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.G4F`|✔ _**(1+)**_|✔ _**(4+)**_|❌|✔ _**(1+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
90 |[microsoft-phi-4-multimodal.hf.space](https://microsoft-phi-4-multimodal.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Microsoft_Phi_4`|`phi-4`|❌|❌|`phi-4`|![](https://img.shields.io/badge/Active-brightgreen)|
91 |[qwen-qvq-72b-preview.hf.space](https://qwen-qvq-72b-preview.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_QVQ_72B`|`qvq-72b`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
92 |[qwen-qwen2-5.hf.space](https://qwen-qwen2-5.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_5`|`qwen-2.5`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
93 |[qwen-qwen2-5-1m-demo.hf.space](https://qwen-qwen2-5-1m-demo.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_5M`|`qwen-2.5-1m`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
94 |[qwen-qwen2-5-max-demo.hf.space](https://qwen-qwen2-5-max-demo.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_5_Max`|`qwen-2-5-max`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
95 |[qwen-qwen2-72b-instruct.hf.space](https://qwen-qwen2-72b-instruct.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_72B`|`qwen-2-72b`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
96 |[stabilityai-stable-diffusion-3-5-large.hf.space](https://stabilityai-stable-diffusion-3-5-large.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.StabilityAI_SD35Large`|❌|`sd-3.5`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
97 |[voodoohop-flux-1-schnell.hf.space](https://voodoohop-flux-1-schnell.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Voodoohop_Flux1Schnell`|❌|`flux, flux-schnell`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
84 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
85 |----------|-------------|--------------|---------------|--------|--------|------|------|------|
86 |[black-forest-labs-flux-1-dev.hf.space](https://black-forest-labs-flux-1-dev.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.BlackForestLabs_Flux1Dev`|❌|`flux, flux-dev`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
87 |[black-forest-labs-flux-1-schnell.hf.space](https://black-forest-labs-flux-1-schnell.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.BlackForestLabs_Flux1Schnell`|❌|`flux, flux-schnell`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
88 |[cohereforai-c4ai-command.hf.space](https://cohereforai-c4ai-command.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.CohereForAI_C4AI_Command`|`command-r, command-r-plus, command-r7b`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
89 |[huggingface.co/spaces/deepseek-ai/Janus-Pro-7B](https://huggingface.co/spaces/deepseek-ai/Janus-Pro-7B)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.DeepseekAI_Janus_Pro_7b`|✔|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
90 |[roxky-flux-1-dev.hf.space](https://roxky-flux-1-dev.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.G4F`|✔ _**(1+)**_|✔ _**(4+)**_|❌|❌|✔ _**(1+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
91 |[microsoft-phi-4-multimodal.hf.space](https://microsoft-phi-4-multimodal.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Microsoft_Phi_4`|`phi-4`|❌|❌|❌|`phi-4`|![](https://img.shields.io/badge/Active-brightgreen)|
92 |[qwen-qvq-72b-preview.hf.space](https://qwen-qvq-72b-preview.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_QVQ_72B`|`qvq-72b`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
93 |[qwen-qwen2-5.hf.space](https://qwen-qwen2-5.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_5`|`qwen-2.5`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
94 |[qwen-qwen2-5-1m-demo.hf.space](https://qwen-qwen2-5-1m-demo.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_5M`|`qwen-2.5-1m`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
95 |[qwen-qwen2-5-max-demo.hf.space](https://qwen-qwen2-5-max-demo.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_5_Max`|`qwen-2-5-max`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
96 |[qwen-qwen2-72b-instruct.hf.space](https://qwen-qwen2-72b-instruct.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Qwen_Qwen_2_72B`|`qwen-2-72b`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
97 |[stabilityai-stable-diffusion-3-5-large.hf.space](https://stabilityai-stable-diffusion-3-5-large.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.StabilityAI_SD35Large`|❌|`sd-3.5`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
98 |[voodoohop-flux-1-schnell.hf.space](https://voodoohop-flux-1-schnell.hf.space)|[Get API key](https://huggingface.co/settings/tokens)|`g4f.Provider.Voodoohop_Flux1Schnell`|❌|`flux, flux-schnell`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
98 99
99 100 ### Providers Local
100 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Vision (Image Upload) | Status |
101 |----------|-------------|--------------|---------------|--------|--------|------|------|
102 |[]( )|No auth required|`g4f.Provider.Local`|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
103 |[ollama.com](https://ollama.com)|No auth required|`g4f.Provider.Ollama`|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
101 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
102 |----------|-------------|--------------|---------------|--------|--------|------|------|------|
103 |[]( )|No auth required|`g4f.Provider.Local`|✔|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
104 |[ollama.com](https://ollama.com)|No auth required|`g4f.Provider.Ollama`|✔|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
104 105
105 106 ---
106 107 ### Providers MiniMax
107 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Vision (Image Upload) | Status |
108 |----------|-------------|--------------|---------------|--------|--------|------|------|
109 |[hailuo.ai/chat](https://www.hailuo.ai/chat)|[Get API key](https://intl.minimaxi.com/user-center/basic-information/interface-key)|`g4f.Provider.MiniMax`|`MiniMax` _**(1+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
108 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
109 |----------|-------------|--------------|---------------|--------|--------|------|------|------|
110 |[hailuo.ai/chat](https://www.hailuo.ai/chat)|[Get API key](https://intl.minimaxi.com/user-center/basic-information/interface-key)|`g4f.Provider.MiniMax`|`MiniMax` _**(1+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
110 111
111 112 ---
112 113 ### Providers Needs Auth
113 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Vision (Image Upload) | Status |
114 |----------|-------------|--------------|---------------|--------|--------|------|------|
115 |[console.anthropic.com](https://console.anthropic.com)|[Get API key](https://console.anthropic.com/settings/keys)|`g4f.Provider.Anthropic`|✔ _**(8+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
116 |[bing.com/images/create](https://www.bing.com/images/create)|[Manual cookies](https://www.bing.com)|`g4f.Provider.BingCreateImages`|❌|`dall-e-3`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
117 |[cablyai.com/chat](https://cablyai.com/chat)|[Get API key](https://cablyai.com)|`g4f.Provider.CablyAI`|✔|✔|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
118 |[inference.cerebras.ai](https://inference.cerebras.ai/)|[Get API key](https://cloud.cerebras.ai)|`g4f.Provider.Cerebras`|✔ _**(3+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
119 |[copilot.microsoft.com](https://copilot.microsoft.com)|[Manual cookies](https://copilot.microsoft.com)|`g4f.Provider.CopilotAccount`|✔ _**(1+)**_|✔ _**(1+)**_|❌|✔ _**(1+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
120 |[deepinfra.com](https://deepinfra.com)|[Get API key](https://deepinfra.com/dash/api_keys)|`g4f.Provider.DeepInfra`|✔ _**(17+)**_|✔ _**(6+)**_|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
121 |[platform.deepseek.com](https://platform.deepseek.com)|[Get API key](https://platform.deepseek.com/api_keys)|`g4f.Provider.DeepSeek`|✔ _**(1+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
122 |[gemini.google.com](https://gemini.google.com)|[Manual cookies](https://gemini.google.com)|`g4f.Provider.Gemini`|`gemini-2.0`|`gemini-2.0`|❌|`gemini-2.0`|![](https://img.shields.io/badge/Active-brightgreen)|
123 |[ai.google.dev](https://ai.google.dev)|[Get API key](https://aistudio.google.com/u/0/apikey)|`g4f.Provider.GeminiPro`|`gemini-1.5-flash, gemini-1.5-pro, gemini-2.0-flash`|❌|❌|`gemini-1.5-pro`|![](https://img.shields.io/badge/Active-brightgreen)|
124 |[developers.sber.ru/gigachat](https://developers.sber.ru/gigachat)|[Manual cookies](https://developers.sber.ru/gigachat)|`g4f.Provider.GigaChat`|✔ _**(3+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
125 |[github.com/copilot](https://github.com/copilot)|[Manual cookies](https://github.com/copilot)|`g4f.Provider.GithubCopilot`|✔ _**(4+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
126 |[glhf.chat](https://glhf.chat)|[Get API key](https://glhf.chat/user-settings/api)|`g4f.Provider.GlhfChat`|✔ _**(22+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
127 |[console.groq.com/playground](https://console.groq.com/playground)|[Get API key](https://console.groq.com/keys)|`g4f.Provider.Groq`|✔ _**(18+)**_|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
128 |[meta.ai](https://www.meta.ai)|[Manual cookies](https://www.meta.ai)|`g4f.Provider.MetaAI`|`meta-ai`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
129 |[meta.ai](https://www.meta.ai)|[Manual cookies](https://www.meta.ai)|`g4f.Provider.MetaAIAccount`|❌|`meta-ai`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
130 |[designer.microsoft.com](https://designer.microsoft.com)|[Manual cookies](https://designer.microsoft.com)|`g4f.Provider.MicrosoftDesigner`|❌|`dall-e-3`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
131 |[platform.openai.com](https://platform.openai.com)|[Get API key](https://platform.openai.com/settings/organization/api-keys)|`g4f.Provider.OpenaiAPI`|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
132 |[chatgpt.com](https://chatgpt.com)|[Manual cookies](https://chatgpt.com)|`g4f.Provider.OpenaiChat`|`gpt-4o, gpt-4o-mini, gpt-4` _**(8+)**_|✔ _**(1)**_|❌|✔ _**(8+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
133 |[perplexity.ai](https://www.perplexity.ai)|[Get API key](https://www.perplexity.ai/settings/api)|`g4f.Provider.PerplexityApi`|✔ _**(6+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
134 |[chat.reka.ai](https://chat.reka.ai)|[Manual cookies](https://chat.reka.ai)|`g4f.Provider.Reka`|`reka-core`|✔|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
135 |[replicate.com](https://replicate.com)|[Get API key](https://replicate.com/account/api-tokens)|`g4f.Provider.Replicate`|✔ _**(1+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
136 |[beta.theb.ai](https://beta.theb.ai)|[Get API key](https://beta.theb.ai)|`g4f.Provider.ThebApi`|✔ _**(21+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
137 |[whiterabbitneo.com](https://www.whiterabbitneo.com)|[Manual cookies](https://www.whiterabbitneo.com)|`g4f.Provider.WhiteRabbitNeo`|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
138 |[console.x.ai](https://console.x.ai)|[Get API key](https://console.x.ai)|`g4f.Provider.xAI`|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
114 | Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
115 |----------|-------------|--------------|---------------|--------|--------|------|------|------|
116 |[console.anthropic.com](https://console.anthropic.com)|[Get API key](https://console.anthropic.com/settings/keys)|`g4f.Provider.Anthropic`|✔ _**(8+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
117 |[bing.com/images/create](https://www.bing.com/images/create)|[Manual cookies](https://www.bing.com)|`g4f.Provider.BingCreateImages`|❌|`dall-e-3`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
118 |[cablyai.com/chat](https://cablyai.com/chat)|[Get API key](https://cablyai.com)|`g4f.Provider.CablyAI`|✔|✔|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
119 |[inference.cerebras.ai](https://inference.cerebras.ai/)|[Get API key](https://cloud.cerebras.ai)|`g4f.Provider.Cerebras`|✔ _**(3+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
120 |[copilot.microsoft.com](https://copilot.microsoft.com)|[Manual cookies](https://copilot.microsoft.com)|`g4f.Provider.CopilotAccount`|✔ _**(1+)**_|✔ _**(1+)**_|❌|❌|✔ _**(1+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
121 |[deepinfra.com](https://deepinfra.com)|[Get API key](https://deepinfra.com/dash/api_keys)|`g4f.Provider.DeepInfra`|✔ _**(17+)**_|✔ _**(6+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
122 |[platform.deepseek.com](https://platform.deepseek.com)|[Get API key](https://platform.deepseek.com/api_keys)|`g4f.Provider.DeepSeek`|✔ _**(1+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
123 |[gemini.google.com](https://gemini.google.com)|[Manual cookies](https://gemini.google.com)|`g4f.Provider.Gemini`|`gemini-2.0`|`gemini-2.0`|❌|❌|`gemini-2.0`|![](https://img.shields.io/badge/Active-brightgreen)|
124 |[ai.google.dev](https://ai.google.dev)|[Get API key](https://aistudio.google.com/u/0/apikey)|`g4f.Provider.GeminiPro`|`gemini-1.5-flash, gemini-1.5-pro, gemini-2.0-flash`|❌|❌|❌|`gemini-1.5-pro`|![](https://img.shields.io/badge/Active-brightgreen)|
125 |[developers.sber.ru/gigachat](https://developers.sber.ru/gigachat)|[Manual cookies](https://developers.sber.ru/gigachat)|`g4f.Provider.GigaChat`|✔ _**(3+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
126 |[github.com/copilot](https://github.com/copilot)|[Manual cookies](https://github.com/copilot)|`g4f.Provider.GithubCopilot`|✔ _**(4+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
127 |[glhf.chat](https://glhf.chat)|[Get API key](https://glhf.chat/user-settings/api)|`g4f.Provider.GlhfChat`|✔ _**(22+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
128 |[console.groq.com/playground](https://console.groq.com/playground)|[Get API key](https://console.groq.com/keys)|`g4f.Provider.Groq`|✔ _**(18+)**_|❌|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
129 |[meta.ai](https://www.meta.ai)|[Manual cookies](https://www.meta.ai)|`g4f.Provider.MetaAI`|`meta-ai`|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
130 |[meta.ai](https://www.meta.ai)|[Manual cookies](https://www.meta.ai)|`g4f.Provider.MetaAIAccount`|❌|`meta-ai`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
131 |[designer.microsoft.com](https://designer.microsoft.com)|[Manual cookies](https://designer.microsoft.com)|`g4f.Provider.MicrosoftDesigner`|❌|`dall-e-3`|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
132 |[platform.openai.com](https://platform.openai.com)|[Get API key](https://platform.openai.com/settings/organization/api-keys)|`g4f.Provider.OpenaiAPI`|✔|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
133 |[chatgpt.com](https://chatgpt.com)|[Manual cookies](https://chatgpt.com)|`g4f.Provider.OpenaiChat`|`gpt-4o, gpt-4o-mini, gpt-4` _**(8+)**_|✔ _**(1)**_|❌|❌|✔ _**(8+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
134 |[perplexity.ai](https://www.perplexity.ai)|[Get API key](https://www.perplexity.ai/settings/api)|`g4f.Provider.PerplexityApi`|✔ _**(6+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
135 |[chatgpt.com](https://chatgpt.com)|[Manual cookies](https://chatgpt.com)|`g4f.Provider.OpenaiChat`|`gpt-4o, gpt-4o-mini, gpt-4` _**(8+)**_|✔ _**(1)**_|❌|❌|✔ _**(8+)**_|![](https://img.shields.io/badge/Active-brightgreen)|
136 |[perplexity.ai](https://www.perplexity.ai)|[Get API key](https://www.perplexity.ai/settings/api)|`g4f.Provider.PerplexityApi`|✔ _**(6+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
137 |[chat.reka.ai](https://chat.reka.ai)|[Manual cookies](https://chat.reka.ai)|`g4f.Provider.Reka`|`reka-core`|✔|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
138 |[replicate.com](https://replicate.com)|[Get API key](https://replicate.com/account/api-tokens)|`g4f.Provider.Replicate`|✔ _**(1+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
139 |[beta.theb.ai](https://beta.theb.ai)|[Get API key](https://beta.theb.ai)|`g4f.Provider.ThebApi`|✔ _**(21+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
140 |[whiterabbitneo.com](https://www.whiterabbitneo.com)|[Manual cookies](https://www.whiterabbitneo.com)|`g4f.Provider.WhiteRabbitNeo`|✔|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
141 |[console.x.ai](https://console.x.ai)|[Get API key](https://console.x.ai)|`g4f.Provider.xAI`|✔|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
139 142
140 143 ---
141 144 ## Models
@@ -160,13 +163,13 @@ This document provides an overview of various AI providers and models, including
160 163 |llama-3.1-405b|Meta Llama|2+ Providers|[huggingface.co](https://huggingface.co/meta-llama/Llama-3.1-405B)|
161 164 |llama-3.2-1b|Meta Llama|1+ Providers|[huggingface.co](https://huggingface.co/meta-llama/Llama-3.2-1B)|
162 165 |llama-3.2-3b|Meta Llama|1+ Providers|[huggingface.co](https://huggingface.co/meta-llama/Llama-3.2-3B)|
163 |llama-3.2-11b|Meta Llama|3+ Providers|[ai.meta.com](https://ai.meta.com/blog/llama-3-2-connect-2024-vision-edge-mobile-devices/)|
166 |llama-3.2-11b|Meta Llama|4+ Providers|[ai.meta.com](https://ai.meta.com/blog/llama-3-2-connect-2024-vision-edge-mobile-devices/)|
164 167 |llama-3.2-90b|Meta Llama|2+ Providers|[huggingface.co](https://huggingface.co/meta-llama/Llama-3.2-90B-Vision)|
165 |llama-3.3-70b|Meta Llama|7+ Providers|[ai.meta.com](https://ai.meta.com/blog/llama-3-3/)|
168 |llama-3.3-70b|Meta Llama|8+ Providers|[ai.meta.com](https://ai.meta.com/blog/llama-3-3/)|
166 169 |mixtral-8x7b|Mistral|1+ Providers|[mistral.ai](https://mistral.ai/news/mixtral-of-experts/)|
167 170 |mixtral-8x22b|Mistral|1+ Providers|[huggingface.co](https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1)|
168 171 |mistral-nemo|Mistral|3+ Providers|[huggingface.co](https://huggingface.co/mistralai/Mistral-Nemo-Instruct-2407)|
169 |mixtral-small-24b|Mistral|2+ Providers|[huggingface.co](https://huggingface.co/mistralai/Mistral-Small-24B-Instruct-2501)|
172 |mixtral-small-24b|Mistral|3+ Providers|[huggingface.co](https://huggingface.co/mistralai/Mistral-Small-24B-Instruct-2501)|
170 173 |hermes-3|NousResearch|1+ Providers|[huggingface.co](https://huggingface.co/NousResearch/Hermes-3-Llama-3.1-405B-FP8)|
171 174 |phi-3.5-mini|Microsoft|1+ Providers|[huggingface.co](https://huggingface.co/microsoft/Phi-3.5-mini-instruct)|
172 175 |phi-4|Microsoft|3+ 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)|
@@ -199,11 +202,11 @@ This document provides an overview of various AI providers and models, including
199 202 |qwen-2.5-coder-32b|Qwen|3+ Providers|[huggingface.co](https://huggingface.co/Qwen/Qwen2.5-Coder-32B)|
200 203 |qwen-2.5-1m|Qwen|1+ Providers|[huggingface.co](https://huggingface.co/Qwen/Qwen2.5-1M-Demo)|
201 204 |qwen-2-5-max|Qwen|1+ Providers|[qwen-ai.com](https://www.qwen-ai.com/2-5-max/)|
202 |qwq-32b|Qwen|2+ Providers|[huggingface.co](https://huggingface.co/Qwen/QwQ-32B-Preview)|
205 |qwq-32b|Qwen|4+ Providers|[huggingface.co](https://huggingface.co/Qwen/QwQ-32B-Preview)|
203 206 |qvq-72b|Qwen|1+ Providers|[huggingface.co](https://huggingface.co/Qwen/QVQ-72B-Preview)|
204 207 |pi|Inflection|1+ Providers|[inflection.ai](https://inflection.ai/blog/inflection-2-5)|
205 208 |deepseek-chat|DeepSeek|2+ Providers|[huggingface.co](https://huggingface.co/deepseek-ai/deepseek-llm-67b-chat)|
206 |deepseek-v3|DeepSeek|5+ Providers|[api-docs.deepseek.com](https://api-docs.deepseek.com/news/news250120)|
209 |deepseek-v3|DeepSeek|6+ Providers|[api-docs.deepseek.com](https://api-docs.deepseek.com/news/news250120)|
207 210 |deepseek-r1|DeepSeek|10+ Providers|[api-docs.deepseek.com](https://api-docs.deepseek.com/news/news250120)|
208 211 |janus-pro-7b|DeepSeek|2+ Providers|[api-docs.deepseek.com](https://api-docs.deepseek.com/docs/janus-pro-7b)|
209 212 |grok-3|x.ai|1+ Providers|[x.ai](https://x.ai/blog/grok-3)|
@@ -223,11 +226,13 @@ This document provides an overview of various AI providers and models, including
223 226 |airoboros-70b|DeepInfra|1+ Providers|[huggingface.co](https://huggingface.co/cognitivecomputations/dolphin-2.9.1-llama-3-70b)|
224 227 |lzlv-70b|Lizpreciatior|1+ Providers|[huggingface.co](https://huggingface.co/cognitivecomputations/dolphin-2.9.1-llama-3-70b)|
225 228 |minicpm-2.5|OpenBMB|1+ Providers|[huggingface.co](https://huggingface.co/openbmb/MiniCPM-Llama3-V-2_5)|
226 |tulu-3-405b|Ai2|1+ Providers|[allenai.org](https://allenai.org/documentation)|
227 |olmo-2-13b|Ai2|1+ Providers|[allenai.org](https://allenai.org/documentation)|
228 229 |tulu-3-1-8b|Ai2|1+ Providers|[allenai.org](https://allenai.org/documentation)|
229 230 |tulu-3-70b|Ai2|1+ Providers|[allenai.org](https://allenai.org/documentation)|
230 |olmoe-0125|Ai2|1+ Providers|[allenai.org](https://allenai.org/documentation)|
231 |tulu-3-405b|Ai2|1+ Providers|[allenai.org](https://allenai.org/documentation)|
232 |olmo-1-7b|Ai2|1+ Providers|[allenai.org](https://allenai.org/olmo)|
233 |olmo-2-13b|Ai2|1+ Providers|[allenai.org](https://allenai.org/olmo)|
234 |olmo-2-32b|Ai2|1+ Providers|[allenai.org](https://allenai.org/olmo)|
235 |olmo-4-synthetic|Ai2|1+ Providers|[allenai.org](https://allenai.org/olmo)|
231 236 |lfm-40b|Liquid AI|1+ Providers|[liquid.ai](https://www.liquid.ai/liquid-foundation-models)|
232 237 |evil|Evil Mode - Experimental|2+ Providers|[]( )|
233 238
@@ -237,7 +242,7 @@ This document provides an overview of various AI providers and models, including
237 242 |-------|---------------|-----------|---------|
238 243 |sdxl-turbo|Stability AI|2+ Providers|[huggingface.co](https://huggingface.co/stabilityai/sdxl-turbo)|
239 244 |sd-3.5|Stability AI|1+ Providers|[huggingface.co](https://huggingface.co/stabilityai/stable-diffusion-3.5-large)|
240 |flux|Black Forest Labs|4+ Providers|[github.com/black-forest-labs/flux](https://github.com/black-forest-labs/flux)|
245 |flux|Black Forest Labs|5+ Providers|[github.com/black-forest-labs/flux](https://github.com/black-forest-labs/flux)|
241 246 |flux-pro|Black Forest Labs|1+ Providers|[huggingface.co](https://huggingface.co/enhanceaiteam/FLUX.1-Pro)|
242 247 |flux-dev|Black Forest Labs|4+ Providers|[huggingface.co](https://huggingface.co/black-forest-labs/FLUX.1-dev)|
243 248 |flux-schnell|Black Forest Labs|4+ Providers|[huggingface.co](https://huggingface.co/black-forest-labs/FLUX.1-schnell)|
Added etc/tool/commit.py +105 -0
@@ -0,0 +1,105 @@
1 #!/usr/bin/env python3
2 """
3 AI Commit Message Generator using gpt4free (g4f)
4
5 This tool uses AI to generate meaningful git commit messages based on
6 staged changes. It analyzes the git diff and suggests appropriate commit
7 messages following conventional commit format.
8
9 Usage:
10 python -m etc.tool.commit
11 """
12 import subprocess
13 import sys
14 from g4f.client import Client
15
16 def get_git_diff():
17 """Get the current git diff for staged changes"""
18 try:
19 diff_process = subprocess.run(
20 ["git", "diff", "--staged"],
21 capture_output=True,
22 text=True
23 )
24 return diff_process.stdout
25 except Exception as e:
26 print(f"Error running git diff: {e}")
27 return None
28
29 def generate_commit_message(diff_text):
30 """Generate a commit message based on the git diff"""
31 if not diff_text or diff_text.strip() == "":
32 return "No changes staged for commit"
33
34 client = Client()
35
36 prompt = f"""
37 {diff_text}
38 ```
39
40 Analyze ONLY the exact changes in this git diff and create a precise commit message.
41
42 FORMAT:
43 1. First line: "<type>: <summary>" (max 70 chars)
44 - Type: feat, fix, docs, refactor, test, etc.
45 - Summary must describe ONLY actual changes shown in the diff
46
47 2. Leave one blank line
48
49 3. Add sufficient bullet points to:
50 - Describe ALL specific changes seen in the diff
51 - Reference exact functions/files/components that were modified
52 - Do NOT mention anything not explicitly shown in the code changes
53 - Avoid general statements or assumptions not directly visible in diff
54 - Include enough points to cover all significant changes (don't limit to a specific number)
55
56 IMPORTANT: Be 100% factual. Only mention code that was actually changed. Never invent or assume changes not shown in the diff. If unsure about a change's purpose, describe what changed rather than why. Output nothing except for the commit message, and don't surround it in quotes.
57 """
58
59 try:
60 response = client.chat.completions.create(
61 model="claude-3.7-sonnet",
62 messages=[{"role": "user", "content": prompt}]
63 )
64
65 return response.choices[0].message.content.strip()
66 except Exception as e:
67 print(f"Error generating commit message: {e}")
68 return None
69
70 def main():
71 print("Fetching git diff...")
72 diff = get_git_diff()
73
74 if diff is None:
75 print("Failed to get git diff. Are you in a git repository?")
76 sys.exit(1)
77
78 if diff.strip() == "":
79 print("No changes staged for commit. Stage changes with 'git add' first.")
80 sys.exit(0)
81
82 print("Generating commit message...")
83 commit_message = generate_commit_message(diff)
84
85 if commit_message:
86 print("\nGenerated commit message:")
87 print("-" * 50)
88 print(commit_message)
89 print("-" * 50)
90
91 user_input = input("\nDo you want to use this commit message? (y/n): ")
92 if user_input.lower() == 'y':
93 try:
94 subprocess.run(
95 ["git", "commit", "-m", commit_message],
96 check=True
97 )
98 print("Commit successful!")
99 except subprocess.CalledProcessError as e:
100 print(f"Error making commit: {e}")
101 else:
102 print("Failed to generate commit message.")
103
104 if __name__ == "__main__":
105 main()
Modified g4f/Provider/ARTA.py +46 -6
@@ -27,7 +27,8 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
27 27 default_model = "Flux"
28 28 default_image_model = default_model
29 29 model_aliases = {
30 "flux": "Flux",
30 default_image_model: default_image_model,
31 "flux": default_image_model,
31 32 "medieval": "Medieval",
32 33 "vincent_van_gogh": "Vincent Van Gogh",
33 34 "f_dev": "F Dev",
@@ -91,7 +92,17 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
91 92 # Step 1: Generate Authentication Token
92 93 auth_payload = {"clientType": "CLIENT_TYPE_ANDROID"}
93 94 async with session.post(cls.auth_url, json=auth_payload, proxy=proxy) as auth_response:
94 auth_data = await auth_response.json()
95 if auth_response.status >= 400:
96 error_text = await auth_response.text()
97 raise ResponseError(f"Failed to obtain authentication token. Status: {auth_response.status}, Response: {error_text}")
98
99 try:
100 auth_data = await auth_response.json()
101 except Exception as e:
102 error_text = await auth_response.text()
103 content_type = auth_response.headers.get('Content-Type', 'unknown')
104 raise ResponseError(f"Failed to parse auth response as JSON. Content-Type: {content_type}, Error: {str(e)}, Response: {error_text}")
105
95 106 auth_token = auth_data.get("idToken")
96 107 #refresh_token = auth_data.get("refreshToken")
97 108 if not auth_token:
@@ -107,7 +118,17 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
107 118 "refresh_token": refresh_token,
108 119 }
109 120 async with session.post(cls.token_refresh_url, data=payload, proxy=proxy) as response:
110 response_data = await response.json()
121 if response.status >= 400:
122 error_text = await response.text()
123 raise ResponseError(f"Failed to refresh token. Status: {response.status}, Response: {error_text}")
124
125 try:
126 response_data = await response.json()
127 except Exception as e:
128 error_text = await response.text()
129 content_type = response.headers.get('Content-Type', 'unknown')
130 raise ResponseError(f"Failed to parse token refresh response as JSON. Content-Type: {content_type}, Error: {str(e)}, Response: {error_text}")
131
111 132 return response_data.get("id_token"), response_data.get("refresh_token")
112 133
113 134 @classmethod
@@ -167,9 +188,18 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
167 188 }
168 189
169 190 async with session.post(cls.image_generation_url, data=image_payload, headers=headers, proxy=proxy) as image_response:
170 image_data = await image_response.json()
191 if image_response.status >= 400:
192 error_text = await image_response.text()
193 raise ResponseError(f"Failed to initiate image generation. Status: {image_response.status}, Response: {error_text}")
194
195 try:
196 image_data = await image_response.json()
197 except Exception as e:
198 error_text = await image_response.text()
199 content_type = image_response.headers.get('Content-Type', 'unknown')
200 raise ResponseError(f"Failed to parse response as JSON. Content-Type: {content_type}, Error: {str(e)}, Response: {error_text}")
201
171 202 record_id = image_data.get("record_id")
172
173 203 if not record_id:
174 204 raise ResponseError(f"Failed to initiate image generation: {image_data}")
175 205
@@ -180,7 +210,17 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
180 210 last_status = None
181 211 while True:
182 212 async with session.get(status_url, headers=headers, proxy=proxy) as status_response:
183 status_data = await status_response.json()
213 if status_response.status >= 400:
214 error_text = await status_response.text()
215 raise ResponseError(f"Failed to check image generation status. Status: {status_response.status}, Response: {error_text}")
216
217 try:
218 status_data = await status_response.json()
219 except Exception as e:
220 error_text = await status_response.text()
221 content_type = status_response.headers.get('Content-Type', 'unknown')
222 raise ResponseError(f"Failed to parse status response as JSON. Content-Type: {content_type}, Error: {str(e)}, Response: {error_text}")
223
184 224 status = status_data.get("status")
185 225
186 226 if status == "DONE":
Modified g4f/Provider/AllenAI.py +69 -16
@@ -2,21 +2,23 @@ from __future__ import annotations
2 2 import json
3 3 from uuid import uuid4
4 4 from aiohttp import ClientSession
5 from ..typing import AsyncResult, Messages
5 from ..typing import AsyncResult, Messages, MediaListType
6 from ..image import to_bytes, is_accepted_format, to_data_uri
6 7 from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
7 8 from ..requests.raise_for_status import raise_for_status
8 9 from ..providers.response import FinishReason, JsonConversation
9 from .helper import format_prompt, get_last_user_message
10 from .helper import format_prompt, get_last_user_message, format_image_prompt
11 from ..tools.media import merge_media
10 12
11 13
12 14 class Conversation(JsonConversation):
13 parent: str = None
14 15 x_anonymous_user_id: str = None
15 16
16 17 def __init__(self, model: str):
17 18 super().__init__() # Ensure parent class is initialized
18 19 self.model = model
19 20 self.messages = [] # Instance-specific list
21 self.parent = None # Initialize parent as instance attribute
20 22 if not self.x_anonymous_user_id:
21 23 self.x_anonymous_user_id = str(uuid4())
22 24
@@ -35,42 +37,73 @@ class AllenAI(AsyncGeneratorProvider, ProviderModelMixin):
35 37 supports_message_history = True
36 38
37 39 default_model = 'tulu3-405b'
38 models = [
39 default_model,
40 'OLMo-2-1124-13B-Instruct',
41 'tulu-3-1-8b',
42 'Llama-3-1-Tulu-3-70B',
43 'olmoe-0125'
44 ]
40 default_vision_model = 'mm-olmo-uber-model-v4-synthetic'
41 vision_models = [default_vision_model]
42 # Map models to their required hosts
43 model_hosts = {
44 default_model: "inferd",
45 "OLMo-2-1124-13B-Instruct": "modal",
46 "tulu-3-1-8b": "modal",
47 "Llama-3-1-Tulu-3-70B": "modal",
48 "olmoe-0125": "modal",
49 "olmo-2-0325-32b-instruct": "modal",
50 "mm-olmo-uber-model-v4-synthetic": "modal",
51 }
52
53 models = list(model_hosts.keys())
45 54
46 55 model_aliases = {
47 56 "tulu-3-405b": default_model,
57 "olmo-1-7b": "olmoe-0125",
48 58 "olmo-2-13b": "OLMo-2-1124-13B-Instruct",
59 "olmo-2-32b": "olmo-2-0325-32b-instruct",
49 60 "tulu-3-1-8b": "tulu-3-1-8b",
50 61 "tulu-3-70b": "Llama-3-1-Tulu-3-70B",
51 62 "llama-3.1-405b": "tulu3-405b",
52 63 "llama-3.1-8b": "tulu-3-1-8b",
53 64 "llama-3.1-70b": "Llama-3-1-Tulu-3-70B",
65 "olmo-4-synthetic": "mm-olmo-uber-model-v4-synthetic",
54 66 }
55 67
68
56 69 @classmethod
57 70 async def create_async_generator(
58 71 cls,
59 72 model: str,
60 73 messages: Messages,
61 74 proxy: str = None,
62 host: str = "inferd",
75 host: str = None,
63 76 private: bool = True,
64 77 top_p: float = None,
65 78 temperature: float = None,
66 79 conversation: Conversation = None,
67 80 return_conversation: bool = False,
81 media: MediaListType = None,
68 82 **kwargs
69 83 ) -> AsyncResult:
70 prompt = format_prompt(messages) if conversation is None else get_last_user_message(messages)
84 actual_model = cls.get_model(model)
85
86 # Use format_image_prompt for vision models when media is provided
87 if media is not None and len(media) > 0:
88 # For vision models, use format_image_prompt
89 if actual_model in cls.vision_models:
90 prompt = format_image_prompt(messages)
91 else:
92 # For non-vision models with images, still use the last user message
93 prompt = get_last_user_message(messages)
94 else:
95 # For text-only messages, use the standard format
96 prompt = format_prompt(messages) if conversation is None else get_last_user_message(messages)
97
98 # Determine the correct host for the model
99 if host is None:
100 # Use model-specific host from model_hosts dictionary
101 host = cls.model_hosts[actual_model]
102
71 103 # Initialize or update conversation
72 if conversation is None:
73 conversation = Conversation(model)
104 # For mm-olmo-uber-model-v4-synthetic, always create a new conversation
105 if conversation is None or actual_model == 'mm-olmo-uber-model-v4-synthetic':
106 conversation = Conversation(actual_model)
74 107
75 108 # Generate new boundary for each request
76 109 boundary = f"----WebKitFormBoundary{uuid4().hex}"
@@ -101,7 +134,7 @@ class AllenAI(AsyncGeneratorProvider, ProviderModelMixin):
101 134 ]
102 135
103 136 # Add parent if exists in conversation
104 if conversation.parent:
137 if hasattr(conversation, 'parent') and conversation.parent:
105 138 form_data.append(
106 139 f'--{boundary}\r\n'
107 140 f'Content-Disposition: form-data; name="parent"\r\n\r\n{conversation.parent}\r\n'
@@ -120,8 +153,25 @@ class AllenAI(AsyncGeneratorProvider, ProviderModelMixin):
120 153 f'Content-Disposition: form-data; name="top_p"\r\n\r\n{top_p}\r\n'
121 154 )
122 155
156 # Always create a new conversation when an image is attached to avoid 403 errors
157 if media is not None and len(media) > 0:
158 conversation = Conversation(actual_model)
159
160 # Add image if provided
161 if media is not None and len(media) > 0:
162 # For each image in the media list (using merge_media to handle different formats)
163 for image, image_name in merge_media(media, messages):
164 image_bytes = to_bytes(image)
165 form_data.extend([
166 f'--{boundary}\r\n'
167 f'Content-Disposition: form-data; name="files"; filename="{image_name}"\r\n'
168 f'Content-Type: {is_accepted_format(image_bytes)}\r\n\r\n'
169 ])
170 form_data.append(image_bytes.decode('latin1'))
171 form_data.append('\r\n')
172
123 173 form_data.append(f'--{boundary}--\r\n')
124 data = "".join(form_data).encode()
174 data = "".join(form_data).encode('latin1')
125 175
126 176 async with ClientSession(headers=headers) as session:
127 177 async with session.post(
@@ -164,6 +214,9 @@ class AllenAI(AsyncGeneratorProvider, ProviderModelMixin):
164 214 # Processing the final response
165 215 if data.get("final") or data.get("finish_reason") == "stop":
166 216 if current_parent:
217 # Ensure the parent attribute exists before setting it
218 if not hasattr(conversation, 'parent'):
219 setattr(conversation, 'parent', None)
167 220 conversation.parent = current_parent
168 221
169 222 # Add a message to the story
Modified g4f/Provider/DDG.py +212 -35
@@ -26,6 +26,9 @@ except ImportError:
26 26 class DuckDuckGoSearchException(Exception):
27 27 """Base exception class for duckduckgo_search."""
28 28
29 class DuckDuckGoChallengeError(ResponseStatusError):
30 """Raised when DuckDuckGo presents a challenge that needs to be solved."""
31
29 32 class Conversation(JsonConversation):
30 33 vqd: str = None
31 34 vqd_hash_1: str = None
@@ -48,14 +51,19 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
48 51 supports_message_history = True
49 52
50 53 default_model = "gpt-4o-mini"
51 models = [default_model, "meta-llama/Llama-3.3-70B-Instruct-Turbo", "claude-3-haiku-20240307", "o3-mini", "mistralai/Mistral-Small-24B-Instruct-2501"]
52
53 model_aliases = {
54 "gpt-4": "gpt-4o-mini",
54
55 # Model mapping from user-friendly names to API model names
56 _chat_models = {
57 "gpt-4": default_model,
58 "gpt-4o-mini": default_model,
55 59 "llama-3.3-70b": "meta-llama/Llama-3.3-70B-Instruct-Turbo",
56 60 "claude-3-haiku": "claude-3-haiku-20240307",
61 "o3-mini": "o3-mini",
57 62 "mixtral-small-24b": "mistralai/Mistral-Small-24B-Instruct-2501",
58 63 }
64
65 # Available models (user-friendly names)
66 models = list(_chat_models.keys())
59 67
60 68 last_request_time = 0
61 69 max_retries = 3
@@ -100,19 +108,52 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
100 108 def build_x_vqd_hash_1(cls, vqd_hash_1: str, headers: dict) -> str:
101 109 """Build the x-vqd-hash-1 header value."""
102 110 try:
103 decoded = base64.b64decode(vqd_hash_1).decode()
104 server_hashes = cls.parse_server_hashes(decoded)
105 dom_fingerprint = cls.parse_dom_fingerprint(decoded)
106
111 # If we received a valid base64 string, try to decode it
112 if vqd_hash_1 and len(vqd_hash_1) > 20:
113 try:
114 # Try to decode and parse as JSON first
115 decoded_json = json.loads(base64.b64decode(vqd_hash_1).decode())
116 # If it's already a complete structure with meta, return it as is
117 if isinstance(decoded_json, dict) and "meta" in decoded_json:
118 return vqd_hash_1
119
120 # Otherwise, extract what we can from it
121 if isinstance(decoded_json, dict) and "server_hashes" in decoded_json:
122 server_hashes = decoded_json.get("server_hashes", ["1", "2"])
123 else:
124 # Fall back to parsing from string
125 decoded = base64.b64decode(vqd_hash_1).decode()
126 server_hashes = cls.parse_server_hashes(decoded)
127 except (json.JSONDecodeError, UnicodeDecodeError):
128 # If it's not valid JSON, try to parse it as a string
129 decoded = base64.b64decode(vqd_hash_1).decode()
130 server_hashes = cls.parse_server_hashes(decoded)
131 else:
132 # Default server hashes if we can't extract them
133 server_hashes = ["1", "2"]
134
135 # Generate fingerprints
136 dom_fingerprint = "1000" # Default value
107 137 ua_fingerprint = headers.get("User-Agent", "") + headers.get("sec-ch-ua", "")
108 138 ua_hash = cls.sha256_base64(ua_fingerprint)
109 139 dom_hash = cls.sha256_base64(dom_fingerprint)
110
140
141 # Create a challenge ID (random hex string)
142 challenge_id = ''.join(random.choice('0123456789abcdef') for _ in range(40)) + 'h8jbt'
143
144 # Build the complete structure including meta
111 145 final_result = {
112 146 "server_hashes": server_hashes,
113 147 "client_hashes": [ua_hash, dom_hash],
114 148 "signals": {},
149 "meta": {
150 "v": "1",
151 "challenge_id": challenge_id,
152 "origin": "https://duckduckgo.com",
153 "stack": "Error\nat ke (https://duckduckgo.com/dist/wpm.chat.js:1:29526)\nat async dispatchServiceInitialVQD (https://duckduckgo.com/dist/wpm.chat.js:1:45076)"
154 }
115 155 }
156
116 157 base64_final_result = base64.b64encode(json.dumps(final_result).encode()).decode()
117 158 return base64_final_result
118 159 except Exception as e:
@@ -121,13 +162,18 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
121 162
122 163 @classmethod
123 164 def validate_model(cls, model: str) -> str:
124 """Validates and returns the correct model name"""
165 """Validates and returns the correct model name for the API"""
125 166 if not model:
126 167 return cls.default_model
168
169 # Check aliases first
127 170 if model in cls.model_aliases:
128 171 model = cls.model_aliases[model]
172
173 # Check if it's a valid model name
129 174 if model not in cls.models:
130 175 raise ModelNotSupportedError(f"Model {model} not supported. Available models: {cls.models}")
176
131 177 return model
132 178
133 179 @classmethod
@@ -147,18 +193,45 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
147 193 await cls.sleep()
148 194 # Make initial request to get cookies
149 195 async with session.get(cls.url) as response:
150 # We also manually set required cookies
196 # Set the required cookies
151 197 cookies = {}
152 198 cookies_dict = {'dcs': '1', 'dcm': '3'}
153 199
200 # Add any cookies from the response
201 for cookie in response.cookies.values():
202 cookies[cookie.key] = cookie.value
203
204 # Ensure our required cookies are set
154 205 for name, value in cookies_dict.items():
155 206 cookies[name] = value
156 207 url_obj = URL(cls.url)
157 208 session.cookie_jar.update_cookies({name: value}, url_obj)
158 209
210 # Make a second request to the status endpoint to get any additional cookies
211 headers = {
212 "accept": "text/event-stream",
213 "accept-language": "en",
214 "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
215 "origin": "https://duckduckgo.com",
216 "referer": "https://duckduckgo.com/",
217 }
218
219 await cls.sleep()
220 async with session.get(cls.status_url, headers=headers) as status_response:
221 # Add any cookies from the status response
222 for cookie in status_response.cookies.values():
223 cookies[cookie.key] = cookie.value
224 url_obj = URL(cls.url)
225 session.cookie_jar.update_cookies({cookie.key: cookie.value}, url_obj)
226
159 227 return cookies
160 228 except Exception as e:
161 return {}
229 # Return at least the required cookies on error
230 cookies = {'dcs': '1', 'dcm': '3'}
231 url_obj = URL(cls.url)
232 for name, value in cookies.items():
233 session.cookie_jar.update_cookies({name: value}, url_obj)
234 return cookies
162 235
163 236 @classmethod
164 237 async def fetch_fe_version(cls, session: ClientSession) -> str:
@@ -175,26 +248,38 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
175 248
176 249 # Extract x-fe-version components
177 250 try:
251 # Try to extract the version components
178 252 xfe1 = content.split('__DDG_BE_VERSION__="', 1)[1].split('"', 1)[0]
179 253 xfe2 = content.split('__DDG_FE_CHAT_HASH__="', 1)[1].split('"', 1)[0]
180 cls._chat_xfe = f"{xfe1}-{xfe2}"
254
255 # Format it like "serp_YYYYMMDD_HHMMSS_ET-hash"
256 from datetime import datetime
257 current_date = datetime.now().strftime("%Y%m%d_%H%M%S")
258 cls._chat_xfe = f"serp_{current_date}_ET-{xfe2}"
259
181 260 return cls._chat_xfe
182 261 except Exception:
183 # If extraction fails, return an empty string
184 return ""
262 # Fallback to a default format if extraction fails
263 from datetime import datetime
264 current_date = datetime.now().strftime("%Y%m%d_%H%M%S")
265 cls._chat_xfe = f"serp_{current_date}_ET-78c2e87e3d286691cc21"
266 return cls._chat_xfe
185 267 except Exception:
186 return ""
268 # Fallback to a default format if request fails
269 from datetime import datetime
270 current_date = datetime.now().strftime("%Y%m%d_%H%M%S")
271 cls._chat_xfe = f"serp_{current_date}_ET-78c2e87e3d286691cc21"
272 return cls._chat_xfe
187 273
188 274 @classmethod
189 275 async def fetch_vqd_and_hash(cls, session: ClientSession, retry_count: int = 0) -> tuple[str, str]:
190 276 """Fetches the required VQD token and hash for the chat session with retries."""
191 277 headers = {
192 278 "accept": "text/event-stream",
193 "accept-language": "en-US,en;q=0.9",
279 "accept-language": "en",
194 280 "cache-control": "no-cache",
195 "content-type": "application/json",
196 281 "pragma": "no-cache",
197 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
282 "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
198 283 "origin": "https://duckduckgo.com",
199 284 "referer": "https://duckduckgo.com/",
200 285 "x-vqd-accept": "1",
@@ -270,30 +355,44 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
270 355 last_message = get_last_user_message(messages.copy())
271 356 conversation.message_history.append({"role": "user", "content": last_message})
272 357
273 # Step 4: Prepare headers - IMPORTANT: send empty x-vqd-hash-1 for the first request
358 # Step 4: Prepare headers with proper x-vqd-hash-1
274 359 headers = {
275 360 "accept": "text/event-stream",
276 "accept-language": "en-US,en;q=0.9",
361 "accept-language": "en",
362 "cache-control": "no-cache",
277 363 "content-type": "application/json",
278 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
364 "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
279 365 "origin": "https://duckduckgo.com",
280 366 "referer": "https://duckduckgo.com/",
281 "sec-ch-ua": '"Chromium";v="133", "Not_A Brand";v="8"',
367 "pragma": "no-cache",
368 "priority": "u=1, i",
369 "sec-ch-ua": '"Not:A-Brand";v="24", "Chromium";v="134"',
370 "sec-ch-ua-mobile": "?0",
371 "sec-ch-ua-platform": '"Linux"',
372 "sec-fetch-dest": "empty",
373 "sec-fetch-mode": "cors",
374 "sec-fetch-site": "same-origin",
282 375 "x-fe-version": conversation.fe_version or cls._chat_xfe,
283 376 "x-vqd-4": conversation.vqd,
284 "x-vqd-hash-1": "", # Send empty string initially
285 377 }
378
379 # For the first request, send an empty x-vqd-hash-1 header
380 # This matches the behavior in the duckduckgo_search module
381 headers["x-vqd-hash-1"] = ""
286 382
287 383 # Step 5: Prepare the request data
384 # Convert the user-friendly model name to the API model name
385 api_model = cls._chat_models.get(model, model)
386
288 387 data = {
289 "model": model,
388 "model": api_model,
290 389 "messages": conversation.message_history,
291 390 }
292 391
293 392 # Step 6: Send the request
294 393 await cls.sleep(multiplier=1.0 + retry_count * 0.5)
295 394 async with session.post(cls.api_endpoint, json=data, headers=headers, proxy=proxy) as response:
296 # Handle 429 errors specifically
395 # Handle 429 and 418 errors specifically
297 396 if response.status == 429:
298 397 response_text = await response.text()
299 398
@@ -307,7 +406,69 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
307 406 continue
308 407 else:
309 408 raise RateLimitError(f"Rate limited after {cls.max_retries} retries")
409 elif response.status == 418:
410 # Check if it's a challenge error
411 try:
412 response_text = await response.text()
413 try:
414 response_json = json.loads(response_text)
415
416 # Extract challenge data if available
417 challenge_data = None
418 if response_json.get("type") == "ERR_CHALLENGE" and "cd" in response_json:
419 challenge_data = response_json["cd"]
420
421 if retry_count < cls.max_retries:
422 retry_count += 1
423 wait_time = cls.base_delay * (2 ** retry_count) * (1 + random.random())
424 await asyncio.sleep(wait_time)
425
426 # Reset tokens and try again with fresh session
427 conversation = None
428 cls._chat_xfe = ""
429
430 # Get fresh cookies
431 cookies = await cls.get_default_cookies(session)
432
433 # If we have challenge data, try to use it
434 if challenge_data and isinstance(challenge_data, dict):
435 # Extract any useful information from challenge data
436 # This could be used to build a better response in the future
437 pass
438
439 continue
440 else:
441 raise DuckDuckGoChallengeError(f"Challenge error after {cls.max_retries} retries")
442 except json.JSONDecodeError:
443 # If we can't parse the JSON, assume it's a challenge error anyway
444 if retry_count < cls.max_retries:
445 retry_count += 1
446 wait_time = cls.base_delay * (2 ** retry_count) * (1 + random.random())
447 await asyncio.sleep(wait_time)
448
449 # Reset tokens and try again with fresh session
450 conversation = None
451 cls._chat_xfe = ""
452 cookies = await cls.get_default_cookies(session)
453 continue
454 else:
455 raise DuckDuckGoChallengeError(f"Challenge error after {cls.max_retries} retries")
456 except Exception as e:
457 # If any other error occurs during handling, still try to recover
458 if retry_count < cls.max_retries:
459 retry_count += 1
460 wait_time = cls.base_delay * (2 ** retry_count) * (1 + random.random())
461 await asyncio.sleep(wait_time)
462
463 # Reset tokens and try again with fresh session
464 conversation = None
465 cls._chat_xfe = ""
466 cookies = await cls.get_default_cookies(session)
467 continue
468 else:
469 raise DuckDuckGoChallengeError(f"Challenge error after {cls.max_retries} retries: {str(e)}")
310 470
471 # For other status codes, use the standard error handler
311 472 await raise_for_status(response)
312 473 reason = None
313 474 full_message = ""
@@ -328,6 +489,11 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
328 489 if error_type == "ERR_CONVERSATION_LIMIT":
329 490 raise ConversationLimitError(error_type)
330 491 raise RateLimitError(error_type)
492 elif message.get("status") == 418 and error_type == "ERR_CHALLENGE":
493 # Handle challenge error by refreshing tokens and retrying
494 if retry_count < cls.max_retries:
495 # Don't raise here, let the outer exception handler retry
496 raise DuckDuckGoChallengeError(f"Challenge detected: {error_type}")
331 497 raise DuckDuckGoSearchException(error_type)
332 498
333 499 if "message" in message:
@@ -339,15 +505,19 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
339 505 reason = "stop"
340 506
341 507 # Step 8: Update conversation with response information
508 # Always update the VQD tokens from the response headers
509 conversation.vqd = response.headers.get("x-vqd-4", conversation.vqd)
510 conversation.vqd_hash_1 = response.headers.get("x-vqd-hash-1", conversation.vqd_hash_1)
511
512 # Update cookies
513 conversation.cookies = {
514 n: c.value
515 for n, c in session.cookie_jar.filter_cookies(URL(cls.url)).items()
516 }
517
518 # If requested, return the updated conversation
342 519 if return_conversation:
343 520 conversation.message_history.append({"role": "assistant", "content": full_message})
344 # Update tokens from response headers
345 conversation.vqd = response.headers.get("x-vqd-4", conversation.vqd)
346 conversation.vqd_hash_1 = response.headers.get("x-vqd-hash-1", conversation.vqd_hash_1)
347 conversation.cookies = {
348 n: c.value
349 for n, c in session.cookie_jar.filter_cookies(URL(cls.url)).items()
350 }
351 521 yield conversation
352 522
353 523 if reason is not None:
@@ -356,11 +526,18 @@ class DDG(AsyncGeneratorProvider, ProviderModelMixin):
356 526 # If we got here, the request was successful
357 527 break
358 528
359 except (RateLimitError, ResponseStatusError) as e:
360 if "429" in str(e) and retry_count < cls.max_retries:
529 except (RateLimitError, ResponseStatusError, DuckDuckGoChallengeError) as e:
530 if ("429" in str(e) or isinstance(e, DuckDuckGoChallengeError)) and retry_count < cls.max_retries:
361 531 retry_count += 1
362 532 wait_time = cls.base_delay * (2 ** retry_count) * (1 + random.random())
363 533 await asyncio.sleep(wait_time)
534
535 # For challenge errors, refresh tokens and cookies
536 if isinstance(e, DuckDuckGoChallengeError):
537 # Reset conversation to force new token acquisition
538 conversation = None
539 # Clear class cache to force refresh
540 cls._chat_xfe = ""
364 541 else:
365 542 raise
366 543 except asyncio.TimeoutError as e:
Modified g4f/Provider/PollinationsAI.py +49 -21
@@ -46,11 +46,13 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
46 46 default_model = "openai"
47 47 default_image_model = "flux"
48 48 default_vision_model = default_model
49 default_audio_model = "openai-audio"
49 50 text_models = [default_model]
50 51 image_models = [default_image_model]
52 audio_models = [default_audio_model]
51 53 extra_image_models = ["flux-pro", "flux-dev", "flux-schnell", "midjourney", "dall-e-3", "turbo"]
52 vision_models = [default_vision_model, "gpt-4o-mini", "o3-mini", "openai", "openai-large"]
53 extra_text_models = vision_models
54 vision_models = ["gpt-4o-mini", "o3-mini", "openai-large"] # Removed duplicates with default_model
55 extra_text_models = [] # Will be populated with unique vision models
54 56 _models_loaded = False
55 57 model_aliases = {
56 58 ### Text Models ###
@@ -68,7 +70,12 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
68 70 "gemini-2.0": "gemini",
69 71 "gemini-2.0-flash": "gemini",
70 72 "gemini-2.0-flash-thinking": "gemini-thinking",
71 "deepseek-r1": "deepseek-r1-llama",
73 "gemini-2.0-flash-thinking": "gemini-reasoning",
74 "deepseek-r1": "deepseek-reasoning-large",
75 "deepseek-r1": "deepseek-reasoning",
76 "deepseek-v3": "deepseek",
77 "qwq-32b": "qwen-reasoning",
78 "llama-3.2-11b": "llama-vision",
72 79 "gpt-4o-audio": "openai-audio",
73 80
74 81 ### Image Models ###
@@ -86,37 +93,52 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
86 93 else:
87 94 new_image_models = []
88 95
89 # Combine models without duplicates
90 all_image_models = (
91 cls.image_models + # Already contains the default
92 cls.extra_image_models +
93 new_image_models
94 )
95 cls.image_models = list(dict.fromkeys(all_image_models))
96 # Combine image models without duplicates
97 all_image_models = [cls.default_image_model] # Start with default model
98
99 # Add extra image models if not already in the list
100 for model in cls.extra_image_models + new_image_models:
101 if model not in all_image_models:
102 all_image_models.append(model)
103
104 cls.image_models = all_image_models
96 105
97 106 # Update of text models
98 107 text_response = requests.get("https://text.pollinations.ai/models")
99 108 text_response.raise_for_status()
100 109 models = text_response.json()
101 original_text_models = [
110
111 # Purpose of text models
112 cls.text_models = [
102 113 model.get("name")
103 114 for model in models
104 if model.get("type") == "chat"
115 if "input_modalities" in model and "text" in model["input_modalities"]
105 116 ]
117
118 # Purpose of audio models
106 119 cls.audio_models = {
107 120 model.get("name"): model.get("voices")
108 121 for model in models
109 122 if model.get("audio")
110 123 }
124
125 # Create a set of unique text models starting with default model
126 unique_text_models = {cls.default_model}
111 127
112 # Combining text models
113 combined_text = (
114 cls.text_models + # Already contains the default
115 cls.extra_text_models +
116 original_text_models +
117 cls.vision_models
118 )
119 cls.text_models = list(dict.fromkeys(combined_text))
128 # Add models from vision_models
129 unique_text_models.update(cls.vision_models)
130
131 # Add models from the API response
132 for model in models:
133 model_name = model.get("name")
134 if model_name and "input_modalities" in model and "text" in model["input_modalities"]:
135 unique_text_models.add(model_name)
136
137 # Convert to list and update text_models
138 cls.text_models = list(unique_text_models)
139
140 # Update extra_text_models with unique vision models
141 cls.extra_text_models = [model for model in cls.vision_models if model != cls.default_model]
120 142
121 143 cls._models_loaded = True
122 144
@@ -128,7 +150,13 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
128 150 cls.image_models = [cls.default_image_model]
129 151 debug.error(f"Failed to fetch models: {e}")
130 152
131 return cls.text_models + cls.image_models
153 # Return unique models across all categories
154 all_models = set(cls.text_models)
155 all_models.update(cls.image_models)
156 all_models.update(cls.audio_models.keys())
157 result = list(all_models)
158 return result
159
132 160
133 161 @classmethod
134 162 async def create_async_generator(
Modified g4f/Provider/PollinationsImage.py +1 -0
@@ -11,6 +11,7 @@ class PollinationsImage(PollinationsAI):
11 11 default_model = "flux"
12 12 default_vision_model = None
13 13 default_image_model = default_model
14 audio_models = None
14 15 image_models = [default_image_model] # Default models
15 16 _models_loaded = False # Add a checkbox for synchronization
16 17
Modified g4f/gui/client/static/js/chat.v1.js +4 -2
@@ -2306,7 +2306,7 @@ async function on_api() {
2306 2306 models.forEach((model) => {
2307 2307 let option = document.createElement("option");
2308 2308 option.value = model.name;
2309 option.text = model.name + (model.image ? " (Image Generation)" : "") + (model.vision ? " (Image Upload)" : "");
2309 option.text = model.name + (model.image ? " (Image Generation)" : "") + (model.vision ? " (Image Upload)" : "") + (model.audio ? " (Audio Generation)" : "") + (model.video ? " (Video Generation)" : "");
2310 2310 option.dataset.providers = model.providers.join(" ");
2311 2311 modelSelect.appendChild(option);
2312 2312 is_demo = model.demo;
@@ -2355,6 +2355,8 @@ async function on_api() {
2355 2355 option.text = provider.label
2356 2356 + (provider.vision ? " (Image Upload)" : "")
2357 2357 + (provider.image ? " (Image Generation)" : "")
2358 + (provider.audio ? " (Audio Generation)" : "")
2359 + (provider.video ? " (Video Generation)" : "")
2358 2360 + (provider.nodriver ? " (Browser)" : "")
2359 2361 + (provider.hf_space ? " (HuggingSpace)" : "")
2360 2362 + (!provider.nodriver && provider.auth ? " (Auth)" : "");
@@ -2942,7 +2944,7 @@ async function load_provider_models(provider=null) {
2942 2944 let option = document.createElement('option');
2943 2945 option.value = model.model;
2944 2946 option.dataset.label = model.model;
2945 option.text = `${model.model}${model.image ? " (Image Generation)" : ""}${model.vision ? " (Image Upload)" : ""}`;
2947 option.text = `${model.model}${model.image ? " (Image Generation)" : ""}${model.audio ? " (Audio Generation)" : ""}${model.video ? " (Video Generation)" : ""}${model.vision ? " (Image Upload)" : ""}`;
2946 2948 if (model.task) {
2947 2949 option.text += ` (${model.task})`;
2948 2950 }
Modified g4f/gui/server/api.py +6 -0
@@ -30,6 +30,8 @@ class Api:
30 30 "name": model.name,
31 31 "image": isinstance(model, models.ImageModel),
32 32 "vision": isinstance(model, models.VisionModel),
33 "audio": isinstance(model, models.AudioModel),
34 "video": isinstance(model, models.VideoModel),
33 35 "providers": [
34 36 getattr(provider, "parent", provider.__name__)
35 37 for provider in providers
@@ -52,6 +54,8 @@ class Api:
52 54 "model": model,
53 55 "default": model == provider.default_model,
54 56 "vision": getattr(provider, "default_vision_model", None) == model or model in getattr(provider, "vision_models", []),
57 "audio": getattr(provider, "default_audio_model", None) == model or model in getattr(provider, "audio_models", []),
58 "video": getattr(provider, "default_video_model", None) == model or model in getattr(provider, "video_models", []),
55 59 "image": False if provider.image_models is None else model in provider.image_models,
56 60 "task": None if not hasattr(provider, "task_mapping") else provider.task_mapping[model] if model in provider.task_mapping else None
57 61 }
@@ -66,6 +70,8 @@ class Api:
66 70 "label": provider.label if hasattr(provider, "label") else provider.__name__,
67 71 "parent": getattr(provider, "parent", None),
68 72 "image": bool(getattr(provider, "image_models", False)),
73 "audio": getattr(provider, "audio_models", None) is not None,
74 "video": getattr(provider, "video_models", None) is not None,
69 75 "vision": getattr(provider, "default_vision_model", None) is not None,
70 76 "nodriver": getattr(provider, "use_nodriver", False),
71 77 "hf_space": getattr(provider, "hf_space", False),
Modified g4f/gui/server/backend_api.py +2 -0
@@ -99,6 +99,8 @@ class Backend_Api(Api):
99 99 "name": model.name,
100 100 "image": isinstance(model, models.ImageModel),
101 101 "vision": isinstance(model, models.VisionModel),
102 "audio": isinstance(model, models.AudioModel),
103 "video": isinstance(model, models.VideoModel),
102 104 "providers": [
103 105 getattr(provider, "parent", provider.__name__)
104 106 for provider in providers
Modified g4f/models.py +34 -14
@@ -6,6 +6,7 @@ from .Provider import IterListProvider, ProviderType
6 6 from .Provider import (
7 7 ### No Auth Required ###
8 8 AllenAI,
9 ARTA,
9 10 Blackbox,
10 11 ChatGLM,
11 12 ChatGptEs,
@@ -77,7 +78,10 @@ class ImageModel(Model):
77 78
78 79 class AudioModel(Model):
79 80 pass
80
81
82 class VideoModel(Model):
83 pass
84
81 85 class VisionModel(Model):
82 86 pass
83 87
@@ -105,7 +109,7 @@ default = Model(
105 109 ])
106 110 )
107 111
108 default_vision = Model(
112 default_vision = VisionModel(
109 113 name = "",
110 114 base_provider = "",
111 115 best_provider = IterListProvider([
@@ -115,6 +119,7 @@ default_vision = Model(
115 119 DeepInfraChat,
116 120 PollinationsAI,
117 121 Dynaspark,
122 AllenAI,
118 123 HuggingSpace,
119 124 GeminiPro,
120 125 HuggingFaceAPI,
@@ -263,7 +268,7 @@ llama_3_2_90b = Model(
263 268 llama_3_3_70b = Model(
264 269 name = "llama-3.3-70b",
265 270 base_provider = "Meta Llama",
266 best_provider = IterListProvider([DDG, DeepInfraChat, LambdaChat, PollinationsAI, Jmuz, HuggingChat, HuggingFace])
271 best_provider = IterListProvider([Blackbox, DDG, DeepInfraChat, LambdaChat, PollinationsAI, Jmuz, HuggingChat, HuggingFace])
267 272 )
268 273
269 274 ### Mistral ###
@@ -287,7 +292,7 @@ mistral_nemo = Model(
287 292 mixtral_small_24b = Model(
288 293 name = "mixtral-small-24b",
289 294 base_provider = "Mistral",
290 best_provider = IterListProvider([DDG, DeepInfraChat])
295 best_provider = IterListProvider([Blackbox, DDG, DeepInfraChat])
291 296 )
292 297
293 298 ### NousResearch ###
@@ -383,7 +388,7 @@ claude_3_haiku = Model(
383 388 claude_3_5_sonnet = Model(
384 389 name = 'claude-3.5-sonnet',
385 390 base_provider = 'Anthropic',
386 best_provider = IterListProvider([Jmuz, Liaobots])
391 best_provider = IterListProvider([Blackbox, Jmuz, Liaobots])
387 392 )
388 393
389 394 # claude 3.7
@@ -491,7 +496,7 @@ qwen_2_5_max = Model(
491 496 qwq_32b = Model(
492 497 name = 'qwq-32b',
493 498 base_provider = 'Qwen',
494 best_provider = IterListProvider([Jmuz, HuggingChat])
499 best_provider = IterListProvider([Blackbox, PollinationsAI, Jmuz, HuggingChat])
495 500 )
496 501 qvq_72b = VisionModel(
497 502 name = 'qvq-72b',
@@ -516,7 +521,7 @@ deepseek_chat = Model(
516 521 deepseek_v3 = Model(
517 522 name = 'deepseek-v3',
518 523 base_provider = 'DeepSeek',
519 best_provider = IterListProvider([Blackbox, DeepInfraChat, LambdaChat, OIVSCode, TypeGPT, Liaobots])
524 best_provider = IterListProvider([Blackbox, DeepInfraChat, LambdaChat, PollinationsAI, OIVSCode, TypeGPT, Liaobots])
520 525 )
521 526
522 527 deepseek_r1 = Model(
@@ -645,8 +650,8 @@ minicpm_2_5 = Model(
645 650 )
646 651
647 652 ### Ai2 ###
648 tulu_3_405b = Model(
649 name = "tulu-3-405b",
653 olmo_1_7b = Model(
654 name = "olmo-1-7b",
650 655 base_provider = "Ai2",
651 656 best_provider = AllenAI
652 657 )
@@ -657,6 +662,18 @@ olmo_2_13b = Model(
657 662 best_provider = AllenAI
658 663 )
659 664
665 olmo_2_32b = Model(
666 name = "olmo-2-32b",
667 base_provider = "Ai2",
668 best_provider = AllenAI
669 )
670
671 olmo_4_synthetic = VisionModel(
672 name = "olmo-4-synthetic",
673 base_provider = "Ai2",
674 best_provider = AllenAI
675 )
676
660 677 tulu_3_1_8b = Model(
661 678 name = "tulu-3-1-8b",
662 679 base_provider = "Ai2",
@@ -669,12 +686,13 @@ tulu_3_70b = Model(
669 686 best_provider = AllenAI
670 687 )
671 688
672 olmoe_0125 = Model(
673 name = "olmoe-0125",
689 tulu_3_405b = Model(
690 name = "tulu-3-405b",
674 691 base_provider = "Ai2",
675 692 best_provider = AllenAI
676 693 )
677 694
695 ### Liquid AI ###
678 696 lfm_40b = Model(
679 697 name = "lfm-40b",
680 698 base_provider = "Liquid AI",
@@ -710,7 +728,7 @@ sd_3_5 = ImageModel(
710 728 flux = ImageModel(
711 729 name = 'flux',
712 730 base_provider = 'Black Forest Labs',
713 best_provider = IterListProvider([Blackbox, PollinationsImage, Websim, HuggingSpace])
731 best_provider = IterListProvider([Blackbox, PollinationsImage, Websim, HuggingSpace, ARTA])
714 732 )
715 733
716 734 flux_pro = ImageModel(
@@ -922,11 +940,13 @@ class ModelUtils:
922 940 minicpm_2_5.name: minicpm_2_5,
923 941
924 942 ### Ai2 ###
925 tulu_3_405b.name: tulu_3_405b,
943 olmo_1_7b.name: olmo_1_7b,
926 944 olmo_2_13b.name: olmo_2_13b,
945 olmo_2_32b.name: olmo_2_32b,
946 olmo_4_synthetic.name: olmo_4_synthetic,
927 947 tulu_3_1_8b.name: tulu_3_1_8b,
928 948 tulu_3_70b.name: tulu_3_70b,
929 olmoe_0125.name: olmoe_0125,
949 tulu_3_405b.name: tulu_3_405b,
930 950
931 951 ### Liquid AI ###
932 952 lfm_40b.name: lfm_40b,