Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider Updates and Fixes #2570

Merged
merged 11 commits into from
Jan 15, 2025
Prev Previous commit
Next Next commit
Disabled provider 'g4f/Provider/ReplicateHome.py' and moved to 'g4f/P…
…rovider/not_working'
  • Loading branch information
kqlio67 committed Jan 14, 2025
commit d24a849f597b8ca9886786c882b3d17f459967a5
6 changes: 1 addition & 5 deletions docs/providers-and-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ This document provides an overview of various AI providers and models, including
|[pizzagpt.it](https://www.pizzagpt.it)|`g4f.Provider.Pizzagpt`|`gpt-4o-mini`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|❌|
|[pollinations.ai](https://pollinations.ai)|`g4f.Provider.PollinationsAI`|`gpt-4o, mistral-large, mistral-nemo, llama-3.3-70b, gpt-4, qwen-2-72b, qwen-2.5-coder-32b, claude-3.5-sonnet, command-r, deepseek-chat, llama-3.2-3b, evil, p1, turbo, unity, midijourney, rtist`|`flux, flux-realism, flux-cablyai, flux-anime, flux-3d, any-dark, flux-pro, midjourney, dall-e-3`|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|❌|
|[app.prodia.com](https://app.prodia.com)|`g4f.Provider.Prodia`|❌|✔|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|❌|
|[replicate.com](https://replicate.com)|`g4f.Provider.ReplicateHome`|`gemma-2b`|`sd-3, sdxl, playground-v2.5`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|❌|
|[rubiks.ai](https://rubiks.ai)|`g4f.Provider.RubiksAI`|`gpt-4o-mini, llama-3.1-70b`|❌|❌|✔|![Error](https://img.shields.io/badge/Active-brightgreen)|❌|
|[teach-anything.com](https://www.teach-anything.com)|`g4f.Provider.TeachAnything`|`llama-3.1-70b`|❌|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|❌|
|[you.com](https://you.com)|`g4f.Provider.You`|✔|✔|✔|✔|![](https://img.shields.io/badge/Active-brightgreen)|❌|
Expand Down Expand Up @@ -143,7 +142,6 @@ This document provides an overview of various AI providers and models, including
|gemini-1.5-pro|Google DeepMind|7+ Providers|[deepmind.google](https://deepmind.google/technologies/gemini/pro/)|
|gemini-2.0-flash|Google DeepMind|2+ Providers|[deepmind.google](https://deepmind.google/technologies/gemini/flash/)|
|gemini-2.0-flash-thinking|Google DeepMind|1+ Providers|[deepmind.google](https://ai.google.dev/gemini-api/docs/thinking-mode)|
|gemma-2b|Google|1+ Providers|[huggingface.co](https://huggingface.co/google/gemma-2b)|
|claude-3-haiku|Anthropic|2+ Providers|[anthropic.com](https://www.anthropic.com/news/claude-3-haiku)|
|claude-3-sonnet|Anthropic|1+ Providers|[anthropic.com](https://www.anthropic.com/news/claude-3-family)|
|claude-3-opus|Anthropic|2+ Providers|[anthropic.com](https://www.anthropic.com/news/claude-3-family)|
Expand Down Expand Up @@ -187,11 +185,9 @@ This document provides an overview of various AI providers and models, including
### Image Models
| Model | Base Provider | Providers | Website |
|-------|---------------|-----------|---------|
|sdxl|Stability AI|2+ Providers|[huggingface.co](https://huggingface.co/docs/diffusers/en/using-diffusers/sdxl)|
|sdxl|Stability AI|1+ Providers|[huggingface.co](https://huggingface.co/docs/diffusers/en/using-diffusers/sdxl)|
|sdxl-lora|Stability AI|1+ Providers|[huggingface.co](https://huggingface.co/blog/lcm_lora)|
|sd-3|Stability AI|1+ Providers|[huggingface.co](https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_3)|
|sd-3.5|Stability AI|1+ Providers|[huggingface.co](https://huggingface.co/stabilityai/stable-diffusion-3.5-large)|
|playground-v2.5|Playground AI|1+ Providers|[huggingface.co](https://huggingface.co/playgroundai/playground-v2.5-1024px-aesthetic)|
|flux|Black Forest Labs|4+ Providers|[github.com/black-forest-labs/flux](https://github.com/black-forest-labs/flux)|
|flux-pro|Black Forest Labs|2+ Providers|[github.com/black-forest-labs/flux](https://github.com/black-forest-labs/flux)|
|flux-dev|Black Forest Labs|3+ Providers|[huggingface.co](https://huggingface.co/black-forest-labs/FLUX.1-dev)|
Expand Down
1 change: 0 additions & 1 deletion g4f/Provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from .Pizzagpt import Pizzagpt
from .PollinationsAI import PollinationsAI
from .Prodia import Prodia
from .ReplicateHome import ReplicateHome
from .RubiksAI import RubiksAI
from .TeachAnything import TeachAnything
from .You import You
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
import asyncio
from aiohttp import ClientSession, ContentTypeError

from ..typing import AsyncResult, Messages
from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
from ..requests.aiohttp import get_connector
from ..requests.raise_for_status import raise_for_status
from .helper import format_prompt
from ..image import ImageResponse
from ...typing import AsyncResult, Messages
from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin
from ...requests.aiohttp import get_connector
from ...requests.raise_for_status import raise_for_status
from ..helper import format_prompt
from ...image import ImageResponse

class ReplicateHome(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://replicate.com"
api_endpoint = "https://homepage.replicate.com/api/prediction"
working = True

working = False
supports_stream = True

default_model = 'google-deepmind/gemma-2b-it'
Expand Down
1 change: 1 addition & 0 deletions g4f/Provider/not_working/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .Koala import Koala
from .MagickPen import MagickPen
from .MyShell import MyShell
from .ReplicateHome import ReplicateHome
from .RobocodersAPI import RobocodersAPI
from .Theb import Theb
from .Upstage import Upstage
27 changes: 1 addition & 26 deletions g4f/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
Pizzagpt,
PollinationsAI,
Reka,
ReplicateHome,
RubiksAI,
TeachAnything,
Yqcloud,
Expand Down Expand Up @@ -312,12 +311,6 @@ class ImageModel(Model):
best_provider = Liaobots
)

# gemma
gemma_2b = Model(
name = 'gemma-2b',
base_provider = 'Google',
best_provider = ReplicateHome
)

### Anthropic ###
# claude 3
Expand Down Expand Up @@ -585,28 +578,16 @@ class ImageModel(Model):
sdxl = ImageModel(
name = 'sdxl',
base_provider = 'Stability AI',
best_provider = IterListProvider([ReplicateHome, Airforce])
best_provider = Airforce

)

sd_3 = ImageModel(
name = 'sd-3',
base_provider = 'Stability AI',
best_provider = ReplicateHome
)

sd_3_5 = ImageModel(
name = 'sd-3.5',
base_provider = 'Stability AI',
best_provider = HuggingSpace
)

### Playground ###
playground_v2_5 = ImageModel(
name = 'playground-v2.5',
base_provider = 'Playground AI',
best_provider = ReplicateHome
)

### Flux AI ###
flux = ImageModel(
Expand Down Expand Up @@ -777,8 +758,6 @@ class ModelUtils:
gemini_2_0_flash.name: gemini_2_0_flash,
gemini_2_0_flash_thinking.name: gemini_2_0_flash_thinking,

# gemma
gemma_2b.name: gemma_2b,

### Anthropic ###
# claude 3
Expand Down Expand Up @@ -881,12 +860,8 @@ class ModelUtils:

### Stability AI ###
sdxl.name: sdxl,
sd_3.name: sd_3,
sd_3_5.name: sd_3_5,

### Playground ###
playground_v2_5.name: playground_v2_5,

### Flux AI ###
flux.name: flux,
flux_pro.name: flux_pro,
Expand Down
Loading