diff --git a/docs/providers.md b/docs/providers.md new file mode 100644 index 00000000000..d0da9491f62 --- /dev/null +++ b/docs/providers.md @@ -0,0 +1,575 @@ + +## Free + +### AmigoChat +| Provider | `g4f.Provider.AmigoChat` | +| -------- | ---- | +| **Website** | [amigochat.io](https://amigochat.io/chat/) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4o, gpt-4o-mini, llama-3.1-405b, mistral-nemo, gemini-flash, gemma-2b, claude-3.5-sonnet, command-r-plus, qwen-2.5-72b, grok-beta (37)| +| **Image Models (Image Generation)** | flux-realism, flux-pro, dall-e-3, flux-dev | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Blackbox AI +| Provider | `g4f.Provider.Blackbox` | +| -------- | ---- | +| **Website** | [blackbox.ai](https://www.blackbox.ai) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gpt-4, gpt-4o, llama-3.1-8b, llama-3.1-70b, llama-3.1-405b, gemini-pro, gemini-flash, claude-3.5-sonnet, blackboxai, blackboxai-pro (41)| +| **Image Models (Image Generation)** | flux | +| **Vision (Image Upload)** | ✔️ | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Blackbox2 +| Provider | `g4f.Provider.Blackbox2` | +| -------- | ---- | +| **Website** | [blackbox.ai](https://www.blackbox.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | llama-3.1-70b (2)| +| **Image Models (Image Generation)** | flux | +| **Authentication** | ❌ | +| **Streaming** | ❌ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### ChatGpt +| Provider | `g4f.Provider.ChatGpt` | +| -------- | ---- | +| **Website** | [chatgpt.com](https://chatgpt.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-3.5-turbo, gpt-4, gpt-4-turbo, gpt-4o, gpt-4o-mini (7)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### ChatGptEs +| Provider | `g4f.Provider.ChatGptEs` | +| -------- | ---- | +| **Website** | [chatgpt.es](https://chatgpt.es) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gpt-4, gpt-4o, gpt-4o-mini (3)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Cloudflare AI +| Provider | `g4f.Provider.Cloudflare` | +| -------- | ---- | +| **Website** | [playground.ai.cloudflare.com](https://playground.ai.cloudflare.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | llama-2-7b, llama-3-8b, llama-3.1-8b, llama-3.2-1b, qwen-1.5-7b (37)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Microsoft Copilot +| Provider | `g4f.Provider.Copilot` | +| -------- | ---- | +| **Website** | [copilot.microsoft.com](https://copilot.microsoft.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gpt-4 (1)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### DuckDuckGo AI Chat +| Provider | `g4f.Provider.DDG` | +| -------- | ---- | +| **Website** | [duckduckgo.com](https://duckduckgo.com/aichat) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gpt-4, gpt-4o, gpt-4o-mini, llama-3.1-70b, mixtral-8x7b, claude-3-haiku (8)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### DarkAI +| Provider | `g4f.Provider.DarkAI` | +| -------- | ---- | +| **Website** | [darkai.foundation](https://darkai.foundation/chat) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gpt-3.5-turbo, gpt-4o, llama-3.1-70b (3)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Flux (HuggingSpace) +| Provider | `g4f.Provider.Flux` | +| -------- | ---- | +| **Website** | [black-forest-labs-flux-1-dev.hf.space](https://black-forest-labs-flux-1-dev.hf.space) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Image Models (Image Generation)** | flux-dev | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Free2GPT +| Provider | `g4f.Provider.Free2GPT` | +| -------- | ---- | +| **Website** | [chat10.free2gpt.xyz](https://chat10.free2gpt.xyz) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ✔️ | +### FreeGpt +| Provider | `g4f.Provider.FreeGpt` | +| -------- | ---- | +| **Website** | [freegptsnav.aifree.site](https://freegptsnav.aifree.site) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gemini-pro (1)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### GizAI +| Provider | `g4f.Provider.GizAI` | +| -------- | ---- | +| **Website** | [app.giz.ai](https://app.giz.ai/assistant) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gemini-flash (1)| +| **Authentication** | ❌ | +| **Streaming** | ❌ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### HuggingFace +| Provider | `g4f.Provider.HuggingFace` | +| -------- | ---- | +| **Website** | [huggingface.co](https://huggingface.co/chat) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | llama-3.2-11b, llama-3.3-70b, mistral-nemo, hermes-3, phi-3.5-mini, command-r-plus, qwen-2.5-72b, qwen-2.5-coder-32b, qwq-32b, nemotron-70b (11)| +| **Image Models (Image Generation)** | flux-dev | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ✔️ | +### Liaobots +| Provider | `g4f.Provider.Liaobots` | +| -------- | ---- | +| **Website** | [liaobots.site](https://liaobots.site) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4, gpt-4o, gpt-4o-mini, o1-preview, o1-mini, gemini-pro, gemini-flash, claude-3-opus, claude-3-sonnet, claude-3.5-sonnet, grok-beta (14)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### GPT4All +| Provider | `g4f.Provider.Local` | +| -------- | ---- | +| **Website** | ❌ | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Meta AI +| Provider | `g4f.Provider.MetaAI` | +| -------- | ---- | +| **Website** | [meta.ai](https://www.meta.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | meta-ai (1)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Mhystical +| Provider | `g4f.Provider.Mhystical` | +| -------- | ---- | +| **Website** | [api.mhystical.cc](https://api.mhystical.cc) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4 (1)| +| **Authentication** | ❌ | +| **Streaming** | ❌ | +| **System message** | ❌ | +| **Message history** | ✔️ | +### Ollama +| Provider | `g4f.Provider.Ollama` | +| -------- | ---- | +| **Website** | [ollama.com](https://ollama.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### OpenAI ChatGPT +| Provider | `g4f.Provider.OpenaiChat` | +| -------- | ---- | +| **Website** | [chatgpt.com](https://chatgpt.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gpt-4, gpt-4o, gpt-4o-mini, o1-preview, o1-mini (8)| +| **Vision (Image Upload)** | ✔️ | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### PerplexityLabs +| Provider | `g4f.Provider.PerplexityLabs` | +| -------- | ---- | +| **Website** | [labs.perplexity.ai](https://labs.perplexity.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | llama-3.1-8b, llama-3.1-70b, llama-3.3-70b, sonar-online, sonar-chat, lfm-40b (8)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Pi +| Provider | `g4f.Provider.Pi` | +| -------- | ---- | +| **Website** | [pi.ai](https://pi.ai/talk) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Pizzagpt +| Provider | `g4f.Provider.Pizzagpt` | +| -------- | ---- | +| **Website** | [pizzagpt.it](https://www.pizzagpt.it) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gpt-4o-mini (1)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Pollinations AI +| Provider | `g4f.Provider.PollinationsAI` | +| -------- | ---- | +| **Website** | [pollinations.ai](https://pollinations.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4, gpt-4o, llama-3.1-70b, mistral-nemo, mistral-large, claude-3.5-sonnet, command-r, qwen-2.5-coder-32b, p1, evil, midijourney, unity, rtist (25)| +| **Image Models (Image Generation)** | flux, flux-realism, flux-cablyai, flux-anime, flux-3d, any-dark, flux-pro, turbo, midjourney, dall-e-3 | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Prodia +| Provider | `g4f.Provider.Prodia` | +| -------- | ---- | +| **Website** | [app.prodia.com](https://app.prodia.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### ReplicateHome +| Provider | `g4f.Provider.ReplicateHome` | +| -------- | ---- | +| **Website** | [replicate.com](https://replicate.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gemma-2b (4)| +| **Image Models (Image Generation)** | sd-3, sdxl, playground-v2.5 | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Rubiks AI +| Provider | `g4f.Provider.RubiksAI` | +| -------- | ---- | +| **Website** | [rubiks.ai](https://rubiks.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4o, gpt-4o-mini, o1-mini, llama-3.1-70b, claude-3.5-sonnet, grok-beta (8)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### TeachAnything +| Provider | `g4f.Provider.TeachAnything` | +| -------- | ---- | +| **Website** | [teach-anything.com](https://www.teach-anything.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | llama-3.1-70b (1)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### TheB.AI +| Provider | `g4f.Provider.Theb` | +| -------- | ---- | +| **Website** | [beta.theb.ai](https://beta.theb.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### You.com +| Provider | `g4f.Provider.You` | +| -------- | ---- | +| **Website** | [you.com](https://you.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4, gpt-4-turbo, gpt-4o, gpt-4o-mini, llama-3.1-70b, claude-3-opus, claude-3-sonnet, claude-3-haiku, claude-3.5-sonnet, command-r-plus, command-r (20)| +| **Authentication** | ❌ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | + +## Auth + +### Airforce +| Provider | `g4f.Provider.Airforce` | +| -------- | ---- | +| **Website** | [llmplayground.net](https://llmplayground.net) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4, gpt-4-turbo, gpt-4o, gpt-4o-mini, o1-mini, llama-2-7b, llama-3.1-8b, llama-3.1-70b, hermes-2-dpo, hermes-2-pro, phi-2, openchat-3.5, deepseek-coder, german-7b, openhermes-2.5, lfm-40b, zephyr-7b, neural-7b, evil (40)| +| **Image Models (Image Generation)** | flux, flux-realism, flux-anime, flux-3d, flux-disney, flux-pixel, flux-4o, any-dark, midjourney, dall-e-3, sdxl, flux-pro | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Microsoft Designer in Bing +| Provider | `g4f.Provider.BingCreateImages` | +| -------- | ---- | +| **Website** | [bing.com](https://www.bing.com/images/create) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Image Models (Image Generation)** | dall-e-3 | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Cerebras Inference +| Provider | `g4f.Provider.Cerebras` | +| -------- | ---- | +| **Website** | [inference.cerebras.ai](https://inference.cerebras.ai/) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | llama-3.1-8b, llama-3.1-70b (2)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Microsoft Copilot +| Provider | `g4f.Provider.CopilotAccount` | +| -------- | ---- | +| **Website** | [copilot.microsoft.com](https://copilot.microsoft.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Image Models (Image Generation)** | dall-e-3 | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### DeepInfra +| Provider | `g4f.Provider.DeepInfra` | +| -------- | ---- | +| **Website** | [deepinfra.com](https://deepinfra.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### DeepInfra Chat +| Provider | `g4f.Provider.DeepInfraChat` | +| -------- | ---- | +| **Website** | [deepinfra.com](https://deepinfra.com/chat) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | llama-3.1-8b, llama-3.1-70b, qwen-2-72b, qwen-2.5-coder-32b, qwq-32b, wizardlm-2-8x22b, nemotron-70b (7)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### DeepInfraImage +| Provider | `g4f.Provider.DeepInfraImage` | +| -------- | ---- | +| **Website** | [deepinfra.com](https://deepinfra.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Google Gemini +| Provider | `g4f.Provider.Gemini` | +| -------- | ---- | +| **Website** | [gemini.google.com](https://gemini.google.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | gemini-pro, gemini-flash (3)| +| **Image Models (Image Generation)** | gemini | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Google Gemini API +| Provider | `g4f.Provider.GeminiPro` | +| -------- | ---- | +| **Website** | [ai.google.dev](https://ai.google.dev) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gemini-pro, gemini-flash (4)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ✔️ | +### GigaChat +| Provider | `g4f.Provider.GigaChat` | +| -------- | ---- | +| **Website** | [developers.sber.ru](https://developers.sber.ru/gigachat) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | GigaChat:latest (3)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### GithubCopilot +| Provider | `g4f.Provider.GithubCopilot` | +| -------- | ---- | +| **Website** | [github.com](https://github.com/copilot) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4o, o1-preview, o1-mini, claude-3.5-sonnet (4)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Groq +| Provider | `g4f.Provider.Groq` | +| -------- | ---- | +| **Website** | [console.groq.com](https://console.groq.com/playground) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | mixtral-8x7b (18)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### HuggingChat +| Provider | `g4f.Provider.HuggingChat` | +| -------- | ---- | +| **Website** | [huggingface.co](https://huggingface.co/chat) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Models** | llama-3.2-11b, llama-3.3-70b, mistral-nemo, hermes-3, phi-3.5-mini, command-r-plus, qwen-2.5-72b, qwen-2.5-coder-32b, qwq-32b, nemotron-70b (11)| +| **Image Models (Image Generation)** | flux-dev | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### HuggingFace (Inference API) +| Provider | `g4f.Provider.HuggingFaceAPI` | +| -------- | ---- | +| **Website** | [api-inference.huggingface.co](https://api-inference.huggingface.co) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Meta AI +| Provider | `g4f.Provider.MetaAIAccount` | +| -------- | ---- | +| **Website** | [meta.ai](https://www.meta.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | meta-ai (1)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Microsoft Designer +| Provider | `g4f.Provider.MicrosoftDesigner` | +| -------- | ---- | +| **Website** | [designer.microsoft.com](https://designer.microsoft.com) | +| **Status** | ![Active](https://img.shields.io/badge/Active-brightgreen) | +| **Image Models (Image Generation)** | dall-e-3 | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### OpenAI API +| Provider | `g4f.Provider.OpenaiAPI` | +| -------- | ---- | +| **Website** | [platform.openai.com](https://platform.openai.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### OpenAI ChatGPT +| Provider | `g4f.Provider.OpenaiAccount` | +| -------- | ---- | +| **Website** | [chatgpt.com](https://chatgpt.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-4o-mini, o1-preview, o1-mini (9)| +| **Image Models (Image Generation)** | dall-e-3 | +| **Vision (Image Upload)** | ✔️ | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Perplexity API +| Provider | `g4f.Provider.PerplexityApi` | +| -------- | ---- | +| **Website** | [perplexity.ai](https://www.perplexity.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### Poe +| Provider | `g4f.Provider.Poe` | +| -------- | ---- | +| **Website** | [poe.com](https://poe.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Raycast +| Provider | `g4f.Provider.Raycast` | +| -------- | ---- | +| **Website** | [raycast.com](https://raycast.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Reka +| Provider | `g4f.Provider.Reka` | +| -------- | ---- | +| **Website** | [chat.reka.ai](https://chat.reka.ai/) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### Replicate +| Provider | `g4f.Provider.Replicate` | +| -------- | ---- | +| **Website** | [replicate.com](https://replicate.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ❌ | +### TheB.AI API +| Provider | `g4f.Provider.ThebApi` | +| -------- | ---- | +| **Website** | [theb.ai](https://theb.ai) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Models** | gpt-3.5-turbo, gpt-4, gpt-4-turbo (21)| +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ✔️ | +| **Message history** | ✔️ | +### WhiteRabbitNeo +| Provider | `g4f.Provider.WhiteRabbitNeo` | +| -------- | ---- | +| **Website** | [whiterabbitneo.com](https://www.whiterabbitneo.com) | +| **Status** | ![Unknown](https://img.shields.io/badge/Unknown-grey) | +| **Authentication** | ✔️ | +| **Streaming** | ✔️ | +| **System message** | ❌ | +| **Message history** | ✔️ | +-------------------------------------------------- +| Label | Provider | Image Model | Vision Model | Website | +| ----- | -------- | ----------- | ------------ | ------- | +| Airforce | `g4f.Provider.Airforce` | flux, flux-realism, flux-anime, flux-3d, flux-disney, flux-pixel, flux-4o, any-dark, midjourney, dall-e-3, sdxl, flux-pro| ❌ | [llmplayground.net](https://llmplayground.net) | +| AmigoChat | `g4f.Provider.AmigoChat` | flux-realism, flux-pro, dall-e-3, flux-dev| ❌ | [amigochat.io](https://amigochat.io/chat/) | +| Microsoft Designer in Bing | `g4f.Provider.BingCreateImages` | dall-e-3| ❌ | [bing.com](https://www.bing.com/images/create) | +| Blackbox AI | `g4f.Provider.Blackbox` | flux| ✔️ | [blackbox.ai](https://www.blackbox.ai) | +| Blackbox2 | `g4f.Provider.Blackbox2` | flux| ❌ | [blackbox.ai](https://www.blackbox.ai) | +| Microsoft Copilot | `g4f.Provider.CopilotAccount` | dall-e-3| ❌ | [copilot.microsoft.com](https://copilot.microsoft.com) | +| DeepInfraImage | `g4f.Provider.DeepInfraImage` | | ❌ | [deepinfra.com](https://deepinfra.com) | +| Flux (HuggingSpace) | `g4f.Provider.Flux` | flux-dev| ❌ | [black-forest-labs-flux-1-dev.hf.space](https://black-forest-labs-flux-1-dev.hf.space) | +| Google Gemini | `g4f.Provider.Gemini` | gemini| ❌ | [gemini.google.com](https://gemini.google.com) | +| HuggingChat | `g4f.Provider.HuggingChat` | flux-dev| ❌ | [huggingface.co](https://huggingface.co/chat) | +| HuggingFace | `g4f.Provider.HuggingFace` | flux-dev| ❌ | [huggingface.co](https://huggingface.co/chat) | +| Meta AI | `g4f.Provider.MetaAIAccount` | | ❌ | [meta.ai](https://www.meta.ai) | +| Microsoft Designer | `g4f.Provider.MicrosoftDesigner` | dall-e-3| ❌ | [designer.microsoft.com](https://designer.microsoft.com) | +| OpenAI ChatGPT | `g4f.Provider.OpenaiAccount` | dall-e-3, gpt-4, gpt-4o, dall-e-3| ✔️ | [chatgpt.com](https://chatgpt.com) | +| OpenAI ChatGPT | `g4f.Provider.OpenaiChat` | ❌| ✔️ | [chatgpt.com](https://chatgpt.com) | +| Pollinations AI | `g4f.Provider.PollinationsAI` | flux, flux-realism, flux-cablyai, flux-anime, flux-3d, any-dark, flux-pro, turbo, midjourney, dall-e-3| ❌ | [pollinations.ai](https://pollinations.ai) | +| Prodia | `g4f.Provider.Prodia` | | ❌ | [app.prodia.com](https://app.prodia.com) | +| ReplicateHome | `g4f.Provider.ReplicateHome` | sd-3, sdxl, playground-v2.5| ❌ | [replicate.com](https://replicate.com) | +| You.com | `g4f.Provider.You` | | ❌ | [you.com](https://you.com) | \ No newline at end of file diff --git a/docs/vision.md b/docs/vision.md new file mode 100644 index 00000000000..34a8ca391af --- /dev/null +++ b/docs/vision.md @@ -0,0 +1,83 @@ +## Vision Support in Chat Completion + +This documentation provides an overview of how to integrate vision support into chat completions using an API and a client. It includes examples to guide you through the process. + +### Example with the API + +To use vision support in chat completion with the API, follow the example below: + +```python +import requests +import json +from g4f.image import to_data_uri +from g4f.requests.raise_for_status import raise_for_status + +url = "http://localhost:8080/v1/chat/completions" +body = { + "model": "", + "provider": "Copilot", + "messages": [ + {"role": "user", "content": "what are on this image?"} + ], + "images": [ + ["data:image/jpeg;base64,...", "cat.jpeg"] + ] +} +response = requests.post(url, json=body, headers={"g4f-api-key": "secret"}) +raise_for_status(response) +print(response.json()) +``` + +In this example: +- `url` is the endpoint for the chat completion API. +- `body` contains the model, provider, messages, and images. +- `messages` is a list of message objects with roles and content. +- `images` is a list of image data in Data URI format and optional filenames. +- `response` stores the API response. + +### Example with the Client + +To use vision support in chat completion with the client, follow the example below: + +```python +import g4f +import g4f.Provider + +def chat_completion(prompt): + client = g4f.Client(provider=g4f.Provider.Blackbox) + images = [ + [open("docs/images/waterfall.jpeg", "rb"), "waterfall.jpeg"], + [open("docs/images/cat.webp", "rb"), "cat.webp"] + ] + response = client.chat.completions.create([{"content": prompt, "role": "user"}], "", images=images) + print(response.choices[0].message.content) + +prompt = "what are on this images?" +chat_completion(prompt) +``` + +``` +**Image 1** + +* A waterfall with a rainbow +* Lush greenery surrounding the waterfall +* A stream flowing from the waterfall + +**Image 2** + +* A white cat with blue eyes +* A bird perched on a window sill +* Sunlight streaming through the window +``` + +In this example: +- `client` initializes a new client with the specified provider. +- `images` is a list of image data and optional filenames. +- `response` stores the response from the client. +- The `chat_completion` function prints the chat completion output. + +### Notes + +- Multiple images can be sent. Each image has two data parts: image data (in Data URI format for the API) and an optional filename. +- The client supports bytes, IO objects, and PIL images as input. +- Ensure you use a provider that supports vision and multiple images. \ No newline at end of file diff --git a/etc/tool/readme_table.py b/etc/tool/readme_table.py index e89f861bed5..9f95e68036c 100644 --- a/etc/tool/readme_table.py +++ b/etc/tool/readme_table.py @@ -4,7 +4,9 @@ from g4f import models, ChatCompletion from g4f.providers.types import BaseRetryProvider, ProviderType -from etc.testing._providers import get_providers +from g4f.providers.base_provider import ProviderModelMixin +from g4f.Provider import __providers__ +from g4f.models import _all_models from g4f import debug debug.logging = True @@ -35,53 +37,76 @@ def test_async_list(providers: list[ProviderType]): return responses def print_providers(): - - providers = get_providers() + providers = [provider for provider in __providers__ if provider.working] responses = test_async_list(providers) - - for type in ("GPT-4", "GPT-3.5", "Other"): - lines = [ + lines = [] + for type in ("Free", "Auth"): + lines += [ "", - f"### {type}", + f"## {type}", "", - "| Website | Provider | GPT-3.5 | GPT-4 | Stream | Status | Auth |", - "| ------ | ------- | ------- | ----- | ------ | ------ | ---- |", ] - for is_working in (True, False): - for idx, _provider in enumerate(providers): - if is_working != _provider.working: - continue - do_continue = False - if type == "GPT-4" and _provider.supports_gpt_4: - do_continue = True - elif type == "GPT-3.5" and not _provider.supports_gpt_4 and _provider.supports_gpt_35_turbo: - do_continue = True - elif type == "Other" and not _provider.supports_gpt_4 and not _provider.supports_gpt_35_turbo: - do_continue = True - if not do_continue: - continue + for idx, _provider in enumerate(providers): + do_continue = False + if type == "Auth" and _provider.needs_auth: + do_continue = True + elif type == "Free" and not _provider.needs_auth: + do_continue = True + if not do_continue: + continue + + lines.append( + f"### {getattr(_provider, 'label', _provider.__name__)}", + ) + provider_name = f"`g4f.Provider.{_provider.__name__}`" + lines.append(f"| Provider | {provider_name} |") + lines.append("| -------- | ---- |") + + if _provider.url: netloc = urlparse(_provider.url).netloc.replace("www.", "") website = f"[{netloc}]({_provider.url})" - - provider_name = f"`g4f.Provider.{_provider.__name__}`" - - has_gpt_35 = "✔️" if _provider.supports_gpt_35_turbo else "❌" - has_gpt_4 = "✔️" if _provider.supports_gpt_4 else "❌" - stream = "✔️" if _provider.supports_stream else "❌" - if _provider.working: + else: + website = "❌" + + message_history = "✔️" if _provider.supports_message_history else "❌" + system = "✔️" if _provider.supports_system_message else "❌" + stream = "✔️" if _provider.supports_stream else "❌" + if _provider.working: + status = '![Active](https://img.shields.io/badge/Active-brightgreen)' + if responses[idx]: status = '![Active](https://img.shields.io/badge/Active-brightgreen)' - if responses[idx]: - status = '![Active](https://img.shields.io/badge/Active-brightgreen)' - else: - status = '![Unknown](https://img.shields.io/badge/Unknown-grey)' else: - status = '![Inactive](https://img.shields.io/badge/Inactive-red)' - auth = "✔️" if _provider.needs_auth else "❌" - - lines.append( - f"| {website} | {provider_name} | {has_gpt_35} | {has_gpt_4} | {stream} | {status} | {auth} |" - ) - print("\n".join(lines)) + status = '![Unknown](https://img.shields.io/badge/Unknown-grey)' + else: + status = '![Inactive](https://img.shields.io/badge/Inactive-red)' + auth = "✔️" if _provider.needs_auth else "❌" + + lines.append(f"| **Website** | {website} | \n| **Status** | {status} |") + + if issubclass(_provider, ProviderModelMixin): + try: + all_models = _provider.get_models() + models = [model for model in _all_models if model in all_models or model in _provider.model_aliases] + image_models = _provider.image_models + if image_models: + for alias, name in _provider.model_aliases.items(): + if alias in _all_models and name in image_models: + image_models.append(alias) + image_models = [model for model in image_models if model in _all_models] + if image_models: + models = [model for model in models if model not in image_models] + if models: + lines.append(f"| **Models** | {', '.join(models)} ({len(all_models)})|") + if image_models: + lines.append(f"| **Image Models (Image Generation)** | {', '.join(image_models)} |") + if hasattr(_provider, "vision_models"): + lines.append(f"| **Vision (Image Upload)** | ✔️ |") + except: + pass + + lines.append(f"| **Authentication** | {auth} | \n| **Streaming** | {stream} |") + lines.append(f"| **System message** | {system} | \n| **Message history** | {message_history} |") + return lines def print_models(): base_provider_names = { @@ -123,30 +148,34 @@ def print_models(): lines.append(f"| {name} | {base_provider} | {provider_name} | {website} |") - print("\n".join(lines)) + return lines def print_image_models(): lines = [ "| Label | Provider | Image Model | Vision Model | Website |", "| ----- | -------- | ----------- | ------------ | ------- |", ] - from g4f.gui.server.api import Api - for image_model in Api.get_image_models(): - provider_url = image_model["url"] + for provider in [provider for provider in __providers__ if provider.working and getattr(provider, "image_models", None) or getattr(provider, "vision_models", None)]: + provider_url = provider.url if provider.url else "❌" netloc = urlparse(provider_url).netloc.replace("www.", "") website = f"[{netloc}]({provider_url})" - label = image_model["provider"] if image_model["label"] is None else image_model["label"] - if image_model["image_model"] is None: - image_model["image_model"] = "❌" - if image_model["vision_model"] is None: - image_model["vision_model"] = "❌" - lines.append(f'| {label} | `g4f.Provider.{image_model["provider"]}` | {image_model["image_model"]}| {image_model["vision_model"]} | {website} |') + label = getattr(provider, "label", provider.__name__) + if provider.image_models: + image_models = ", ".join([model for model in provider.image_models if model in _all_models]) + else: + image_models = "❌" + if hasattr(provider, "vision_models"): + vision_models = "✔️" + else: + vision_models = "❌" + lines.append(f'| {label} | `g4f.Provider.{provider.__name__}` | {image_models}| {vision_models} | {website} |') - print("\n".join(lines)) + return lines if __name__ == "__main__": - #print_providers() - #print("\n", "-" * 50, "\n") - #print_models() - print("\n", "-" * 50, "\n") - print_image_models() \ No newline at end of file + with open("docs/providers.md", "w") as f: + f.write("\n".join(print_providers())) + f.write(f"\n{'-' * 50} \n") + #f.write("\n".join(print_models())) + #f.write(f"\n{'-' * 50} \n") + f.write("\n".join(print_image_models())) \ No newline at end of file diff --git a/g4f/Provider/needs_auth/HuggingFace.py b/g4f/Provider/needs_auth/HuggingFace.py index fd1da2a71b4..40db1ee7005 100644 --- a/g4f/Provider/needs_auth/HuggingFace.py +++ b/g4f/Provider/needs_auth/HuggingFace.py @@ -18,7 +18,7 @@ class HuggingFace(AsyncGeneratorProvider, ProviderModelMixin): supports_message_history = True default_model = HuggingChat.default_model default_image_model = HuggingChat.default_image_model - models = [*HuggingChat.models, default_image_model] + models = HuggingChat.models image_models = [default_image_model] model_aliases = HuggingChat.model_aliases