Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pygpt_net/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def run(**kwargs):
from pygpt_net.provider.llms.perplexity import PerplexityLLM
from pygpt_net.provider.llms.x_ai import xAILLM
from pygpt_net.provider.llms.open_router import OpenRouterLLM
from pygpt_net.provider.llms.minimax import MiniMaxLLM

# vector store providers (llama-index)
from pygpt_net.provider.vector_stores.chroma import ChromaProvider
Expand Down Expand Up @@ -487,6 +488,7 @@ def run(**kwargs):
launcher.add_llm(PerplexityLLM())
launcher.add_llm(xAILLM())
launcher.add_llm(OpenRouterLLM())
launcher.add_llm(MiniMaxLLM())

# register LLMs
llms = kwargs.get('llms', None)
Expand Down
1 change: 1 addition & 0 deletions src/pygpt_net/controller/chat/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ def check_api_key(
"perplexity": config.get('api_key_perplexity', None),
"deepseek_api": config.get('api_key_deepseek', None),
"mistral_ai": config.get('api_key_mistral', None),
"minimax": config.get('api_key_minimax', None),
}

if model.provider in provider_keys:
Expand Down
14 changes: 14 additions & 0 deletions src/pygpt_net/controller/model/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,20 @@ def get_provider_available(self) -> Dict:
'type': 'str'
}
]
elif self.provider == "minimax":
m.tool_calls = True
m.llama_index['env'] = [
{
'name': 'OPENAI_API_KEY',
'value': '{api_key_minimax}',
'type': 'str'
},
{
'name': 'OPENAI_API_BASE',
'value': '{api_endpoint_minimax}',
'type': 'str'
}
]
models[key] = m
provider_name = self.window.core.llm.get_provider_name(self.provider)
self.set_status(trans('models.importer.loaded').replace("{provider}", provider_name))
Expand Down
4 changes: 4 additions & 0 deletions src/pygpt_net/core/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ def prepare_client_args(
args["api_key"] = cfg.get('api_key_open_router', "")
args["base_url"] = cfg.get('api_endpoint_open_router', "")
self.window.core.debug.info("[api] Using client: OpenRouter API")
elif model.provider == "minimax":
args["api_key"] = cfg.get('api_key_minimax', "")
args["base_url"] = cfg.get('api_endpoint_minimax', "")
self.window.core.debug.info("[api] Using client: MiniMax API")
elif model.provider == "ollama":
args["api_key"] = "ollama"
args["base_url"] = self.window.core.models.ollama.get_base_url() + "/v1"
Expand Down
1 change: 1 addition & 0 deletions src/pygpt_net/core/types/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"deepseek_api",
"x_ai",
"open_router",
"minimax",
]

