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.
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
// Moonshot Kimi models, shared by Moonshot, Kimi Coding, and gateways.
|
|
|
|
import type { ModelCost, OpenAICompletionsCompat } from "../../src/types.ts";
|
|
|
|
/**
|
|
* Kimi K3 and its point releases (kimi-k3.1-pro, kimi-k3.1-pro-highspeed) share
|
|
* K3's request format. https://api.moonshot.ai/v1/models reports effort levels
|
|
* and dynamic tool loading for all of them.
|
|
*/
|
|
export function isKimiK3FamilyId(modelId: string): boolean {
|
|
return /^kimi-k3(?:\.\d+)?(?:-|$)/.test(modelId);
|
|
}
|
|
|
|
export const KIMI_K3_MAX_TOKENS = 131072;
|
|
export const KIMI_K3_COST: ModelCost = {
|
|
input: 3,
|
|
output: 15,
|
|
cacheRead: 0.3,
|
|
cacheWrite: 0,
|
|
};
|
|
|
|
// Kimi Chat Completions settings shared by Moonshot and Kimi Coding.
|
|
export const KIMI_OPENAI_COMPAT: OpenAICompletionsCompat = {
|
|
supportsStore: false,
|
|
supportsDeveloperRole: false,
|
|
supportsReasoningEffort: false,
|
|
maxTokensField: "max_tokens",
|
|
supportsStrictMode: false,
|
|
thinkingFormat: "deepseek",
|
|
};
|
|
|
|
// Kimi K3-style models take reasoning_effort and need earlier reasoning sent back.
|
|
export const KIMI_K3_OPENAI_COMPAT: OpenAICompletionsCompat = {
|
|
...KIMI_OPENAI_COMPAT,
|
|
requiresReasoningContentOnAssistantMessages: true,
|
|
thinkingFormat: "openai",
|
|
supportsReasoningEffort: true,
|
|
};
|