Skip to content
Closed
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
23 changes: 11 additions & 12 deletions extensions/minimax/model-definitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,36 @@ import {
} from "./model-definitions.js";

describe("minimax model definitions", () => {
it("uses M2.7 as default hosted model", () => {
expect(MINIMAX_HOSTED_MODEL_ID).toBe("MiniMax-M2.7");
it("uses M3 as default hosted model", () => {
expect(MINIMAX_HOSTED_MODEL_ID).toBe("MiniMax-M3");
});

it("uses the higher upstream MiniMax context and token defaults", () => {
expect(DEFAULT_MINIMAX_CONTEXT_WINDOW).toBe(204800);
it("uses the upstream MiniMax M3 context and cost defaults", () => {
expect(DEFAULT_MINIMAX_CONTEXT_WINDOW).toBe(1000000);
expect(DEFAULT_MINIMAX_MAX_TOKENS).toBe(131072);
expect(MINIMAX_API_COST).toEqual({
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,
});
});

it("builds catalog model with name and reasoning from catalog", () => {
const model = buildMinimaxModelDefinition({
id: "MiniMax-M2.7",
id: "MiniMax-M3",
cost: MINIMAX_API_COST,
contextWindow: DEFAULT_MINIMAX_CONTEXT_WINDOW,
maxTokens: DEFAULT_MINIMAX_MAX_TOKENS,
});
expect(model).toMatchObject({
id: "MiniMax-M2.7",
name: "MiniMax M2.7",
id: "MiniMax-M3",
name: "MiniMax M3",
reasoning: true,
});
});

it("builds API model definition with standard cost", () => {
const model = buildMinimaxApiModelDefinition("MiniMax-M2.7");
const model = buildMinimaxApiModelDefinition("MiniMax-M3");
expect(model.cost).toEqual(MINIMAX_API_COST);
expect(model.contextWindow).toBe(DEFAULT_MINIMAX_CONTEXT_WINDOW);
expect(model.maxTokens).toBe(DEFAULT_MINIMAX_MAX_TOKENS);
Expand Down
9 changes: 4 additions & 5 deletions extensions/minimax/model-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic";
export const MINIMAX_CN_API_BASE_URL = "https://api.minimaxi.com/anthropic";
export const MINIMAX_HOSTED_MODEL_ID = MINIMAX_DEFAULT_MODEL_ID;
export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`;
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800;
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 1000000;
export const DEFAULT_MINIMAX_MAX_TOKENS = 131072;

export const MINIMAX_API_COST = {
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,
};
export const MINIMAX_HOSTED_COST = {
input: 0,
Expand Down
12 changes: 6 additions & 6 deletions extensions/minimax/onboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe("minimax onboard", () => {
});
});

it("keeps reasoning enabled for MiniMax-M2.7", () => {
const cfg = applyMinimaxApiConfig({}, "MiniMax-M2.7");
it("keeps reasoning enabled for MiniMax-M3", () => {
const cfg = applyMinimaxApiConfig({}, "MiniMax-M3");
expect(cfg.models?.providers?.minimax?.models[0]?.reasoning).toBe(true);
});

Expand All @@ -31,17 +31,17 @@ describe("minimax onboard", () => {
agents: {
defaults: {
models: {
"minimax/MiniMax-M2.7": {
"minimax/MiniMax-M3": {
alias: "MiniMax",
params: { custom: "value" },
},
},
},
},
},
"MiniMax-M2.7",
"MiniMax-M3",
);
expect(cfg.agents?.defaults?.models?.["minimax/MiniMax-M2.7"]).toMatchObject({
expect(cfg.agents?.defaults?.models?.["minimax/MiniMax-M3"]).toMatchObject({
alias: "Minimax",
params: { custom: "value" },
});
Expand All @@ -60,7 +60,7 @@ describe("minimax onboard", () => {
expect(cfg.models?.providers?.minimax?.apiKey).toBe("old-key");
expect(cfg.models?.providers?.minimax?.models.map((m) => m.id)).toEqual([
"old-model",
"MiniMax-M2.7",
"MiniMax-M3",
]);
});

Expand Down
8 changes: 4 additions & 4 deletions extensions/minimax/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function applyMinimaxApiConfigWithBaseUrl(

export function applyMinimaxApiProviderConfig(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand All @@ -72,7 +72,7 @@ export function applyMinimaxApiProviderConfig(

export function applyMinimaxApiConfig(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand All @@ -83,7 +83,7 @@ export function applyMinimaxApiConfig(

export function applyMinimaxApiProviderConfigCn(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand All @@ -94,7 +94,7 @@ export function applyMinimaxApiProviderConfigCn(

export function applyMinimaxApiConfigCn(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand Down
9 changes: 4 additions & 5 deletions extensions/minimax/provider-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import {
} from "./provider-models.js";

const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic";
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 204800;
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 1000000;
const MINIMAX_DEFAULT_MAX_TOKENS = 131072;
const MINIMAX_API_COST = {
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,
};

function buildMinimaxModel(params: {
Expand Down
11 changes: 8 additions & 3 deletions extensions/minimax/provider-models.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { matchesExactOrPrefix } from "openclaw/plugin-sdk/provider-model-shared";

export const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M2.7";
export const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M3";
export const MINIMAX_DEFAULT_MODEL_REF = `minimax/${MINIMAX_DEFAULT_MODEL_ID}`;

export const MINIMAX_TEXT_MODEL_ORDER = ["MiniMax-M2.7", "MiniMax-M2.7-highspeed"] as const;
export const MINIMAX_TEXT_MODEL_ORDER = [
"MiniMax-M3",
"MiniMax-M2.7",
"MiniMax-M2.7-highspeed",
] as const;

export const MINIMAX_TEXT_MODEL_CATALOG = {
"MiniMax-M3": { name: "MiniMax M3", reasoning: true },
"MiniMax-M2.7": { name: "MiniMax M2.7", reasoning: true },
"MiniMax-M2.7-highspeed": { name: "MiniMax M2.7 Highspeed", reasoning: true },
} as const;
Expand All @@ -14,7 +19,7 @@ export const MINIMAX_TEXT_MODEL_REFS = MINIMAX_TEXT_MODEL_ORDER.map(
(modelId) => `minimax/${modelId}`,
);

const MINIMAX_MODERN_MODEL_MATCHERS = ["minimax-m2.7"] as const;
const MINIMAX_MODERN_MODEL_MATCHERS = ["minimax-m3", "minimax-m2.7"] as const;

export function isMiniMaxModernModelId(modelId: string): boolean {
return matchesExactOrPrefix(modelId, MINIMAX_MODERN_MODEL_MATCHERS);
Expand Down
23 changes: 11 additions & 12 deletions minimax/model-definitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,36 @@ import {
} from "./model-definitions.js";

describe("minimax model definitions", () => {
it("uses M2.7 as default hosted model", () => {
expect(MINIMAX_HOSTED_MODEL_ID).toBe("MiniMax-M2.7");
it("uses M3 as default hosted model", () => {
expect(MINIMAX_HOSTED_MODEL_ID).toBe("MiniMax-M3");
});

it("uses the higher upstream MiniMax context and token defaults", () => {
expect(DEFAULT_MINIMAX_CONTEXT_WINDOW).toBe(204800);
it("uses the upstream MiniMax M3 context and cost defaults", () => {
expect(DEFAULT_MINIMAX_CONTEXT_WINDOW).toBe(1000000);
expect(DEFAULT_MINIMAX_MAX_TOKENS).toBe(131072);
expect(MINIMAX_API_COST).toEqual({
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,
});
});

it("builds catalog model with name and reasoning from catalog", () => {
const model = buildMinimaxModelDefinition({
id: "MiniMax-M2.7",
id: "MiniMax-M3",
cost: MINIMAX_API_COST,
contextWindow: DEFAULT_MINIMAX_CONTEXT_WINDOW,
maxTokens: DEFAULT_MINIMAX_MAX_TOKENS,
});
expect(model).toMatchObject({
id: "MiniMax-M2.7",
name: "MiniMax M2.7",
id: "MiniMax-M3",
name: "MiniMax M3",
reasoning: true,
});
});

it("builds API model definition with standard cost", () => {
const model = buildMinimaxApiModelDefinition("MiniMax-M2.7");
const model = buildMinimaxApiModelDefinition("MiniMax-M3");
expect(model.cost).toEqual(MINIMAX_API_COST);
expect(model.contextWindow).toBe(DEFAULT_MINIMAX_CONTEXT_WINDOW);
expect(model.maxTokens).toBe(DEFAULT_MINIMAX_MAX_TOKENS);
Expand Down
9 changes: 4 additions & 5 deletions minimax/model-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ export const MINIMAX_API_BASE_URL = "https://api.minimax.io/anthropic";
export const MINIMAX_CN_API_BASE_URL = "https://api.minimaxi.com/anthropic";
export const MINIMAX_HOSTED_MODEL_ID = MINIMAX_DEFAULT_MODEL_ID;
export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`;
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 204800;
export const DEFAULT_MINIMAX_CONTEXT_WINDOW = 1000000;
export const DEFAULT_MINIMAX_MAX_TOKENS = 131072;

export const MINIMAX_API_COST = {
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,
};
export const MINIMAX_HOSTED_COST = {
input: 0,
Expand Down
12 changes: 6 additions & 6 deletions minimax/onboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe("minimax onboard", () => {
});
});

it("keeps reasoning enabled for MiniMax-M2.7", () => {
const cfg = applyMinimaxApiConfig({}, "MiniMax-M2.7");
it("keeps reasoning enabled for MiniMax-M3", () => {
const cfg = applyMinimaxApiConfig({}, "MiniMax-M3");
expect(cfg.models?.providers?.minimax?.models[0]?.reasoning).toBe(true);
});

Expand All @@ -31,17 +31,17 @@ describe("minimax onboard", () => {
agents: {
defaults: {
models: {
"minimax/MiniMax-M2.7": {
"minimax/MiniMax-M3": {
alias: "MiniMax",
params: { custom: "value" },
},
},
},
},
},
"MiniMax-M2.7",
"MiniMax-M3",
);
expect(cfg.agents?.defaults?.models?.["minimax/MiniMax-M2.7"]).toMatchObject({
expect(cfg.agents?.defaults?.models?.["minimax/MiniMax-M3"]).toMatchObject({
alias: "Minimax",
params: { custom: "value" },
});
Expand All @@ -60,7 +60,7 @@ describe("minimax onboard", () => {
expect(cfg.models?.providers?.minimax?.apiKey).toBe("old-key");
expect(cfg.models?.providers?.minimax?.models.map((m) => m.id)).toEqual([
"old-model",
"MiniMax-M2.7",
"MiniMax-M3",
]);
});

Expand Down
8 changes: 4 additions & 4 deletions minimax/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function applyMinimaxApiConfigWithBaseUrl(

export function applyMinimaxApiProviderConfig(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand All @@ -72,7 +72,7 @@ export function applyMinimaxApiProviderConfig(

export function applyMinimaxApiConfig(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand All @@ -83,7 +83,7 @@ export function applyMinimaxApiConfig(

export function applyMinimaxApiProviderConfigCn(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiProviderConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand All @@ -94,7 +94,7 @@ export function applyMinimaxApiProviderConfigCn(

export function applyMinimaxApiConfigCn(
cfg: OpenClawConfig,
modelId: string = "MiniMax-M2.7",
modelId: string = "MiniMax-M3",
): OpenClawConfig {
return applyMinimaxApiConfigWithBaseUrl(cfg, {
providerId: "minimax",
Expand Down
9 changes: 4 additions & 5 deletions minimax/provider-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import {
} from "./provider-models.js";

const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic";
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 204800;
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 1000000;
const MINIMAX_DEFAULT_MAX_TOKENS = 131072;
const MINIMAX_API_COST = {
input: 0.3,
output: 1.2,
cacheRead: 0.06,
cacheWrite: 0.375,
input: 0.6,
output: 2.4,
cacheRead: 0.12,
};

function buildMinimaxModel(params: {
Expand Down
11 changes: 8 additions & 3 deletions minimax/provider-models.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { matchesExactOrPrefix } from "openclaw/plugin-sdk/provider-model-shared";

export const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M2.7";
export const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M3";
export const MINIMAX_DEFAULT_MODEL_REF = `minimax/${MINIMAX_DEFAULT_MODEL_ID}`;

export const MINIMAX_TEXT_MODEL_ORDER = ["MiniMax-M2.7", "MiniMax-M2.7-highspeed"] as const;
export const MINIMAX_TEXT_MODEL_ORDER = [
"MiniMax-M3",
"MiniMax-M2.7",
"MiniMax-M2.7-highspeed",
] as const;

export const MINIMAX_TEXT_MODEL_CATALOG = {
"MiniMax-M3": { name: "MiniMax M3", reasoning: true },
"MiniMax-M2.7": { name: "MiniMax M2.7", reasoning: true },
"MiniMax-M2.7-highspeed": { name: "MiniMax M2.7 Highspeed", reasoning: true },
} as const;
Expand All @@ -14,7 +19,7 @@ export const MINIMAX_TEXT_MODEL_REFS = MINIMAX_TEXT_MODEL_ORDER.map(
(modelId) => `minimax/${modelId}`,
);

const MINIMAX_MODERN_MODEL_MATCHERS = ["minimax-m2.7"] as const;
const MINIMAX_MODERN_MODEL_MATCHERS = ["minimax-m3", "minimax-m2.7"] as const;

export function isMiniMaxModernModelId(modelId: string): boolean {
return matchesExactOrPrefix(modelId, MINIMAX_MODERN_MODEL_MATCHERS);
Expand Down
Loading