Skip to content
Merged
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ Manual `memoryProvider` modes:
- `openai-chat`: OpenAI Chat Completions compatible API with tool/function calling. This can work with compatible proxies such as LiteLLM only when the selected upstream model and proxy preserve tool calls.
- `openai-responses`: OpenAI Responses API with function-call output.
- `anthropic`: Anthropic Messages API with tool use.
- `minimax`: MiniMax Anthropic Messages-compatible endpoint. Set `memoryApiUrl` to the global endpoint (`https://api.minimax.io`) or the China endpoint (`https://api.minimaxi.com`); the `/anthropic/v1/messages` path and `x-api-key` header are applied automatically. Current models include `MiniMax-M3` (1,000,000-token context; adaptive or disabled thinking) and `MiniMax-M2.7` (204,800-token context; always-on thinking). `MiniMax-M3` supports adaptive thinking through `memoryExtraParams`.
- `minimax`: MiniMax Anthropic Messages-compatible endpoint. Set `memoryApiUrl` to the global endpoint (`https://api.minimax.io`) or the [China endpoint](https://platform.minimaxi.com/docs/api-reference/text-anthropic-api.md) (`https://api.minimax.cn`); the `/anthropic/v1/messages` path and `x-api-key` header are applied automatically. Use `MiniMax-M3.1-Flash` (recommended) or `MiniMax-M3`, both with a 1,000,000-token context. Flash always thinks; optionally set `memoryExtraParams` to `{ "output_config": { "effort": "max" } }` with `low`, `medium`, `high`, `xhigh`, or `max` (default). Flash rejects disabled thinking and effort `none`, and does not support `service_tier`. M3 thinking is off by default on this endpoint; enable it with `{ "thinking": { "type": "adaptive" } }`. Model IDs remain explicitly configured; existing custom or legacy IDs are passed through unchanged. See the [MiniMax compatibility reference](https://platform.minimax.io/docs/api-reference/text-anthropic-api.md).
- `orcarouter`: OpenAI-compatible model gateway with namespaced model IDs. `memoryApiUrl` and `memoryModel` are optional — they default to `https://api.orcarouter.ai/v1` and `orcarouter/auto` (a routing alias that selects a capable model per request). If you set `memoryModel`, use a namespaced ID such as `openai/gpt-5.5` or `deepseek/deepseek-v4-flash`; OrcaRouter rejects bare model names. Example:
```jsonc
"memoryProvider": "orcarouter",
Expand Down
2 changes: 1 addition & 1 deletion i18n/README.ar.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ memory({ mode: "import", inputPath: "./memories.json" });
- `openai-chat`: API متوافق مع OpenAI Chat Completions مع استدعاء أدوات/دوال. يمكن أن يعمل مع وكلاء متوافقين مثل LiteLLM فقط عندما يحافظ النموذج العلوي والوكيل المحددان على استدعاءات الأدوات.
- `openai-responses`: OpenAI Responses API مع مخرجات استدعاء دوال.
- `anthropic`: Anthropic Messages API مع استخدام الأدوات.
- `minimax`: نقطة نهاية MiniMax متوافقة مع Anthropic Messages. عيّن `memoryApiUrl` إلى النقطة العالمية (`https://api.minimax.io`) أو نقطة الصين (`https://api.minimaxi.com`)؛ يُطبَّق مسار `/anthropic/v1/messages` وترويسة `x-api-key` تلقائيًا. النماذج الحالية تشمل `MiniMax-M3` (سياق 1,000,000 رمز؛ تفكير تكيفي أو معطّل) و`MiniMax-M2.7` (سياق 204,800 رمز؛ تفكير دائم التشغيل). يدعم `MiniMax-M3` التفكير التكيفي عبر `memoryExtraParams`.
- `minimax`: نقطة نهاية MiniMax متوافقة مع Anthropic Messages. عيّن `memoryApiUrl` إلى النقطة العالمية (`https://api.minimax.io`) أو [نقطة الصين](https://platform.minimaxi.com/docs/api-reference/text-anthropic-api.md) (`https://api.minimax.cn`)؛ يُطبَّق مسار `/anthropic/v1/messages` وترويسة `x-api-key` تلقائيًا. استخدم `MiniMax-M3.1-Flash` (موصى به) أو `MiniMax-M3`، وكلاهما بسياق 1,000,000 رمز. Flash يفكر دائمًا؛ ويمكن اختياريًا تعيين `memoryExtraParams` إلى `{ "output_config": { "effort": "max" } }` بالقيم `low` أو `medium` أو `high` أو `xhigh` أو `max` (الافتراضي). يرفض Flash تعطيل التفكير وeffort `none`، ولا يدعم `service_tier`. تفكير M3 معطّل افتراضيًا على هذه النقطة؛ فعّله بـ `{ "thinking": { "type": "adaptive" } }`. تبقى معرّفات النماذج مُعدّة صراحةً؛ وتُمرَّر المعرّفات المخصصة أو القديمة دون تغيير. راجع [مرجع توافق MiniMax](https://platform.minimax.io/docs/api-reference/text-anthropic-api.md).
- `orcarouter`: بوابة نماذج متوافقة مع OpenAI بمعرّفات نماذج ذات مساحة أسماء. `memoryApiUrl` و`memoryModel` اختياريان — الافتراضي `https://api.orcarouter.ai/v1` و`orcarouter/auto` (اسم مستعار للتوجيه يختار نموذجًا قادرًا لكل طلب). إذا عيّنت `memoryModel`، استخدم معرّفًا ذا مساحة أسماء مثل `openai/gpt-5.5` أو `deepseek/deepseek-v4-flash`؛ يرفض OrcaRouter أسماء النماذج العارية. مثال:
```jsonc
"memoryProvider": "orcarouter",
Expand Down
2 changes: 1 addition & 1 deletion i18n/README.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ Manuelle `memoryProvider`-Modi:
- `openai-chat`: OpenAI-Chat-Completions-kompatible API mit Tool-/Function-Calling. Kann mit kompatiblen Proxies wie LiteLLM nur funktionieren, wenn das gewählte Upstream-Modell und der Proxy Tool-Calls erhalten.
- `openai-responses`: OpenAI Responses API mit Function-Call-Ausgabe.
- `anthropic`: Anthropic Messages API mit Tool Use.
- `minimax`: MiniMax Anthropic-Messages-kompatibler Endpoint. `memoryApiUrl` auf den globalen Endpoint (`https://api.minimax.io`) oder den China-Endpoint (`https://api.minimaxi.com`) setzen; der Pfad `/anthropic/v1/messages` und der Header `x-api-key` werden automatisch angewendet. Aktuelle Modelle umfassen `MiniMax-M3` (1.000.000-Token-Kontext; adaptives oder deaktiviertes Thinking) und `MiniMax-M2.7` (204.800-Token-Kontext; Thinking immer an). `MiniMax-M3` unterstützt adaptives Thinking über `memoryExtraParams`.
- `minimax`: MiniMax Anthropic-Messages-kompatibler Endpoint. `memoryApiUrl` auf den globalen Endpoint (`https://api.minimax.io`) oder den [China-Endpoint](https://platform.minimaxi.com/docs/api-reference/text-anthropic-api.md) (`https://api.minimax.cn`) setzen; der Pfad `/anthropic/v1/messages` und der Header `x-api-key` werden automatisch angewendet. `MiniMax-M3.1-Flash` (empfohlen) oder `MiniMax-M3` verwenden, beide mit 1.000.000-Token-Kontext. Flash denkt immer; optional `memoryExtraParams` auf `{ "output_config": { "effort": "max" } }` setzen mit `low`, `medium`, `high`, `xhigh` oder `max` (Standard). Flash lehnt deaktiviertes Thinking und Effort `none` ab und unterstützt kein `service_tier`. M3-Thinking ist auf diesem Endpoint standardmäßig aus; aktivieren mit `{ "thinking": { "type": "adaptive" } }`. Modell-IDs bleiben explizit konfiguriert; vorhandene Custom- oder Legacy-IDs werden unverändert durchgereicht. Siehe die [MiniMax-Kompatibilitätsreferenz](https://platform.minimax.io/docs/api-reference/text-anthropic-api.md).
- `orcarouter`: OpenAI-kompatibles Model-Gateway mit namenspaced Model-IDs. `memoryApiUrl` und `memoryModel` sind optional — sie defaulten auf `https://api.orcarouter.ai/v1` und `orcarouter/auto` (ein Routing-Alias, der pro Request ein fähiges Modell wählt). Wenn du `memoryModel` setzt, eine namenspaced ID wie `openai/gpt-5.5` oder `deepseek/deepseek-v4-flash` verwenden; OrcaRouter lehnt bare Modellnamen ab. Beispiel:
```jsonc
"memoryProvider": "orcarouter",
Expand Down
2 changes: 1 addition & 1 deletion i18n/README.nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ Handmatige `memoryProvider`-modi:
- `openai-chat`: OpenAI Chat Completions-compatibele API met tool/function calling. Dit kan werken met compatibele proxies zoals LiteLLM alleen wanneer het geselecteerde upstream-model en de proxy tool calls behouden.
- `openai-responses`: OpenAI Responses API met function-call-output.
- `anthropic`: Anthropic Messages API met tool use.
- `minimax`: MiniMax Anthropic Messages-compatibel endpoint. Stel `memoryApiUrl` in op het globale endpoint (`https://api.minimax.io`) of het China-endpoint (`https://api.minimaxi.com`); het pad `/anthropic/v1/messages` en de header `x-api-key` worden automatisch toegepast. Huidige modellen zijn onder meer `MiniMax-M3` (1.000.000-token context; adaptief of uitgeschakeld thinking) en `MiniMax-M2.7` (204.800-token context; altijd-aan thinking). `MiniMax-M3` ondersteunt adaptief thinking via `memoryExtraParams`.
- `minimax`: MiniMax Anthropic Messages-compatibel endpoint. Stel `memoryApiUrl` in op het globale endpoint (`https://api.minimax.io`) of het [China-endpoint](https://platform.minimaxi.com/docs/api-reference/text-anthropic-api.md) (`https://api.minimax.cn`); het pad `/anthropic/v1/messages` en de header `x-api-key` worden automatisch toegepast. Gebruik `MiniMax-M3.1-Flash` (aanbevolen) of `MiniMax-M3`, beide met een 1.000.000-token context. Flash denkt altijd; stel optioneel `memoryExtraParams` in op `{ "output_config": { "effort": "max" } }` met `low`, `medium`, `high`, `xhigh` of `max` (standaard). Flash weigert uitgeschakeld thinking en effort `none`, en ondersteunt geen `service_tier`. M3-thinking staat op dit endpoint standaard uit; zet het aan met `{ "thinking": { "type": "adaptive" } }`. Model-ID’s blijven expliciet geconfigureerd; bestaande custom of legacy-ID’s worden ongewijzigd doorgestuurd. Zie de [MiniMax-compatibiliteitsreferentie](https://platform.minimax.io/docs/api-reference/text-anthropic-api.md).
- `orcarouter`: OpenAI-compatibele modelgateway met namespaced model-ID’s. `memoryApiUrl` en `memoryModel` zijn optioneel — ze defaulten naar `https://api.orcarouter.ai/v1` en `orcarouter/auto` (een routingalias die per verzoek een capabel model kiest). Als je `memoryModel` instelt, gebruik een namespaced ID zoals `openai/gpt-5.5` of `deepseek/deepseek-v4-flash`; OrcaRouter weigert bare modelnamen. Voorbeeld:
```jsonc
"memoryProvider": "orcarouter",
Expand Down
2 changes: 1 addition & 1 deletion i18n/README.tr.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Manuel `memoryProvider` modları:
- `openai-chat`: Araç/fonksiyon çağrısıyla OpenAI Chat Completions uyumlu API. Seçilen üst akış modeli ve proxy araç çağrılarını koruduğunda LiteLLM gibi uyumlu proxy’lerle çalışabilir.
- `openai-responses`: Fonksiyon çağrısı çıktısıyla OpenAI Responses API.
- `anthropic`: Araç kullanımıyla Anthropic Messages API.
- `minimax`: MiniMax Anthropic Messages uyumlu uç noktası. `memoryApiUrl`’yi küresel uç noktaya (`https://api.minimax.io`) veya Çin uç noktasına (`https://api.minimaxi.com`) ayarlayın; `/anthropic/v1/messages` yolu ve `x-api-key` başlığı otomatik uygulanır. Güncel modeller arasında `MiniMax-M3` (1.000.000 jeton bağlam; uyarlanabilir veya devre dışı düşünme) ve `MiniMax-M2.7` (204.800 jeton bağlam; her zaman açık düşünme) vardır. `MiniMax-M3`, `memoryExtraParams` üzerinden uyarlanabilir düşünmeyi destekler.
- `minimax`: MiniMax Anthropic Messages uyumlu uç noktası. `memoryApiUrl`’yi küresel uç noktaya (`https://api.minimax.io`) veya [Çin uç noktasına](https://platform.minimaxi.com/docs/api-reference/text-anthropic-api.md) (`https://api.minimax.cn`) ayarlayın; `/anthropic/v1/messages` yolu ve `x-api-key` başlığı otomatik uygulanır. `MiniMax-M3.1-Flash` (önerilen) veya `MiniMax-M3` kullanın; her ikisi de 1.000.000 jeton bağlamına sahiptir. Flash her zaman düşünür; isteğe bağlı olarak `memoryExtraParams`’ı `{ "output_config": { "effort": "max" } }` olarak `low`, `medium`, `high`, `xhigh` veya `max` (varsayılan) ile ayarlayın. Flash, devre dışı düşünmeyi ve effort `none` değerini reddeder ve `service_tier` desteklemez. Bu uç noktada M3 düşünmesi varsayılan olarak kapalıdır; `{ "thinking": { "type": "adaptive" } }` ile etkinleştirin. Model kimlikleri açıkça yapılandırılmaya devam eder; mevcut özel veya eski kimlikler değiştirilmeden iletilir. Bkz. [MiniMax uyumluluk referansı](https://platform.minimax.io/docs/api-reference/text-anthropic-api.md).
- `orcarouter`: Ad alanlı model kimlikleriyle OpenAI uyumlu model ağ geçidi. `memoryApiUrl` ve `memoryModel` isteğe bağlıdır — varsayılanları `https://api.orcarouter.ai/v1` ve `orcarouter/auto`’dur (istek başına yetenekli bir model seçen bir yönlendirme takma adı). `memoryModel` ayarlarsanız `openai/gpt-5.5` veya `deepseek/deepseek-v4-flash` gibi ad alanlı bir kimlik kullanın; OrcaRouter çıplak model adlarını reddeder. Örnek:
```jsonc
"memoryProvider": "orcarouter",
Expand Down
2 changes: 1 addition & 1 deletion i18n/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ memory({ mode: "import", inputPath: "./memories.json" });
- `openai-chat`:兼容 OpenAI Chat Completions、带工具/函数调用的 API。仅当所选上游模型与代理保留工具调用时,这可与兼容代理(如 LiteLLM)一起工作。
- `openai-responses`:带函数调用输出的 OpenAI Responses API。
- `anthropic`:带工具使用的 Anthropic Messages API。
- `minimax`:MiniMax Anthropic Messages 兼容端点。将 `memoryApiUrl` 设置为全球端点(`https://api.minimax.io`)或中国端点(`https://api.minimaxi.com`);`/anthropic/v1/messages` 路径与 `x-api-key` 标头会自动应用。当前模型包括 `MiniMax-M3`(1,000,000-token 上下文;自适应或禁用思考)与 `MiniMax-M2.7`(204,800-token 上下文;始终开启思考)。`MiniMax-M3` 通过 `memoryExtraParams` 支持自适应思考。
- `minimax`:MiniMax Anthropic Messages 兼容端点。将 `memoryApiUrl` 设置为全球端点(`https://api.minimax.io`)或[中国端点](https://platform.minimaxi.com/docs/api-reference/text-anthropic-api.md)(`https://api.minimax.cn`);`/anthropic/v1/messages` 路径与 `x-api-key` 标头会自动应用。使用 `MiniMax-M3.1-Flash`(推荐)或 `MiniMax-M3`,二者均为 1,000,000-token 上下文。Flash 始终开启思考;可选将 `memoryExtraParams` 设为 `{ "output_config": { "effort": "max" } }`,取值为 `low`、`medium`、`high`、`xhigh` 或 `max`(默认)。Flash 会拒绝禁用思考与 effort `none`,且不支持 `service_tier`。在此端点上 M3 思考默认关闭;可通过 `{ "thinking": { "type": "adaptive" } }` 启用。模型 ID 仍需显式配置;已有自定义或旧版 ID 会原样透传。参见 [MiniMax 兼容性参考](https://platform.minimax.io/docs/api-reference/text-anthropic-api.md)。
- `orcarouter`:带命名空间模型 ID 的 OpenAI 兼容模型网关。`memoryApiUrl` 与 `memoryModel` 可选 — 它们默认为 `https://api.orcarouter.ai/v1` 与 `orcarouter/auto`(按请求选择有能力模型的路由别名)。若设置 `memoryModel`,请使用命名空间 ID,例如 `openai/gpt-5.5` 或 `deepseek/deepseek-v4-flash`;OrcaRouter 拒绝裸模型名。示例:
```jsonc
"memoryProvider": "orcarouter",
Expand Down
12 changes: 6 additions & 6 deletions opencode-mem.example.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@

// MiniMax (Anthropic Messages-compatible endpoint, with session support):
// "memoryProvider": "minimax"
// "memoryModel": "MiniMax-M3" // 1,000,000-token context
// // Alternative: "MiniMax-M2.7" // 204,800-token context; thinking always on
// "memoryModel": "MiniMax-M3.1-Flash" // 1,000,000-token context; thinking always on
// // Alternative: "MiniMax-M3" // 1,000,000-token context; thinking off by default
// "memoryApiUrl": "https://api.minimax.io" // global endpoint
// "memoryApiKey": "<MiniMax API key>"
// // China endpoint: "memoryApiUrl": "https://api.minimaxi.com"
// // MiniMax-M3 supports adaptive or disabled thinking; MiniMax-M2.7 thinking is always on.
// // Optional adaptive thinking for MiniMax-M3:
// "memoryExtraParams": { "thinking": { "type": "adaptive" } }
// // China endpoint: "memoryApiUrl": "https://api.minimax.cn"
// // Flash effort: low | medium | high | xhigh | max (default). Do not disable thinking.
// "memoryExtraParams": { "output_config": { "effort": "max" } }
// // For MiniMax-M3, optionally use { "thinking": { "type": "adaptive" } } instead.

// OrcaRouter (OpenAI-compatible gateway, namespaced model IDs, with session support):
// "memoryProvider": "orcarouter"
Expand Down
12 changes: 6 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,14 @@ const CONFIG_TEMPLATE = `{

// MiniMax (Anthropic Messages-compatible endpoint, with session support):
// "memoryProvider": "minimax"
// "memoryModel": "MiniMax-M3" // 1,000,000-token context
// // Alternative: "MiniMax-M2.7" // 204,800-token context; thinking always on
// "memoryModel": "MiniMax-M3.1-Flash" // 1,000,000-token context; thinking always on
// // Alternative: "MiniMax-M3" // 1,000,000-token context; thinking off by default
// "memoryApiUrl": "https://api.minimax.io" // global endpoint
// "memoryApiKey": "<MiniMax API key>"
// // China endpoint: "memoryApiUrl": "https://api.minimaxi.com"
// // MiniMax-M3 supports adaptive or disabled thinking; MiniMax-M2.7 thinking is always on.
// // Optional adaptive thinking for MiniMax-M3:
// "memoryExtraParams": { "thinking": { "type": "adaptive" } }
// // China endpoint: "memoryApiUrl": "https://api.minimax.cn"
// // Flash effort: low | medium | high | xhigh | max (default). Do not disable thinking.
// "memoryExtraParams": { "output_config": { "effort": "max" } }
// // For MiniMax-M3, optionally use { "thinking": { "type": "adaptive" } } instead.

// OrcaRouter (OpenAI-compatible gateway, namespaced model IDs, with session support):
// "memoryProvider": "orcarouter"
Expand Down
16 changes: 9 additions & 7 deletions src/services/ai/providers/minimax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ import type { AIProviderType } from "../session/session-types.js";
* MiniMax provider.
*
* MiniMax exposes an Anthropic Messages-compatible endpoint for its text
* models. The global endpoint (https://api.minimax.io) and the China endpoint
* (https://api.minimaxi.com) both expose the same `/anthropic/v1/messages`
* path and authenticate with the `x-api-key` header. This provider reuses the
* Anthropic Messages request/response handling and only overrides the resolved
* request endpoint URL and the session provider tag, so MiniMax is
* distinguishable from Anthropic in the session store and diagnostics.
* models. The global endpoint (https://api.minimax.io) and the current China
* endpoint (https://api.minimax.cn) both expose the same
* `/anthropic/v1/messages` path and authenticate with the `x-api-key` header.
* Configured legacy China hosts such as https://api.minimaxi.com are still
* resolved without remapping. This provider reuses the Anthropic Messages
* request/response handling and only overrides the resolved request endpoint
* URL and the session provider tag, so MiniMax is distinguishable from
* Anthropic in the session store and diagnostics.
*
* Users configure the base URL as `memoryApiUrl`:
* - global endpoint: "https://api.minimax.io"
* - China endpoint: "https://api.minimaxi.com"
* - China endpoint: "https://api.minimax.cn"
*/
export class MiniMaxProvider extends AnthropicMessagesProvider {
constructor(config: ProviderConfig, aiSessionManager: AISessionManager) {
Expand Down
Loading
Loading