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

XFEstudio/gpt4free

Add model alias for Kimi-K2-Instruct and update best_provider references

bb02eeb4
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

4 个文件 +8 -2
Modified g4f/Provider/DeepInfra.py +2 -0
@@ -77,6 +77,8 @@ class DeepInfra(OpenaiTemplate):
77 77 "qwen-3-32b": "Qwen/Qwen3-32B",
78 78 "qwen-3-235b": "Qwen/Qwen3-235B-A22B",
79 79 "qwq-32b": "Qwen/QwQ-32B",
80
81 "moonshotai/Kimi-K2-Instruct": "moonshotai/Kimi-K2-Instruct-0905",
80 82 }
81 83
82 84 @classmethod
Modified g4f/Provider/PollinationsAI.py +3 -0
@@ -88,6 +88,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
88 88 vision_models = [default_vision_model]
89 89 _models_loaded = False
90 90 model_aliases = {
91 "openai-fast": "gpt-4.1-nano",
91 92 "llama-4-scout": "llamascout",
92 93 "deepseek-r1": "deepseek-reasoning",
93 94 "sdxl-turbo": "turbo",
@@ -105,6 +106,8 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
105 106 alias = model.get("name")
106 107 if (model.get("aliases")):
107 108 alias = model.get("aliases")[0]
109 elif alias in cls.model_aliases:
110 alias = cls.model_aliases[alias]
108 111 return alias.replace("-instruct", "").replace("qwen-", "qwen").replace("qwen", "qwen-")
109 112 if not cls._models_loaded:
110 113 try:
Modified g4f/Provider/needs_auth/hf/models.py +1 -0
@@ -32,6 +32,7 @@ model_aliases = {
32 32 "llama-3.2-11b": "meta-llama/Llama-3.2-11B-Vision-Instruct",
33 33 "mistral-nemo": "mistralai/Mistral-Nemo-Instruct-2407",
34 34 "phi-3.5-mini": "microsoft/Phi-3.5-mini-instruct",
35 "moonshotai/Kimi-K2-Instruct": "moonshotai/Kimi-K2-Instruct-0905",
35 36 ### Used in other providers ###
36 37 "qwen-2-vl-7b": "Qwen/Qwen2-VL-7B-Instruct",
37 38 "gemma-2-27b": "google/gemma-2-27b-it",
Modified g4f/models.py +2 -2
@@ -271,7 +271,7 @@ o4_mini_high = Model(
271 271 gpt_4_1 = Model(
272 272 name = 'gpt-4.1',
273 273 base_provider = 'OpenAI',
274 best_provider = IterListProvider([PollinationsAI, OpenaiChat])
274 best_provider = IterListProvider([OpenaiChat])
275 275 )
276 276
277 277 gpt_4_1_mini = Model(
@@ -283,7 +283,7 @@ gpt_4_1_mini = Model(
283 283 gpt_4_1_nano = Model(
284 284 name = 'gpt-4.1-nano',
285 285 base_provider = 'OpenAI',
286 best_provider = IterListProvider([Blackbox])
286 best_provider = IterListProvider([Blackbox, PollinationsAI])
287 287 )
288 288
289 289 gpt_4_5 = Model(