The g4f api cannot specify a provider! How to solve this? #2333
-
The g4f api cannot specify a provider! How to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
After looking into the code, I found out how to control which provider the api uses! You're going to have to manually open models.py located somewhere in your g4f folder, usually located in the following locations: System-Wide: Current User: Open it in notepad or whatever default text editor you use and then scroll towards "Text" section near the top, there you'll see For example, if I wanted to remove ChatGptEs when using g4f api with gpt-4o, I'll edit it out like this:
You can customize the list if it supports the given model, otherwise just remove what you don't want the api to use! |
Beta Was this translation helpful? Give feedback.
After looking into the code, I found out how to control which provider the api uses!
You're going to have to manually open models.py located somewhere in your g4f folder, usually located in the following locations:
System-Wide:
C:\Python[Version]\Lib\site-packages\g4f\models.py
Current User:
C:\Users[user]\AppData\Local\Programs\Python\Python[Version]\Lib\site-packages\g4f\models.py
Open it in notepad or whatever default text editor you use and then scroll towards "Text" section near the top, there you'll see
various models with a "best_provider" list, look at the list of providers and remove anything you don't want to use for the given
ChatGPT Model you're using.
For example, if I wanted…