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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ AnythingLLM supports multiple users as well where you can control the access and
- [PrivateModeAI (chat models)](https://privatemode.ai/)
- [SambaNova Cloud (chat models)](https://cloud.sambanova.ai/)
- [Lemonade by AMD](https://lemonade-server.ai)
- [Minimax](https://platform.minimax.io)

**Embedder models:**

Expand Down
5 changes: 5 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ GID='1000'
# SAMBANOVA_LLM_API_KEY='xxx-xxx-xxx'
# SAMBANOVA_LLM_MODEL_PREF='gpt-oss-120b'

# LLM_PROVIDER='minimax'
# MINIMAX_API_KEY='sk-cp-...'
# MINIMAX_MODEL_PREF='MiniMax-M2.7'
# MINIMAX_MAX_TOKENS=

###########################################
######## Embedding API SElECTION ##########
###########################################
Expand Down
111 changes: 111 additions & 0 deletions frontend/src/components/LLMSelection/MinimaxOptions/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { useState, useEffect } from "react";
import System from "@/models/system";

export default function MinimaxOptions({ settings }) {
const [inputValue, setInputValue] = useState(settings?.MinimaxApiKey);
const [apiKey, setApiKey] = useState(settings?.MinimaxApiKey);

return (
<div className="flex gap-[36px] mt-1.5">
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
API Key
</label>
<input
type="password"
name="MinimaxApiKey"
className="border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
placeholder="Minimax API Key"
defaultValue={settings?.MinimaxApiKey ? "*".repeat(20) : ""}
required={true}
autoComplete="off"
spellCheck={false}
onChange={(e) => setInputValue(e.target.value)}
onBlur={() => setApiKey(inputValue)}
/>
</div>

<MinimaxModelSelection settings={settings} apiKey={apiKey} />
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
Max Tokens{" "}
<span className="text-white/60 font-normal">(Optional)</span>
</label>
<input
type="number"
name="MinimaxMaxTokens"
className="border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
min={1}
defaultValue={settings?.MinimaxMaxTokens || ""}
autoComplete="off"
/>
</div>
</div>
);
}

function MinimaxModelSelection({ apiKey, settings }) {
const [models, setModels] = useState([]);
const [loading, setLoading] = useState(true);

useEffect(() => {
async function findCustomModels() {
if (!apiKey) {
setModels([]);
setLoading(true);
return;
}

setLoading(true);
const { models } = await System.customModels(
"minimax",
typeof apiKey === "boolean" ? null : apiKey
);
setModels(models || []);
setLoading(false);
}
findCustomModels();
}, [apiKey]);

if (loading) {
return (
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
Chat Model Selection
</label>
<select
name="MinimaxModelPref"
disabled={true}
className="border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
>
<option disabled={true} selected={true}>
-- loading available models --
</option>
</select>
</div>
);
}

return (
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
Chat Model Selection
</label>
<select
name="MinimaxModelPref"
required={true}
className="border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
>
{models.map((model) => (
<option
key={model.id}
value={model.id}
selected={settings?.MinimaxModelPref === model.id}
>
{model.name || model.id}
</option>
))}
</select>
</div>
);
}
6 changes: 6 additions & 0 deletions frontend/src/components/ProviderPrivacy/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import DockerModelRunnerLogo from "@/media/llmprovider/docker-model-runner.png";
import PrivateModeLogo from "@/media/llmprovider/privatemode.png";
import SambaNovaLogo from "@/media/llmprovider/sambanova.png";
import LemonadeLogo from "@/media/llmprovider/lemonade.png";
import MinimaxLogo from "@/media/llmprovider/minimax.png";

const LLM_PROVIDER_PRIVACY_MAP = {
openai: {
Expand Down Expand Up @@ -252,6 +253,11 @@ const LLM_PROVIDER_PRIVACY_MAP = {
],
logo: LemonadeLogo,
},
minimax: {
name: "Minimax",
policyUrl: "https://platform.minimax.io/protocol/privacy-policy",
logo: MinimaxLogo,
},
};

const VECTOR_DB_PROVIDER_PRIVACY_MAP = {
Expand Down
Binary file added frontend/src/media/llmprovider/minimax.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions frontend/src/pages/GeneralSettings/LLMPreference/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import DockerModelRunnerLogo from "@/media/llmprovider/docker-model-runner.png";
import PrivateModeLogo from "@/media/llmprovider/privatemode.png";
import SambaNovaLogo from "@/media/llmprovider/sambanova.png";
import LemonadeLogo from "@/media/llmprovider/lemonade.png";
import MinimaxLogo from "@/media/llmprovider/minimax.png";

import PreLoader from "@/components/Preloader";
import OpenAiOptions from "@/components/LLMSelection/OpenAiOptions";
Expand Down Expand Up @@ -79,6 +80,7 @@ import DockerModelRunnerOptions from "@/components/LLMSelection/DockerModelRunne
import PrivateModeOptions from "@/components/LLMSelection/PrivateModeOptions";
import SambaNovaOptions from "@/components/LLMSelection/SambaNovaOptions";
import LemonadeOptions from "@/components/LLMSelection/LemonadeOptions";
import MinimaxOptions from "@/components/LLMSelection/MinimaxOptions";

import LLMItem from "@/components/LLMSelection/LLMItem";
import { CaretUpDown, MagnifyingGlass, X } from "@phosphor-icons/react";
Expand Down Expand Up @@ -401,6 +403,14 @@ export const AVAILABLE_LLM_PROVIDERS = [
description: "Run GiteeAI's powerful LLMs.",
requiredConfig: ["GiteeAIApiKey"],
},
{
name: "Minimax",
value: "minimax",
logo: MinimaxLogo,
options: (settings) => <MinimaxOptions settings={settings} />,
description: "Run Minimax's powerful M2 LLMs.",
requiredConfig: ["MinimaxApiKey"],
},
{
name: "Generic OpenAI",
value: "generic-openai",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import DockerModelRunnerLogo from "@/media/llmprovider/docker-model-runner.png";
import PrivateModeLogo from "@/media/llmprovider/privatemode.png";
import SambaNovaLogo from "@/media/llmprovider/sambanova.png";
import LemonadeLogo from "@/media/llmprovider/lemonade.png";
import MinimaxLogo from "@/media/llmprovider/minimax.png";

import OpenAiOptions from "@/components/LLMSelection/OpenAiOptions";
import GenericOpenAiOptions from "@/components/LLMSelection/GenericOpenAiOptions";
Expand Down Expand Up @@ -71,6 +72,7 @@ import DockerModelRunnerOptions from "@/components/LLMSelection/DockerModelRunne
import PrivateModeOptions from "@/components/LLMSelection/PrivateModeOptions";
import SambaNovaOptions from "@/components/LLMSelection/SambaNovaOptions";
import LemonadeOptions from "@/components/LLMSelection/LemonadeOptions";
import MinimaxOptions from "@/components/LLMSelection/MinimaxOptions";

import LLMItem from "@/components/LLMSelection/LLMItem";
import System from "@/models/system";
Expand Down Expand Up @@ -336,6 +338,13 @@ const LLMS = [
options: (settings) => <GiteeAiOptions settings={settings} />,
description: "Run GiteeAI's powerful LLMs.",
},
{
name: "Minimax",
value: "minimax",
logo: MinimaxLogo,
options: (settings) => <MinimaxOptions settings={settings} />,
description: "Run Minimax's powerful M2 LLMs.",
},
];

export default function LLMPreference({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const ENABLED_PROVIDERS = [
"privatemode",
"sambanova",
"lemonade",
"minimax",
// TODO: More agent support.
// "huggingface" // Can be done but already has issues with no-chat templated. Needs to be tested.
];
Expand Down
1 change: 1 addition & 0 deletions locales/README.fa-IR.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ AnythingLLM همچنین از چندین کاربر پشتیبانی می‌کن
- [PrivateModeAI (chat models)](https://privatemode.ai/)
- [SambaNova Cloud (chat models)](https://cloud.sambanova.ai/)
- [Lemonade by AMD](https://lemonade-server.ai)
- [Minimax](https://platform.minimax.io)

<div dir="rtl">

Expand Down
1 change: 1 addition & 0 deletions locales/README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ AnythingLLMは複数ユーザーもサポートしており、インスタンス
- [PrivateModeAI (chat models)](https://privatemode.ai/)
- [SambaNova Cloud (chat models)](https://cloud.sambanova.ai/)
- [Lemonade by AMD](https://lemonade-server.ai)
- [Minimax](https://platform.minimax.io)

**埋め込みモデル:**

Expand Down
1 change: 1 addition & 0 deletions locales/README.tr-TR.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ AnythingLLM ayrıca birden fazla kullanıcıyı da destekler; burada örneğin g
- [PrivateModeAI (chat models)](https://privatemode.ai/)
- [SambaNova Cloud (chat models)](https://cloud.sambanova.ai/)
- [Lemonade by AMD](https://lemonade-server.ai)
- [Minimax](https://platform.minimax.io)

**Embedder modelleri:**

Expand Down
1 change: 1 addition & 0 deletions locales/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ AnythingLLM还支持多用户,您可以控制每个用户的访问权限和体
- [PrivateModeAI (chat models)](https://privatemode.ai/)
- [SambaNova Cloud (chat models)](https://cloud.sambanova.ai/)
- [Lemonade by AMD](https://lemonade-server.ai)
- [Minimax](https://platform.minimax.io)

**支持的嵌入模型:**

Expand Down
5 changes: 5 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ SIG_SALT='salt' # Please generate random string at least 32 chars long.
# LEMONADE_LLM_MODEL_TOKEN_LIMIT=8192
# LEMONADE_LLM_API_KEY=

# LLM_PROVIDER='minimax'
# MINIMAX_API_KEY='sk-cp-...'
# MINIMAX_MODEL_PREF='MiniMax-M2.7'
# MINIMAX_MAX_TOKENS=

###########################################
######## Embedding API SElECTION ##########
###########################################
Expand Down
3 changes: 3 additions & 0 deletions server/endpoints/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ function getModelTag() {
case "lemonade":
model = process.env.LEMONADE_LLM_MODEL_PREF;
break;
case "minimax":
model = process.env.MINIMAX_MODEL_PREF;
break;
default:
model = "--";
break;
Expand Down
5 changes: 5 additions & 0 deletions server/models/systemSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,11 @@ const SystemSettings = {
LemonadeLLMModelPref: process.env.LEMONADE_LLM_MODEL_PREF,
LemonadeLLMModelTokenLimit:
process.env.LEMONADE_LLM_MODEL_TOKEN_LIMIT || 8192,

// Minimax Keys
MinimaxApiKey: !!process.env.MINIMAX_API_KEY,
MinimaxModelPref: process.env.MINIMAX_MODEL_PREF,
MinimaxMaxTokens: process.env.MINIMAX_MAX_TOKENS,
};
},

Expand Down
Loading