返回提交历史
Modified
README.md
+8
-7
Modified
g4f/Provider/HuggingChat.py
+7
-7
Modified
g4f/Provider/PerplexityLabs.py
+3
-2
Modified
g4f/models.py
+9
-2
XFEstudio/gpt4free
new gpt-4 beating opensource models
2fad27b2
代码差异
4 个文件
+27
-18
@@ -281,13 +281,14 @@ set G4F_PROXY=http://host:port
281
281
| [beta.theb.ai](https://beta.theb.ai) | `g4f.Provider.Theb` | ✔️ | ✔️ | ✔️ |  | ❌ |
282
282
| [you.com](https://you.com) | `g4f.Provider.You` | ✔️ | ✔️ | ✔️ |  | ❌ |
283
283
284
## New OpenSource Models
285
While we wait for gpt-5, here is a list of new models that are at least better than gpt-3.5-turbo. Some rival gpt-4. Expect this list to grow.
286
287
| Website | Provider | parameters |
288
| ------ | ------- | ------ |
289
| [mixtral-8x22b](https://huggingface.co/mistral-community/Mixtral-8x22B-v0.1) | `g4f.Provider.DeepInfra` | 176B / 44b active |
290
| [dbrx-instruct](https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm) | `g4f.Provider.DeepInfra` | 132B / 36B active|
284
## Best OpenSource Models
285
While we wait for gpt-5, here is a list of new models that are at least better than gpt-3.5-turbo. **Some are better than gpt-4**. Expect this list to grow.
286
287
| Website | Provider | parameters | better than |
288
| ------ | ------- | ------ | ------ |
289
| [mixtral-8x22b](https://huggingface.co/mistral-community/Mixtral-8x22B-v0.1) | `g4f.Provider.DeepInfra` | 176B / 44b active | gpt-3.5-turbo |
290
| [dbrx-instruct](https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm) | `g4f.Provider.DeepInfra` | 132B / 36B active| gpt-3.5-turbo |
291
| [command-r+](https://txt.cohere.com/command-r-plus-microsoft-azure/) | `g4f.Provider.HuggingChat` | 104B | gpt-4-0613 |
291
292
292
293
293
294
### GPT-3.5
@@ -14,13 +14,12 @@ class HuggingChat(AsyncGeneratorProvider, ProviderModelMixin):
14
14
working = True
15
15
default_model = "mistralai/Mixtral-8x7B-Instruct-v0.1"
16
16
models = [
17
"mistralai/Mixtral-8x7B-Instruct-v0.1",
18
"google/gemma-7b-it",
19
"meta-llama/Llama-2-70b-chat-hf",
20
"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
21
"codellama/CodeLlama-34b-Instruct-hf",
22
"mistralai/Mistral-7B-Instruct-v0.2",
23
"openchat/openchat-3.5-0106",
17
"HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1",
18
'CohereForAI/c4ai-command-r-plus',
19
'mistralai/Mixtral-8x7B-Instruct-v0.1',
20
'google/gemma-1.1-7b-it',
21
'NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO',
22
'mistralai/Mistral-7B-Instruct-v0.2'
24
23
]
25
24
model_aliases = {
26
25
"openchat/openchat_3.5": "openchat/openchat-3.5-0106",
@@ -48,6 +47,7 @@ class HuggingChat(AsyncGeneratorProvider, ProviderModelMixin):
48
47
**kwargs
49
48
) -> AsyncResult:
50
49
options = {"model": cls.get_model(model)}
50
51
51
system_prompt = "\n".join([message["content"] for message in messages if message["role"] == "system"])
52
52
if system_prompt:
53
53
options["preprompt"] = system_prompt
@@ -19,13 +19,14 @@ class PerplexityLabs(AsyncGeneratorProvider, ProviderModelMixin):
19
19
"sonar-small-online", "sonar-medium-online", "sonar-small-chat", "sonar-medium-chat", "mistral-7b-instruct",
20
20
"codellama-70b-instruct", "llava-v1.5-7b-wrapper", "llava-v1.6-34b", "mixtral-8x7b-instruct",
21
21
"gemma-2b-it", "gemma-7b-it"
22
"mistral-medium", "related"
22
"mistral-medium", "related", "dbrx-instruct"
23
23
]
24
24
model_aliases = {
25
25
"mistralai/Mistral-7B-Instruct-v0.1": "mistral-7b-instruct",
26
26
"mistralai/Mixtral-8x7B-Instruct-v0.1": "mixtral-8x7b-instruct",
27
27
"codellama/CodeLlama-70b-Instruct-hf": "codellama-70b-instruct",
28
"llava-v1.5-7b": "llava-v1.5-7b-wrapper"
28
"llava-v1.5-7b": "llava-v1.5-7b-wrapper",
29
'databricks/dbrx-instruct': "dbrx-instruct"
29
30
}
30
31
31
32
@classmethod
@@ -165,7 +165,7 @@ mistral_7b_v02 = Model(
165
165
mixtral_8x22b = Model(
166
166
name = "HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1",
167
167
base_provider = "huggingface",
168
best_provider = DeepInfra
168
best_provider = RetryProvider([HuggingChat, DeepInfra])
169
169
)
170
170
171
171
# Misc models
@@ -269,7 +269,13 @@ pi = Model(
269
269
dbrx_instruct = Model(
270
270
name = 'databricks/dbrx-instruct',
271
271
base_provider = 'mistral',
272
best_provider = DeepInfra
272
best_provider = RetryProvider([DeepInfra, PerplexityLabs])
273
)
274
275
command_r_plus = Model(
276
name = 'CohereForAI/c4ai-command-r-plus',
277
base_provider = 'mistral',
278
best_provider = HuggingChat
273
279
)
274
280
275
281
class ModelUtils:
@@ -324,6 +330,7 @@ class ModelUtils:
324
330
'claude-3-sonnet': claude_3_sonnet,
325
331
326
332
# other
333
'command-r+': command_r_plus,
327
334
'dbrx-instruct': dbrx_instruct,
328
335
'lzlv-70b': lzlv_70b,
329
336
'airoboros-70b': airoboros_70b,