mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
This builds the model catalog from per-provider definitions and models.dev v2 data. It eplacer `generate-models.ts` with one `defineProvider()` file per built-in provider, shared model-family rules (Claude, GPT, DeepSeek, Kimi, Google), and source adapters. models.dev is read through its v2 API. Outputs and CLI flags are unchanged.
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
import { defineProvider, modelsDevModels, type ProviderContext } from "../define.ts";
|
|
import { getEffortThinkingLevelMap } from "../reasoning.ts";
|
|
|
|
// MiniMax asked to hide older models from its direct providers (#2596).
|
|
const HIDDEN_MODEL_IDS = new Set(["MiniMax-M2", "MiniMax-M2.1", "MiniMax-M2.5", "MiniMax-M2.5-highspeed"]);
|
|
|
|
/** MiniMax's Anthropic-compatible API. The SDK appends /v1/messages. */
|
|
export function minimaxModels(ctx: ProviderContext, source: string, baseUrl: string) {
|
|
return modelsDevModels(ctx, source, {
|
|
api: "anthropic-messages",
|
|
baseUrl,
|
|
recordReasoning: false,
|
|
include: (model) => !HIDDEN_MODEL_IDS.has(model.id),
|
|
map: (model, source) => {
|
|
// Models with effort levels (e.g. MiniMax-M3.1-Flash) take adaptive thinking with
|
|
// output_config.effort and reject thinking.type="disabled" (no "none" effort, so off is null).
|
|
const thinkingLevelMap = getEffortThinkingLevelMap(source.reasoningOptions ?? []);
|
|
return thinkingLevelMap ? { ...model, thinkingLevelMap, compat: { forceAdaptiveThinking: true } } : model;
|
|
},
|
|
});
|
|
}
|
|
|
|
export default defineProvider({
|
|
id: "minimax",
|
|
models: (ctx) => minimaxModels(ctx, "minimax", "https://api.minimax.io/anthropic"),
|
|
});
|