Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
mistral: document the EU regional endpoint and what the default endpoint does not assure (#5302)
garrytan633687649809
diff --git a/docs/integrations/embedding-providers.md b/docs/integrations/embedding-providers.mdindex 7674323b01..c5fe7e1182 100644--- a/docs/integrations/embedding-providers.md+++ b/docs/integrations/embedding-providers.md@@ -29,6 +29,7 @@ The resolved provider + dimensions get persisted to `~/.gbrain/config.json` atom| `google` | `GOOGLE_GENERATIVE_AI_API_KEY` | 768 | 0.025 | no | no || `azure-openai` | `AZURE_OPENAI_API_KEY`, `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_DEPLOYMENT` | 1536 | 0.13 | no | no || `minimax` | `MINIMAX_API_KEY` | 1536 | 0.07 | no | no |+| `mistral` | `MISTRAL_API_KEY` | 1024 | 0.10 | no | no || `dashscope` | `DASHSCOPE_API_KEY` | 1024 | varies | no | no || `zhipu` | `ZHIPUAI_API_KEY` | 1024 | varies | no | no || `ollama` | (none — runs locally) | 768 | 0 | yes | no |@@ -142,6 +143,12 @@ Unlike vanilla OpenAI, Azure uses `api-key:` header (not `Authorization: Bearer`Models: `text-embedding-3-large`, `text-embedding-3-small`, `text-embedding-ada-002` (your Azure deployment must serve the requested model).+### Mistral AI++Set `MISTRAL_API_KEY`. Model: `mistral-embed` (fixed 1024 dims; the API rejects any dimension parameter, so leave `--embedding-dimensions` at 1024). Chat and expansion run on the same key (`mistral:mistral-large-latest`, `mistral:mistral-small-latest`; unpriced in gbrain's tables, so a user cost cap needs `gbrain pricing set`), so a brain can keep embed + expansion + chat on one provider.++Region: `api.mistral.ai` (the default) is EU-hosted by default, but Mistral's terms allow a request to be served outside the EU unless your organization disables transfers; the default endpoint carries no regional-inference assurance. Inference pinned to the EU is Mistral's opt-in regional endpoint, billed at 1.1x list price: `gbrain config set provider_base_urls.mistral https://api.eu.mistral.ai/v1`, then verify with `gbrain config get provider_base_urls.mistral`. gbrain does not switch to it for you, and ships no separate `mistral-eu` recipe.+### MiniMax (海螺AI)Set `MINIMAX_API_KEY`. Optional `MINIMAX_GROUP_ID` for org-scoped accounts. Model: `embo-01` (1536 dims).diff --git a/src/core/ai/recipes/mistral.ts b/src/core/ai/recipes/mistral.tsindex 3d1741b97a..f258cdd34d 100644--- a/src/core/ai/recipes/mistral.ts+++ b/src/core/ai/recipes/mistral.ts@@ -2,9 +2,20 @@ import type { Recipe } from '../types.ts';/*** Mistral AI exposes an OpenAI-compatible API at https://api.mistral.ai/v1- * (/embeddings + /chat/completions). EU-hosted — the reason this recipe- * exists: a brain that must stay inside EU jurisdiction can run embed +- * expansion + chat on a single provider without a US hop.+ * (/embeddings + /chat/completions). The reason this recipe exists: a brain+ * that wants EU-based hosting can run embed + expansion + chat on a single+ * provider.+ *+ * REGION (#5302) — `api.mistral.ai` is EU-hosted by DEFAULT (Mistral: "your+ * data is hosted in the European Union") but carries NO regional-inference+ * assurance: Mistral's own terms allow a request to be served outside the EU+ * unless the account disables transfers. Inference pinned to the EU is+ * Mistral's opt-in regional endpoint, https://api.eu.mistral.ai/v1, billed+ * at 1.1x list price per Mistral. gbrain does not switch to it by default+ * (price and account enablement are the operator's call); opt in with+ * `gbrain config set provider_base_urls.mistral https://api.eu.mistral.ai/v1`+ * and verify with `gbrain config get provider_base_urls.mistral`. No separate+ * `mistral-eu` recipe: it would duplicate every model table for one URL.** Verified against the live API on 2026-07-19 (model catalog, embedding* dimensions, dimension-parameter rejection, and the batch ceiling — see@@ -93,5 +104,7 @@ export const mistral: Recipe = {price_last_verified: '2026-07-19',},},- setup_hint: 'Get an API key at https://console.mistral.ai/api-keys, then `export MISTRAL_API_KEY=...` and use `mistral:mistral-embed` (1024 dims) for embeddings.',+ setup_hint: 'Get an API key at https://console.mistral.ai/api-keys, then `export MISTRAL_API_KEY=...` and use `mistral:mistral-embed` (1024 dims) for embeddings. '+ + 'api.mistral.ai is EU-hosted by default without a regional-inference assurance; for EU-pinned inference (1.1x list price) run '+ + '`gbrain config set provider_base_urls.mistral https://api.eu.mistral.ai/v1` and verify with `gbrain config get provider_base_urls.mistral`.',};