OPENAI_DISABLE_TOOLS = [
Expand Down
2 changes: 2 additions & 0 deletions src/pygpt_net/data/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"api_endpoint_deepseek": "https://api.deepseek.com/v1",
"api_endpoint_google": "https://generativelanguage.googleapis.com/v1beta/openai",
"api_endpoint_hugging_face": "https://router.huggingface.co/v1",
"api_endpoint_minimax": "https://api.minimax.io/v1",
"api_endpoint_mistral": "https://api.mistral.ai/v1",
"api_endpoint_open_router": "https://openrouter.ai/api/v1",
"api_endpoint_perplexity": "https://api.perplexity.ai",
Expand All @@ -83,6 +84,7 @@
"api_key_deepseek": "",
"api_key_google": "",
"api_key_hugging_face": "",
"api_key_minimax": "",
"api_key_mistral": "",
"api_key_open_router": "",
"api_key_perplexity": "",
Expand Down
95 changes: 95 additions & 0 deletions src/pygpt_net/data/config/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,101 @@
"updated_at": "2026-02-06T00:00:00"
},
"items": {
"MiniMax-M3": {
"id": "MiniMax-M3",
"name": "MiniMax-M3",
"mode": [
"chat",
"vision",
"llama_index",
"agent",
"agent_llama",
"agent_openai",
"expert"
],
"llama_index": {
"args": [
{
"name": "model",
"value": "MiniMax-M3",
"type": "str"
}
],
"env": [
{
"name": "OPENAI_API_KEY",
"value": "{api_key_minimax}",
"type": "str"
},
{
"name": "OPENAI_API_BASE",
"value": "{api_endpoint_minimax}",
"type": "str"
}
]
},
"ctx": 1000000,
"tokens": 0,
"default": false,
"input": [
"text",
"image",
"video"
],
"output": [
"text"
],
"extra": {},
"imported": false,
"provider": "minimax",
"tool_calls": true
},
"MiniMax-M2.7": {
"id": "MiniMax-M2.7",
"name": "MiniMax-M2.7",
"mode": [
"chat",
"llama_index",
"agent",
"agent_llama",
"agent_openai",
"expert"
],
"llama_index": {
"args": [
{
"name": "model",
"value": "MiniMax-M2.7",
"type": "str"
}
],
"env": [
{
"name": "OPENAI_API_KEY",
"value": "{api_key_minimax}",
"type": "str"
},
{
"name": "OPENAI_API_BASE",
"value": "{api_endpoint_minimax}",
"type": "str"
}
]
},
"ctx": 204800,
"tokens": 0,
"default": false,
"input": [
"text"
],
"output": [
"text"
],
"extra": {},
"imported": false,
"provider": "minimax",
"tool_calls": true
},
"SpeakLeash/bielik-11b-v2.3-instruct:Q4_K_M": {
"id": "SpeakLeash/bielik-11b-v2.3-instruct:Q4_K_M",
"name": "bielik-11b-v2.3",
Expand Down
37 changes: 37 additions & 0 deletions src/pygpt_net/data/config/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,43 @@
"advanced": false,
"tab": "DeepSeek"
},
"api_key_minimax": {
"section": "api_keys",
"type": "text",
"slider": false,
"label": "settings.api_key.minimax",
"description": "settings.api_key.minimax.desc",
"value": "",
"min": null,
"max": null,
"multiplier": null,
"step": null,
"extra": {
"bold": true
},
"urls": {
"API Keys": "https://platform.minimax.io"
},
"secret": true,
"persist": true,
"advanced": false,
"tab": "MiniMax"
},
"api_endpoint_minimax": {
"section": "api_keys",
"type": "text",
"slider": false,
"label": "settings.api_endpoint_minimax",
"description": "settings.api_endpoint_minimax.desc",
"value": "https://api.minimax.io/v1",
"min": null,
"max": null,
"multiplier": null,
"step": null,
"secret": false,
"advanced": false,
"tab": "MiniMax"
},
"api_key_xai": {
"section": "api_keys",
"type": "text",
Expand Down
5 changes: 5 additions & 0 deletions src/pygpt_net/data/locale/locale.en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,8 @@ settings.api_endpoint_google = API Endpoint
settings.api_endpoint_google.desc = Google API endpoint URL, default: https://generativelanguage.googleapis.com/v1beta/openai
settings.api_endpoint_hugging_face = Router API Endpoint
settings.api_endpoint_hugging_face.desc = API Endpoint for HuggingFace Router provider (OpenAI compatible ChatCompletions)
settings.api_endpoint_minimax = API Endpoint
settings.api_endpoint_minimax.desc = MiniMax API endpoint URL, default: https://api.minimax.io/v1
settings.api_endpoint_mistral = API Endpoint
settings.api_endpoint_mistral.desc = Mistral AI API endpoint URL, default: https://api.mistral.ai/v1
settings.api_endpoint_open_router = API Endpoint
Expand All @@ -1252,6 +1254,8 @@ settings.api_key.google = Google API key
settings.api_key.google.desc = Required for the Google API and Gemini models.
settings.api_key.hugging_face = HuggingFace API key
settings.api_key.hugging_face.desc = Required for the HuggingFace API.
settings.api_key.minimax = MiniMax API key
settings.api_key.minimax.desc = Required for the MiniMax API.
settings.api_key_management.xai = Management API key
settings.api_key_management.xai.desc = xAI Management API key. Required for Collections management via Remote vector stores tool.
settings.api_key.mistral = Mistral AI API key
Expand Down Expand Up @@ -1587,6 +1591,7 @@ settings.section.api_keys.azure_openai = Azure OpenAI
settings.section.api_keys.deepseek = DeepSeek
settings.section.api_keys.google = Google
settings.section.api_keys.huggingface = HuggingFace
settings.section.api_keys.minimax = MiniMax
settings.section.api_keys.mistral_ai = Mistral AI
settings.section.api_keys.openai = OpenAI
settings.section.api_keys.openrouter = OpenRouter
Expand Down
111 changes: 111 additions & 0 deletions src/pygpt_net/provider/llms/minimax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ================================================== #
# This file is a part of PYGPT package #
# Website: https://pygpt.net #
# GitHub: https://github.com/szczyglis-dev/py-gpt #
# MIT License #
# Created By : Marcin Szczygliński #
# Updated Date: 2026.07.29 00:00:00 #
# ================================================== #

from typing import List, Dict

from llama_index.core.llms.llm import BaseLLM as LlamaBaseLLM

from pygpt_net.core.types import (
MODE_CHAT,
MODE_LLAMA_INDEX,
)
from pygpt_net.provider.llms.base import BaseLLM
from pygpt_net.item.model import ModelItem


class MiniMaxLLM(BaseLLM):
def __init__(self, *args, **kwargs):
super(MiniMaxLLM, self).__init__(*args, **kwargs)
self.id = "minimax"
self.name = "MiniMax"
self.type = [MODE_CHAT, MODE_LLAMA_INDEX]

def completion(
self,
window,
model: ModelItem,
stream: bool = False
):
"""
Return LLM provider instance for completion

:param window: window instance
:param model: model instance
:param stream: stream mode
:return: LLM provider instance
"""
pass

def chat(
self,
window,
model: ModelItem,
stream: bool = False
):
"""
Return LLM provider instance for chat

:param window: window instance
:param model: model instance
:param stream: stream mode
:return: LLM provider instance
"""
pass

def llama(
self,
window,
model: ModelItem,
stream: bool = False
) -> LlamaBaseLLM:
"""
Return LLM provider instance for llama

:param window: window instance
:param model: model instance
:param stream: stream mode
:return: LLM provider instance
"""
from llama_index.llms.openai_like import OpenAILike
args = self.parse_args(model.llama_index, window)
if "model" not in args:
args["model"] = model.id
if "api_key" not in args or args["api_key"] == "":
args["api_key"] = window.core.config.get("api_key_minimax", "")
if "api_base" not in args or args["api_base"] == "":
args["api_base"] = window.core.config.get("api_endpoint_minimax", "https://api.minimax.io/v1")
if "is_chat_model" not in args:
args["is_chat_model"] = True
if "is_function_calling_model" not in args:
args["is_function_calling_model"] = model.tool_calls
args = self.inject_llamaindex_http_clients(args, window.core.config)
return OpenAILike(**args)

def get_models(
self,
window,
) -> List[Dict]:
"""
Return list of models for the provider

:param window: window instance
:return: list of models
"""
items = []
client = self.get_client(window)
models_list = client.models.list()
if models_list.data:
for item in models_list.data:
items.append({
"id": item.id,
"name": item.id,
})
return items