@@ -16,6 +16,7 @@
|
|||||||
- Always ask before removing functionality or code that appears to be intentional
|
- Always ask before removing functionality or code that appears to be intentional
|
||||||
- Do not preserve backward compatibility unless the user explicitly asks for it
|
- Do not preserve backward compatibility unless the user explicitly asks for it
|
||||||
- Never hardcode key checks with, eg. `matchesKey(keyData, "ctrl+x")`. All keybindings must be configurable. Add default to matching object (`DEFAULT_EDITOR_KEYBINDINGS` or `DEFAULT_APP_KEYBINDINGS`)
|
- Never hardcode key checks with, eg. `matchesKey(keyData, "ctrl+x")`. All keybindings must be configurable. Add default to matching object (`DEFAULT_EDITOR_KEYBINDINGS` or `DEFAULT_APP_KEYBINDINGS`)
|
||||||
|
- NEVER modify `packages/ai/src/models.generated.ts` directly. Update `packages/ai/scripts/generate-models.ts` instead.
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Added Xiaomi MiMo provider (openai-completions compatible) with `XIAOMI_API_KEY` authentication.
|
- Added Xiaomi MiMo Token Plan provider (Anthropic-compatible) with `XIAOMI_API_KEY` authentication ([#4005](https://github.com/badlogic/pi-mono/pull/4005) by [@Phoen1xCode](https://github.com/Phoen1xCode)).
|
||||||
- Added `Model.thinkingLevelMap`, `getSupportedThinkingLevels()`, and `clampThinkingLevel()` so model metadata can describe supported thinking levels and provider-specific level values ([#3208](https://github.com/badlogic/pi-mono/issues/3208)).
|
- Added `Model.thinkingLevelMap`, `getSupportedThinkingLevels()`, and `clampThinkingLevel()` so model metadata can describe supported thinking levels and provider-specific level values ([#3208](https://github.com/badlogic/pi-mono/issues/3208)).
|
||||||
|
|
||||||
## [0.71.1] - 2026-05-01
|
## [0.71.1] - 2026-05-01
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ Unified LLM API with automatic model discovery, provider configuration, token an
|
|||||||
- **OpenCode Go**
|
- **OpenCode Go**
|
||||||
- **Fireworks** (uses Anthropic-compatible API)
|
- **Fireworks** (uses Anthropic-compatible API)
|
||||||
- **Kimi For Coding** (Moonshot AI, uses Anthropic-compatible API)
|
- **Kimi For Coding** (Moonshot AI, uses Anthropic-compatible API)
|
||||||
- **Xiaomi MiMo** (uses OpenAI-compatible API)
|
- **Xiaomi MiMo Token Plan** (uses Anthropic-compatible API)
|
||||||
- **Any OpenAI-compatible API**: Ollama, vLLM, LM Studio, etc.
|
- **Any OpenAI-compatible API**: Ollama, vLLM, LM Studio, etc.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -1047,6 +1047,7 @@ In Node.js environments, you can set environment variables to avoid passing API
|
|||||||
| MiniMax | `MINIMAX_API_KEY` |
|
| MiniMax | `MINIMAX_API_KEY` |
|
||||||
| OpenCode Zen / OpenCode Go | `OPENCODE_API_KEY` |
|
| OpenCode Zen / OpenCode Go | `OPENCODE_API_KEY` |
|
||||||
| Kimi For Coding | `KIMI_API_KEY` |
|
| Kimi For Coding | `KIMI_API_KEY` |
|
||||||
|
| Xiaomi MiMo Token Plan | `XIAOMI_API_KEY` |
|
||||||
| GitHub Copilot | `COPILOT_GITHUB_TOKEN` or `GH_TOKEN` or `GITHUB_TOKEN` |
|
| GitHub Copilot | `COPILOT_GITHUB_TOKEN` or `GH_TOKEN` or `GITHUB_TOKEN` |
|
||||||
|
|
||||||
When set, the library automatically uses these keys:
|
When set, the library automatically uses these keys:
|
||||||
|
|||||||
@@ -919,9 +919,9 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
|
|||||||
models.push({
|
models.push({
|
||||||
id: modelId,
|
id: modelId,
|
||||||
name: m.name || modelId,
|
name: m.name || modelId,
|
||||||
api: "openai-completions",
|
api: "anthropic-messages",
|
||||||
provider: "xiaomi",
|
provider: "xiaomi",
|
||||||
baseUrl: "https://api.xiaomimimo.com/v1",
|
baseUrl: "https://token-plan-ams.xiaomimimo.com/anthropic",
|
||||||
reasoning: m.reasoning === true,
|
reasoning: m.reasoning === true,
|
||||||
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
|
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
|
|||||||
@@ -9316,7 +9316,7 @@ export const MODELS = {
|
|||||||
cacheRead: 0.024999999999999998,
|
cacheRead: 0.024999999999999998,
|
||||||
cacheWrite: 0.08333333333333334,
|
cacheWrite: 0.08333333333333334,
|
||||||
},
|
},
|
||||||
contextWindow: 1000000,
|
contextWindow: 1048576,
|
||||||
maxTokens: 8192,
|
maxTokens: 8192,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"openai-completions">,
|
||||||
"google/gemini-2.0-flash-lite-001": {
|
"google/gemini-2.0-flash-lite-001": {
|
||||||
@@ -16392,9 +16392,9 @@ export const MODELS = {
|
|||||||
"mimo-v2-flash": {
|
"mimo-v2-flash": {
|
||||||
id: "mimo-v2-flash",
|
id: "mimo-v2-flash",
|
||||||
name: "MiMo-V2-Flash",
|
name: "MiMo-V2-Flash",
|
||||||
api: "openai-completions",
|
api: "anthropic-messages",
|
||||||
provider: "xiaomi",
|
provider: "xiaomi",
|
||||||
baseUrl: "https://api.xiaomimimo.com/v1",
|
baseUrl: "https://token-plan-ams.xiaomimimo.com/anthropic",
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
@@ -16405,13 +16405,13 @@ export const MODELS = {
|
|||||||
},
|
},
|
||||||
contextWindow: 256000,
|
contextWindow: 256000,
|
||||||
maxTokens: 64000,
|
maxTokens: 64000,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"anthropic-messages">,
|
||||||
"mimo-v2-omni": {
|
"mimo-v2-omni": {
|
||||||
id: "mimo-v2-omni",
|
id: "mimo-v2-omni",
|
||||||
name: "MiMo-V2-Omni",
|
name: "MiMo-V2-Omni",
|
||||||
api: "openai-completions",
|
api: "anthropic-messages",
|
||||||
provider: "xiaomi",
|
provider: "xiaomi",
|
||||||
baseUrl: "https://api.xiaomimimo.com/v1",
|
baseUrl: "https://token-plan-ams.xiaomimimo.com/anthropic",
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text", "image"],
|
input: ["text", "image"],
|
||||||
cost: {
|
cost: {
|
||||||
@@ -16422,13 +16422,13 @@ export const MODELS = {
|
|||||||
},
|
},
|
||||||
contextWindow: 256000,
|
contextWindow: 256000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"anthropic-messages">,
|
||||||
"mimo-v2-pro": {
|
"mimo-v2-pro": {
|
||||||
id: "mimo-v2-pro",
|
id: "mimo-v2-pro",
|
||||||
name: "MiMo-V2-Pro",
|
name: "MiMo-V2-Pro",
|
||||||
api: "openai-completions",
|
api: "anthropic-messages",
|
||||||
provider: "xiaomi",
|
provider: "xiaomi",
|
||||||
baseUrl: "https://api.xiaomimimo.com/v1",
|
baseUrl: "https://token-plan-ams.xiaomimimo.com/anthropic",
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
@@ -16439,13 +16439,13 @@ export const MODELS = {
|
|||||||
},
|
},
|
||||||
contextWindow: 1000000,
|
contextWindow: 1000000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"anthropic-messages">,
|
||||||
"mimo-v2.5": {
|
"mimo-v2.5": {
|
||||||
id: "mimo-v2.5",
|
id: "mimo-v2.5",
|
||||||
name: "MiMo-V2.5",
|
name: "MiMo-V2.5",
|
||||||
api: "openai-completions",
|
api: "anthropic-messages",
|
||||||
provider: "xiaomi",
|
provider: "xiaomi",
|
||||||
baseUrl: "https://api.xiaomimimo.com/v1",
|
baseUrl: "https://token-plan-ams.xiaomimimo.com/anthropic",
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
@@ -16456,13 +16456,13 @@ export const MODELS = {
|
|||||||
},
|
},
|
||||||
contextWindow: 1048576,
|
contextWindow: 1048576,
|
||||||
maxTokens: 131072,
|
maxTokens: 131072,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"anthropic-messages">,
|
||||||
"mimo-v2.5-pro": {
|
"mimo-v2.5-pro": {
|
||||||
id: "mimo-v2.5-pro",
|
id: "mimo-v2.5-pro",
|
||||||
name: "MiMo-V2.5-Pro",
|
name: "MiMo-V2.5-Pro",
|
||||||
api: "openai-completions",
|
api: "anthropic-messages",
|
||||||
provider: "xiaomi",
|
provider: "xiaomi",
|
||||||
baseUrl: "https://api.xiaomimimo.com/v1",
|
baseUrl: "https://token-plan-ams.xiaomimimo.com/anthropic",
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text", "image"],
|
input: ["text", "image"],
|
||||||
cost: {
|
cost: {
|
||||||
@@ -16473,7 +16473,7 @@ export const MODELS = {
|
|||||||
},
|
},
|
||||||
contextWindow: 1048576,
|
contextWindow: 1048576,
|
||||||
maxTokens: 131072,
|
maxTokens: 131072,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"anthropic-messages">,
|
||||||
},
|
},
|
||||||
"zai": {
|
"zai": {
|
||||||
"glm-4.5-air": {
|
"glm-4.5-air": {
|
||||||
|
|||||||
@@ -994,9 +994,13 @@ describe("Generate E2E Tests", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
describe.skipIf(!process.env.XIAOMI_API_KEY)(
|
describe.skipIf(!process.env.XIAOMI_API_KEY)(
|
||||||
"Xiaomi MiMo Provider (Xiaomi MiMo-V2.5-Pro via OpenAI Completions)",
|
"Xiaomi MiMo Token Plan Provider (Xiaomi MiMo-V2.5-Pro via Anthropic Messages)",
|
||||||
() => {
|
() => {
|
||||||
const llm = getModel("xiaomi", "mimo-v2.5-pro");
|
const llm = getModel("xiaomi", "mimo-v2.5-pro");
|
||||||
|
const thinkingOptions = {
|
||||||
|
thinkingEnabled: true,
|
||||||
|
reasoningEffort: "high",
|
||||||
|
} satisfies StreamOptionsWithExtras;
|
||||||
|
|
||||||
it("should complete basic text generation", { retry: 3 }, async () => {
|
it("should complete basic text generation", { retry: 3 }, async () => {
|
||||||
await basicTextGeneration(llm);
|
await basicTextGeneration(llm);
|
||||||
@@ -1009,6 +1013,14 @@ describe("Generate E2E Tests", () => {
|
|||||||
it("should handle streaming", { retry: 3 }, async () => {
|
it("should handle streaming", { retry: 3 }, async () => {
|
||||||
await handleStreaming(llm);
|
await handleStreaming(llm);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should handle thinking mode", { retry: 3 }, async () => {
|
||||||
|
await handleThinking(llm, thinkingOptions);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle multi-turn with thinking and tools", { retry: 3 }, async () => {
|
||||||
|
await multiTurn(llm, thinkingOptions);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- Added Xiaomi MiMo Token Plan provider support with `XIAOMI_API_KEY`, default model resolution, `/login` display support, and provider documentation ([#4005](https://github.com/badlogic/pi-mono/pull/4005) by [@Phoen1xCode](https://github.com/Phoen1xCode)).
|
||||||
- Added model-level `thinkingLevelMap` support in `models.json` and `pi.registerProvider()`, allowing models to expose only the thinking levels they actually support ([#3208](https://github.com/badlogic/pi-mono/issues/3208)).
|
- Added model-level `thinkingLevelMap` support in `models.json` and `pi.registerProvider()`, allowing models to expose only the thinking levels they actually support ([#3208](https://github.com/badlogic/pi-mono/issues/3208)).
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ For each built-in provider, pi maintains a list of tool-capable models, updated
|
|||||||
- Fireworks
|
- Fireworks
|
||||||
- Kimi For Coding
|
- Kimi For Coding
|
||||||
- MiniMax
|
- MiniMax
|
||||||
- Xiaomi MiMo
|
- Xiaomi MiMo Token Plan
|
||||||
|
|
||||||
See [docs/providers.md](docs/providers.md) for detailed setup instructions.
|
See [docs/providers.md](docs/providers.md) for detailed setup instructions.
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,9 @@ pi
|
|||||||
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
|
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
|
||||||
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
||||||
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
||||||
| Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
|
| Xiaomi MiMo Token Plan | `XIAOMI_API_KEY` | `xiaomi` |
|
||||||
|
|
||||||
|
The Xiaomi MiMo provider targets the Xiaomi MiMo Token Plan Anthropic-compatible endpoint.
|
||||||
|
|
||||||
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
|
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ ${chalk.bold("Environment Variables:")}
|
|||||||
CLOUDFLARE_API_KEY - Cloudflare API token (Workers AI and AI Gateway)
|
CLOUDFLARE_API_KEY - Cloudflare API token (Workers AI and AI Gateway)
|
||||||
CLOUDFLARE_ACCOUNT_ID - Cloudflare account id (required for both)
|
CLOUDFLARE_ACCOUNT_ID - Cloudflare account id (required for both)
|
||||||
CLOUDFLARE_GATEWAY_ID - Cloudflare AI Gateway slug (required for AI Gateway)
|
CLOUDFLARE_GATEWAY_ID - Cloudflare AI Gateway slug (required for AI Gateway)
|
||||||
XIAOMI_API_KEY - Xiaomi MiMo API key
|
XIAOMI_API_KEY - Xiaomi MiMo Token Plan API key
|
||||||
AWS_PROFILE - AWS profile for Amazon Bedrock
|
AWS_PROFILE - AWS profile for Amazon Bedrock
|
||||||
AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock
|
AWS_ACCESS_KEY_ID - AWS access key for Amazon Bedrock
|
||||||
AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock
|
AWS_SECRET_ACCESS_KEY - AWS secret key for Amazon Bedrock
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ export const BUILT_IN_PROVIDER_DISPLAY_NAMES: Record<string, string> = {
|
|||||||
"vercel-ai-gateway": "Vercel AI Gateway",
|
"vercel-ai-gateway": "Vercel AI Gateway",
|
||||||
xai: "xAI",
|
xai: "xAI",
|
||||||
zai: "ZAI",
|
zai: "ZAI",
|
||||||
xiaomi: "Xiaomi MiMo",
|
xiaomi: "Xiaomi MiMo Token Plan",
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user