@mariozechner/pi-ai 0.50.1 → 0.50.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/env-api-keys.d.ts.map +1 -1
- package/dist/env-api-keys.js +2 -0
- package/dist/env-api-keys.js.map +1 -1
- package/dist/models.generated.d.ts +475 -17
- package/dist/models.generated.d.ts.map +1 -1
- package/dist/models.generated.js +450 -23
- package/dist/models.generated.js.map +1 -1
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +38 -9
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/openai-completions.d.ts.map +1 -1
- package/dist/providers/openai-completions.js +12 -0
- package/dist/providers/openai-completions.js.map +1 -1
- package/dist/providers/openai-responses-shared.d.ts.map +1 -1
- package/dist/providers/openai-responses-shared.js +5 -2
- package/dist/providers/openai-responses-shared.js.map +1 -1
- package/dist/providers/openai-responses.d.ts.map +1 -1
- package/dist/providers/openai-responses.js +14 -0
- package/dist/providers/openai-responses.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/overflow.d.ts +3 -2
- package/dist/utils/overflow.d.ts.map +1 -1
- package/dist/utils/overflow.js +10 -7
- package/dist/utils/overflow.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,6 +63,7 @@ Unified LLM API with automatic model discovery, provider configuration, token an
|
|
|
63
63
|
- **Google Gemini CLI** (requires OAuth, see below)
|
|
64
64
|
- **Antigravity** (requires OAuth, see below)
|
|
65
65
|
- **Amazon Bedrock**
|
|
66
|
+
- **Kimi For Coding** (Moonshot AI, uses Anthropic-compatible API)
|
|
66
67
|
- **Any OpenAI-compatible API**: Ollama, vLLM, LM Studio, etc.
|
|
67
68
|
|
|
68
69
|
## Installation
|
|
@@ -894,6 +895,7 @@ In Node.js environments, you can set environment variables to avoid passing API
|
|
|
894
895
|
| Vercel AI Gateway | `AI_GATEWAY_API_KEY` |
|
|
895
896
|
| zAI | `ZAI_API_KEY` |
|
|
896
897
|
| MiniMax | `MINIMAX_API_KEY` |
|
|
898
|
+
| Kimi For Coding | `KIMI_API_KEY` |
|
|
897
899
|
| GitHub Copilot | `COPILOT_GITHUB_TOKEN` or `GH_TOKEN` or `GITHUB_TOKEN` |
|
|
898
900
|
|
|
899
901
|
When set, the library automatically uses these keys:
|
|
@@ -909,6 +911,19 @@ const response = await complete(model, context, {
|
|
|
909
911
|
});
|
|
910
912
|
```
|
|
911
913
|
|
|
914
|
+
#### Cache Retention
|
|
915
|
+
|
|
916
|
+
Set `PI_CACHE_RETENTION=long` to extend prompt cache retention:
|
|
917
|
+
|
|
918
|
+
| Provider | Default | With `PI_CACHE_RETENTION=long` |
|
|
919
|
+
|----------|---------|-------------------------------|
|
|
920
|
+
| Anthropic | 5 minutes | 1 hour |
|
|
921
|
+
| OpenAI | in-memory | 24 hours |
|
|
922
|
+
|
|
923
|
+
This only affects direct API calls to `api.anthropic.com` and `api.openai.com`. Proxies and other providers are unaffected.
|
|
924
|
+
|
|
925
|
+
> **Note**: Extended cache retention may increase costs for Anthropic (cache writes are charged at a higher rate). OpenAI's 24h retention has no additional cost.
|
|
926
|
+
|
|
912
927
|
### Checking Environment Variables
|
|
913
928
|
|
|
914
929
|
```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-api-keys.d.ts","sourceRoot":"","sources":["../src/env-api-keys.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA0BhD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC","sourcesContent":["// NEVER convert to top-level imports - breaks browser/Vite builds (web-ui)\nlet _existsSync: typeof import(\"node:fs\").existsSync | null = null;\nlet _homedir: typeof import(\"node:os\").homedir | null = null;\nlet _join: typeof import(\"node:path\").join | null = null;\n\n// Eagerly load in Node.js/Bun environment only\nif (typeof process !== \"undefined\" && (process.versions?.node || process.versions?.bun)) {\n\timport(\"node:fs\").then((m) => {\n\t\t_existsSync = m.existsSync;\n\t});\n\timport(\"node:os\").then((m) => {\n\t\t_homedir = m.homedir;\n\t});\n\timport(\"node:path\").then((m) => {\n\t\t_join = m.join;\n\t});\n}\n\nimport type { KnownProvider } from \"./types.js\";\n\nlet cachedVertexAdcCredentialsExists: boolean | null = null;\n\nfunction hasVertexAdcCredentials(): boolean {\n\tif (cachedVertexAdcCredentialsExists === null) {\n\t\t// In browser or if node modules not loaded yet, return false\n\t\tif (!_existsSync || !_homedir || !_join) {\n\t\t\tcachedVertexAdcCredentialsExists = false;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check GOOGLE_APPLICATION_CREDENTIALS env var first (standard way)\n\t\tconst gacPath = process.env.GOOGLE_APPLICATION_CREDENTIALS;\n\t\tif (gacPath) {\n\t\t\tcachedVertexAdcCredentialsExists = _existsSync(gacPath);\n\t\t} else {\n\t\t\t// Fall back to default ADC path (lazy evaluation)\n\t\t\tcachedVertexAdcCredentialsExists = _existsSync(\n\t\t\t\t_join(_homedir(), \".config\", \"gcloud\", \"application_default_credentials.json\"),\n\t\t\t);\n\t\t}\n\t}\n\treturn cachedVertexAdcCredentialsExists;\n}\n\n/**\n * Get API key for provider from known environment variables, e.g. OPENAI_API_KEY.\n *\n * Will not return API keys for providers that require OAuth tokens.\n */\nexport function getEnvApiKey(provider: KnownProvider): string | undefined;\nexport function getEnvApiKey(provider: string): string | undefined;\nexport function getEnvApiKey(provider: any): string | undefined {\n\t// Fall back to environment variables\n\tif (provider === \"github-copilot\") {\n\t\treturn process.env.COPILOT_GITHUB_TOKEN || process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\n\t}\n\n\t// ANTHROPIC_OAUTH_TOKEN takes precedence over ANTHROPIC_API_KEY\n\tif (provider === \"anthropic\") {\n\t\treturn process.env.ANTHROPIC_OAUTH_TOKEN || process.env.ANTHROPIC_API_KEY;\n\t}\n\n\t// Vertex AI uses Application Default Credentials, not API keys.\n\t// Auth is configured via `gcloud auth application-default login`.\n\tif (provider === \"google-vertex\") {\n\t\tconst hasCredentials = hasVertexAdcCredentials();\n\t\tconst hasProject = !!(process.env.GOOGLE_CLOUD_PROJECT || process.env.GCLOUD_PROJECT);\n\t\tconst hasLocation = !!process.env.GOOGLE_CLOUD_LOCATION;\n\n\t\tif (hasCredentials && hasProject && hasLocation) {\n\t\t\treturn \"<authenticated>\";\n\t\t}\n\t}\n\n\tif (provider === \"amazon-bedrock\") {\n\t\t// Amazon Bedrock supports multiple credential sources:\n\t\t// 1. AWS_PROFILE - named profile from ~/.aws/credentials\n\t\t// 2. AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY - standard IAM keys\n\t\t// 3. AWS_BEARER_TOKEN_BEDROCK - Bedrock API keys (bearer token)\n\t\t// 4. AWS_CONTAINER_CREDENTIALS_RELATIVE_URI - ECS task roles\n\t\t// 5. AWS_CONTAINER_CREDENTIALS_FULL_URI - ECS task roles (full URI)\n\t\t// 6. AWS_WEB_IDENTITY_TOKEN_FILE - IRSA (IAM Roles for Service Accounts)\n\t\tif (\n\t\t\tprocess.env.AWS_PROFILE ||\n\t\t\t(process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) ||\n\t\t\tprocess.env.AWS_BEARER_TOKEN_BEDROCK ||\n\t\t\tprocess.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ||\n\t\t\tprocess.env.AWS_CONTAINER_CREDENTIALS_FULL_URI ||\n\t\t\tprocess.env.AWS_WEB_IDENTITY_TOKEN_FILE\n\t\t) {\n\t\t\treturn \"<authenticated>\";\n\t\t}\n\t}\n\n\tconst envMap: Record<string, string> = {\n\t\topenai: \"OPENAI_API_KEY\",\n\t\t\"azure-openai-responses\": \"AZURE_OPENAI_API_KEY\",\n\t\tgoogle: \"GEMINI_API_KEY\",\n\t\tgroq: \"GROQ_API_KEY\",\n\t\tcerebras: \"CEREBRAS_API_KEY\",\n\t\txai: \"XAI_API_KEY\",\n\t\topenrouter: \"OPENROUTER_API_KEY\",\n\t\t\"vercel-ai-gateway\": \"AI_GATEWAY_API_KEY\",\n\t\tzai: \"ZAI_API_KEY\",\n\t\tmistral: \"MISTRAL_API_KEY\",\n\t\tminimax: \"MINIMAX_API_KEY\",\n\t\t\"minimax-cn\": \"MINIMAX_CN_API_KEY\",\n\t\topencode: \"OPENCODE_API_KEY\",\n\t};\n\n\tconst envVar = envMap[provider];\n\treturn envVar ? process.env[envVar] : undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"env-api-keys.d.ts","sourceRoot":"","sources":["../src/env-api-keys.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA0BhD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAC1E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC","sourcesContent":["// NEVER convert to top-level imports - breaks browser/Vite builds (web-ui)\nlet _existsSync: typeof import(\"node:fs\").existsSync | null = null;\nlet _homedir: typeof import(\"node:os\").homedir | null = null;\nlet _join: typeof import(\"node:path\").join | null = null;\n\n// Eagerly load in Node.js/Bun environment only\nif (typeof process !== \"undefined\" && (process.versions?.node || process.versions?.bun)) {\n\timport(\"node:fs\").then((m) => {\n\t\t_existsSync = m.existsSync;\n\t});\n\timport(\"node:os\").then((m) => {\n\t\t_homedir = m.homedir;\n\t});\n\timport(\"node:path\").then((m) => {\n\t\t_join = m.join;\n\t});\n}\n\nimport type { KnownProvider } from \"./types.js\";\n\nlet cachedVertexAdcCredentialsExists: boolean | null = null;\n\nfunction hasVertexAdcCredentials(): boolean {\n\tif (cachedVertexAdcCredentialsExists === null) {\n\t\t// In browser or if node modules not loaded yet, return false\n\t\tif (!_existsSync || !_homedir || !_join) {\n\t\t\tcachedVertexAdcCredentialsExists = false;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check GOOGLE_APPLICATION_CREDENTIALS env var first (standard way)\n\t\tconst gacPath = process.env.GOOGLE_APPLICATION_CREDENTIALS;\n\t\tif (gacPath) {\n\t\t\tcachedVertexAdcCredentialsExists = _existsSync(gacPath);\n\t\t} else {\n\t\t\t// Fall back to default ADC path (lazy evaluation)\n\t\t\tcachedVertexAdcCredentialsExists = _existsSync(\n\t\t\t\t_join(_homedir(), \".config\", \"gcloud\", \"application_default_credentials.json\"),\n\t\t\t);\n\t\t}\n\t}\n\treturn cachedVertexAdcCredentialsExists;\n}\n\n/**\n * Get API key for provider from known environment variables, e.g. OPENAI_API_KEY.\n *\n * Will not return API keys for providers that require OAuth tokens.\n */\nexport function getEnvApiKey(provider: KnownProvider): string | undefined;\nexport function getEnvApiKey(provider: string): string | undefined;\nexport function getEnvApiKey(provider: any): string | undefined {\n\t// Fall back to environment variables\n\tif (provider === \"github-copilot\") {\n\t\treturn process.env.COPILOT_GITHUB_TOKEN || process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\n\t}\n\n\t// ANTHROPIC_OAUTH_TOKEN takes precedence over ANTHROPIC_API_KEY\n\tif (provider === \"anthropic\") {\n\t\treturn process.env.ANTHROPIC_OAUTH_TOKEN || process.env.ANTHROPIC_API_KEY;\n\t}\n\n\t// Vertex AI uses Application Default Credentials, not API keys.\n\t// Auth is configured via `gcloud auth application-default login`.\n\tif (provider === \"google-vertex\") {\n\t\tconst hasCredentials = hasVertexAdcCredentials();\n\t\tconst hasProject = !!(process.env.GOOGLE_CLOUD_PROJECT || process.env.GCLOUD_PROJECT);\n\t\tconst hasLocation = !!process.env.GOOGLE_CLOUD_LOCATION;\n\n\t\tif (hasCredentials && hasProject && hasLocation) {\n\t\t\treturn \"<authenticated>\";\n\t\t}\n\t}\n\n\tif (provider === \"amazon-bedrock\") {\n\t\t// Amazon Bedrock supports multiple credential sources:\n\t\t// 1. AWS_PROFILE - named profile from ~/.aws/credentials\n\t\t// 2. AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY - standard IAM keys\n\t\t// 3. AWS_BEARER_TOKEN_BEDROCK - Bedrock API keys (bearer token)\n\t\t// 4. AWS_CONTAINER_CREDENTIALS_RELATIVE_URI - ECS task roles\n\t\t// 5. AWS_CONTAINER_CREDENTIALS_FULL_URI - ECS task roles (full URI)\n\t\t// 6. AWS_WEB_IDENTITY_TOKEN_FILE - IRSA (IAM Roles for Service Accounts)\n\t\tif (\n\t\t\tprocess.env.AWS_PROFILE ||\n\t\t\t(process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) ||\n\t\t\tprocess.env.AWS_BEARER_TOKEN_BEDROCK ||\n\t\t\tprocess.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ||\n\t\t\tprocess.env.AWS_CONTAINER_CREDENTIALS_FULL_URI ||\n\t\t\tprocess.env.AWS_WEB_IDENTITY_TOKEN_FILE\n\t\t) {\n\t\t\treturn \"<authenticated>\";\n\t\t}\n\t}\n\n\tconst envMap: Record<string, string> = {\n\t\topenai: \"OPENAI_API_KEY\",\n\t\t\"azure-openai-responses\": \"AZURE_OPENAI_API_KEY\",\n\t\tgoogle: \"GEMINI_API_KEY\",\n\t\tgroq: \"GROQ_API_KEY\",\n\t\tcerebras: \"CEREBRAS_API_KEY\",\n\t\txai: \"XAI_API_KEY\",\n\t\topenrouter: \"OPENROUTER_API_KEY\",\n\t\t\"vercel-ai-gateway\": \"AI_GATEWAY_API_KEY\",\n\t\tzai: \"ZAI_API_KEY\",\n\t\tmistral: \"MISTRAL_API_KEY\",\n\t\tminimax: \"MINIMAX_API_KEY\",\n\t\t\"minimax-cn\": \"MINIMAX_CN_API_KEY\",\n\t\thuggingface: \"HF_TOKEN\",\n\t\topencode: \"OPENCODE_API_KEY\",\n\t\t\"kimi-coding\": \"KIMI_API_KEY\",\n\t};\n\n\tconst envVar = envMap[provider];\n\treturn envVar ? process.env[envVar] : undefined;\n}\n"]}
|
package/dist/env-api-keys.js
CHANGED
|
@@ -83,7 +83,9 @@ export function getEnvApiKey(provider) {
|
|
|
83
83
|
mistral: "MISTRAL_API_KEY",
|
|
84
84
|
minimax: "MINIMAX_API_KEY",
|
|
85
85
|
"minimax-cn": "MINIMAX_CN_API_KEY",
|
|
86
|
+
huggingface: "HF_TOKEN",
|
|
86
87
|
opencode: "OPENCODE_API_KEY",
|
|
88
|
+
"kimi-coding": "KIMI_API_KEY",
|
|
87
89
|
};
|
|
88
90
|
const envVar = envMap[provider];
|
|
89
91
|
return envVar ? process.env[envVar] : undefined;
|
package/dist/env-api-keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-api-keys.js","sourceRoot":"","sources":["../src/env-api-keys.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,IAAI,WAAW,GAA+C,IAAI,CAAC;AACnE,IAAI,QAAQ,GAA4C,IAAI,CAAC;AAC7D,IAAI,KAAK,GAA2C,IAAI,CAAC;AAEzD,+CAA+C;AAC/C,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;IACzF,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,WAAW,GAAG,CAAC,CAAC,UAAU,CAAC;IAAA,CAC3B,CAAC,CAAC;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC;IAAA,CACrB,CAAC,CAAC;IACH,MAAM,CAAC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AC,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;YACpE,OAAO,CAAC,GAAG,CAAC,wBAAwB;YACpC,OAAO,CAAC,GAAG,CAAC,sCAAsC;YAClD,OAAO,CAAC,GAAG,CAAC,kCAAkC;YAC9C,OAAO,CAAC,GAAG,CAAC,2BAA2B,EACtC,CAAC;YACF,OAAO,iBAAiB,CAAC;QAC1B,CAAC;IACF,CAAC;IAED,MAAM,MAAM,GAA2B;QACtC,MAAM,EAAE,gBAAgB;QACxB,wBAAwB,EAAE,sBAAsB;QAChD,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,kBAAkB;QAC5B,GAAG,EAAE,aAAa;QAClB,UAAU,EAAE,oBAAoB;QAChC,mBAAmB,EAAE,oBAAoB;QACzC,GAAG,EAAE,aAAa;QAClB,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,iBAAiB;QAC1B,YAAY,EAAE,oBAAoB;QAClC,WAAW,EAAE,UAAU;QACvB,QAAQ,EAAE,kBAAkB;QAC5B,aAAa,EAAE,cAAc;KAC7B,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAAA,CAChD","sourcesContent":["// NEVER convert to top-level imports - breaks browser/Vite builds (web-ui)\nlet _existsSync: typeof import(\"node:fs\").existsSync | null = null;\nlet _homedir: typeof import(\"node:os\").homedir | null = null;\nlet _join: typeof import(\"node:path\").join | null = null;\n\n// Eagerly load in Node.js/Bun environment only\nif (typeof process !== \"undefined\" && (process.versions?.node || process.versions?.bun)) {\n\timport(\"node:fs\").then((m) => {\n\t\t_existsSync = m.existsSync;\n\t});\n\timport(\"node:os\").then((m) => {\n\t\t_homedir = m.homedir;\n\t});\n\timport(\"node:path\").then((m) => {\n\t\t_join = m.join;\n\t});\n}\n\nimport type { KnownProvider } from \"./types.js\";\n\nlet cachedVertexAdcCredentialsExists: boolean | null = null;\n\nfunction hasVertexAdcCredentials(): boolean {\n\tif (cachedVertexAdcCredentialsExists === null) {\n\t\t// In browser or if node modules not loaded yet, return false\n\t\tif (!_existsSync || !_homedir || !_join) {\n\t\t\tcachedVertexAdcCredentialsExists = false;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check GOOGLE_APPLICATION_CREDENTIALS env var first (standard way)\n\t\tconst gacPath = process.env.GOOGLE_APPLICATION_CREDENTIALS;\n\t\tif (gacPath) {\n\t\t\tcachedVertexAdcCredentialsExists = _existsSync(gacPath);\n\t\t} else {\n\t\t\t// Fall back to default ADC path (lazy evaluation)\n\t\t\tcachedVertexAdcCredentialsExists = _existsSync(\n\t\t\t\t_join(_homedir(), \".config\", \"gcloud\", \"application_default_credentials.json\"),\n\t\t\t);\n\t\t}\n\t}\n\treturn cachedVertexAdcCredentialsExists;\n}\n\n/**\n * Get API key for provider from known environment variables, e.g. OPENAI_API_KEY.\n *\n * Will not return API keys for providers that require OAuth tokens.\n */\nexport function getEnvApiKey(provider: KnownProvider): string | undefined;\nexport function getEnvApiKey(provider: string): string | undefined;\nexport function getEnvApiKey(provider: any): string | undefined {\n\t// Fall back to environment variables\n\tif (provider === \"github-copilot\") {\n\t\treturn process.env.COPILOT_GITHUB_TOKEN || process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\n\t}\n\n\t// ANTHROPIC_OAUTH_TOKEN takes precedence over ANTHROPIC_API_KEY\n\tif (provider === \"anthropic\") {\n\t\treturn process.env.ANTHROPIC_OAUTH_TOKEN || process.env.ANTHROPIC_API_KEY;\n\t}\n\n\t// Vertex AI uses Application Default Credentials, not API keys.\n\t// Auth is configured via `gcloud auth application-default login`.\n\tif (provider === \"google-vertex\") {\n\t\tconst hasCredentials = hasVertexAdcCredentials();\n\t\tconst hasProject = !!(process.env.GOOGLE_CLOUD_PROJECT || process.env.GCLOUD_PROJECT);\n\t\tconst hasLocation = !!process.env.GOOGLE_CLOUD_LOCATION;\n\n\t\tif (hasCredentials && hasProject && hasLocation) {\n\t\t\treturn \"<authenticated>\";\n\t\t}\n\t}\n\n\tif (provider === \"amazon-bedrock\") {\n\t\t// Amazon Bedrock supports multiple credential sources:\n\t\t// 1. AWS_PROFILE - named profile from ~/.aws/credentials\n\t\t// 2. AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY - standard IAM keys\n\t\t// 3. AWS_BEARER_TOKEN_BEDROCK - Bedrock API keys (bearer token)\n\t\t// 4. AWS_CONTAINER_CREDENTIALS_RELATIVE_URI - ECS task roles\n\t\t// 5. AWS_CONTAINER_CREDENTIALS_FULL_URI - ECS task roles (full URI)\n\t\t// 6. AWS_WEB_IDENTITY_TOKEN_FILE - IRSA (IAM Roles for Service Accounts)\n\t\tif (\n\t\t\tprocess.env.AWS_PROFILE ||\n\t\t\t(process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) ||\n\t\t\tprocess.env.AWS_BEARER_TOKEN_BEDROCK ||\n\t\t\tprocess.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ||\n\t\t\tprocess.env.AWS_CONTAINER_CREDENTIALS_FULL_URI ||\n\t\t\tprocess.env.AWS_WEB_IDENTITY_TOKEN_FILE\n\t\t) {\n\t\t\treturn \"<authenticated>\";\n\t\t}\n\t}\n\n\tconst envMap: Record<string, string> = {\n\t\topenai: \"OPENAI_API_KEY\",\n\t\t\"azure-openai-responses\": \"AZURE_OPENAI_API_KEY\",\n\t\tgoogle: \"GEMINI_API_KEY\",\n\t\tgroq: \"GROQ_API_KEY\",\n\t\tcerebras: \"CEREBRAS_API_KEY\",\n\t\txai: \"XAI_API_KEY\",\n\t\topenrouter: \"OPENROUTER_API_KEY\",\n\t\t\"vercel-ai-gateway\": \"AI_GATEWAY_API_KEY\",\n\t\tzai: \"ZAI_API_KEY\",\n\t\tmistral: \"MISTRAL_API_KEY\",\n\t\tminimax: \"MINIMAX_API_KEY\",\n\t\t\"minimax-cn\": \"MINIMAX_CN_API_KEY\",\n\t\thuggingface: \"HF_TOKEN\",\n\t\topencode: \"OPENCODE_API_KEY\",\n\t\t\"kimi-coding\": \"KIMI_API_KEY\",\n\t};\n\n\tconst envVar = envMap[provider];\n\treturn envVar ? process.env[envVar] : undefined;\n}\n"]}
|
|
@@ -3407,6 +3407,324 @@ export declare const MODELS: {
|
|
|
3407
3407
|
maxTokens: number;
|
|
3408
3408
|
};
|
|
3409
3409
|
};
|
|
3410
|
+
readonly huggingface: {
|
|
3411
|
+
readonly "MiniMaxAI/MiniMax-M2.1": {
|
|
3412
|
+
id: string;
|
|
3413
|
+
name: string;
|
|
3414
|
+
api: "openai-completions";
|
|
3415
|
+
provider: string;
|
|
3416
|
+
baseUrl: string;
|
|
3417
|
+
compat: {
|
|
3418
|
+
supportsDeveloperRole: false;
|
|
3419
|
+
};
|
|
3420
|
+
reasoning: true;
|
|
3421
|
+
input: "text"[];
|
|
3422
|
+
cost: {
|
|
3423
|
+
input: number;
|
|
3424
|
+
output: number;
|
|
3425
|
+
cacheRead: number;
|
|
3426
|
+
cacheWrite: number;
|
|
3427
|
+
};
|
|
3428
|
+
contextWindow: number;
|
|
3429
|
+
maxTokens: number;
|
|
3430
|
+
};
|
|
3431
|
+
readonly "Qwen/Qwen3-235B-A22B-Thinking-2507": {
|
|
3432
|
+
id: string;
|
|
3433
|
+
name: string;
|
|
3434
|
+
api: "openai-completions";
|
|
3435
|
+
provider: string;
|
|
3436
|
+
baseUrl: string;
|
|
3437
|
+
compat: {
|
|
3438
|
+
supportsDeveloperRole: false;
|
|
3439
|
+
};
|
|
3440
|
+
reasoning: true;
|
|
3441
|
+
input: "text"[];
|
|
3442
|
+
cost: {
|
|
3443
|
+
input: number;
|
|
3444
|
+
output: number;
|
|
3445
|
+
cacheRead: number;
|
|
3446
|
+
cacheWrite: number;
|
|
3447
|
+
};
|
|
3448
|
+
contextWindow: number;
|
|
3449
|
+
maxTokens: number;
|
|
3450
|
+
};
|
|
3451
|
+
readonly "Qwen/Qwen3-Coder-480B-A35B-Instruct": {
|
|
3452
|
+
id: string;
|
|
3453
|
+
name: string;
|
|
3454
|
+
api: "openai-completions";
|
|
3455
|
+
provider: string;
|
|
3456
|
+
baseUrl: string;
|
|
3457
|
+
compat: {
|
|
3458
|
+
supportsDeveloperRole: false;
|
|
3459
|
+
};
|
|
3460
|
+
reasoning: false;
|
|
3461
|
+
input: "text"[];
|
|
3462
|
+
cost: {
|
|
3463
|
+
input: number;
|
|
3464
|
+
output: number;
|
|
3465
|
+
cacheRead: number;
|
|
3466
|
+
cacheWrite: number;
|
|
3467
|
+
};
|
|
3468
|
+
contextWindow: number;
|
|
3469
|
+
maxTokens: number;
|
|
3470
|
+
};
|
|
3471
|
+
readonly "Qwen/Qwen3-Next-80B-A3B-Instruct": {
|
|
3472
|
+
id: string;
|
|
3473
|
+
name: string;
|
|
3474
|
+
api: "openai-completions";
|
|
3475
|
+
provider: string;
|
|
3476
|
+
baseUrl: string;
|
|
3477
|
+
compat: {
|
|
3478
|
+
supportsDeveloperRole: false;
|
|
3479
|
+
};
|
|
3480
|
+
reasoning: false;
|
|
3481
|
+
input: "text"[];
|
|
3482
|
+
cost: {
|
|
3483
|
+
input: number;
|
|
3484
|
+
output: number;
|
|
3485
|
+
cacheRead: number;
|
|
3486
|
+
cacheWrite: number;
|
|
3487
|
+
};
|
|
3488
|
+
contextWindow: number;
|
|
3489
|
+
maxTokens: number;
|
|
3490
|
+
};
|
|
3491
|
+
readonly "Qwen/Qwen3-Next-80B-A3B-Thinking": {
|
|
3492
|
+
id: string;
|
|
3493
|
+
name: string;
|
|
3494
|
+
api: "openai-completions";
|
|
3495
|
+
provider: string;
|
|
3496
|
+
baseUrl: string;
|
|
3497
|
+
compat: {
|
|
3498
|
+
supportsDeveloperRole: false;
|
|
3499
|
+
};
|
|
3500
|
+
reasoning: false;
|
|
3501
|
+
input: "text"[];
|
|
3502
|
+
cost: {
|
|
3503
|
+
input: number;
|
|
3504
|
+
output: number;
|
|
3505
|
+
cacheRead: number;
|
|
3506
|
+
cacheWrite: number;
|
|
3507
|
+
};
|
|
3508
|
+
contextWindow: number;
|
|
3509
|
+
maxTokens: number;
|
|
3510
|
+
};
|
|
3511
|
+
readonly "XiaomiMiMo/MiMo-V2-Flash": {
|
|
3512
|
+
id: string;
|
|
3513
|
+
name: string;
|
|
3514
|
+
api: "openai-completions";
|
|
3515
|
+
provider: string;
|
|
3516
|
+
baseUrl: string;
|
|
3517
|
+
compat: {
|
|
3518
|
+
supportsDeveloperRole: false;
|
|
3519
|
+
};
|
|
3520
|
+
reasoning: true;
|
|
3521
|
+
input: "text"[];
|
|
3522
|
+
cost: {
|
|
3523
|
+
input: number;
|
|
3524
|
+
output: number;
|
|
3525
|
+
cacheRead: number;
|
|
3526
|
+
cacheWrite: number;
|
|
3527
|
+
};
|
|
3528
|
+
contextWindow: number;
|
|
3529
|
+
maxTokens: number;
|
|
3530
|
+
};
|
|
3531
|
+
readonly "deepseek-ai/DeepSeek-R1-0528": {
|
|
3532
|
+
id: string;
|
|
3533
|
+
name: string;
|
|
3534
|
+
api: "openai-completions";
|
|
3535
|
+
provider: string;
|
|
3536
|
+
baseUrl: string;
|
|
3537
|
+
compat: {
|
|
3538
|
+
supportsDeveloperRole: false;
|
|
3539
|
+
};
|
|
3540
|
+
reasoning: true;
|
|
3541
|
+
input: "text"[];
|
|
3542
|
+
cost: {
|
|
3543
|
+
input: number;
|
|
3544
|
+
output: number;
|
|
3545
|
+
cacheRead: number;
|
|
3546
|
+
cacheWrite: number;
|
|
3547
|
+
};
|
|
3548
|
+
contextWindow: number;
|
|
3549
|
+
maxTokens: number;
|
|
3550
|
+
};
|
|
3551
|
+
readonly "deepseek-ai/DeepSeek-V3.2": {
|
|
3552
|
+
id: string;
|
|
3553
|
+
name: string;
|
|
3554
|
+
api: "openai-completions";
|
|
3555
|
+
provider: string;
|
|
3556
|
+
baseUrl: string;
|
|
3557
|
+
compat: {
|
|
3558
|
+
supportsDeveloperRole: false;
|
|
3559
|
+
};
|
|
3560
|
+
reasoning: true;
|
|
3561
|
+
input: "text"[];
|
|
3562
|
+
cost: {
|
|
3563
|
+
input: number;
|
|
3564
|
+
output: number;
|
|
3565
|
+
cacheRead: number;
|
|
3566
|
+
cacheWrite: number;
|
|
3567
|
+
};
|
|
3568
|
+
contextWindow: number;
|
|
3569
|
+
maxTokens: number;
|
|
3570
|
+
};
|
|
3571
|
+
readonly "moonshotai/Kimi-K2-Instruct": {
|
|
3572
|
+
id: string;
|
|
3573
|
+
name: string;
|
|
3574
|
+
api: "openai-completions";
|
|
3575
|
+
provider: string;
|
|
3576
|
+
baseUrl: string;
|
|
3577
|
+
compat: {
|
|
3578
|
+
supportsDeveloperRole: false;
|
|
3579
|
+
};
|
|
3580
|
+
reasoning: false;
|
|
3581
|
+
input: "text"[];
|
|
3582
|
+
cost: {
|
|
3583
|
+
input: number;
|
|
3584
|
+
output: number;
|
|
3585
|
+
cacheRead: number;
|
|
3586
|
+
cacheWrite: number;
|
|
3587
|
+
};
|
|
3588
|
+
contextWindow: number;
|
|
3589
|
+
maxTokens: number;
|
|
3590
|
+
};
|
|
3591
|
+
readonly "moonshotai/Kimi-K2-Instruct-0905": {
|
|
3592
|
+
id: string;
|
|
3593
|
+
name: string;
|
|
3594
|
+
api: "openai-completions";
|
|
3595
|
+
provider: string;
|
|
3596
|
+
baseUrl: string;
|
|
3597
|
+
compat: {
|
|
3598
|
+
supportsDeveloperRole: false;
|
|
3599
|
+
};
|
|
3600
|
+
reasoning: false;
|
|
3601
|
+
input: "text"[];
|
|
3602
|
+
cost: {
|
|
3603
|
+
input: number;
|
|
3604
|
+
output: number;
|
|
3605
|
+
cacheRead: number;
|
|
3606
|
+
cacheWrite: number;
|
|
3607
|
+
};
|
|
3608
|
+
contextWindow: number;
|
|
3609
|
+
maxTokens: number;
|
|
3610
|
+
};
|
|
3611
|
+
readonly "moonshotai/Kimi-K2-Thinking": {
|
|
3612
|
+
id: string;
|
|
3613
|
+
name: string;
|
|
3614
|
+
api: "openai-completions";
|
|
3615
|
+
provider: string;
|
|
3616
|
+
baseUrl: string;
|
|
3617
|
+
compat: {
|
|
3618
|
+
supportsDeveloperRole: false;
|
|
3619
|
+
};
|
|
3620
|
+
reasoning: true;
|
|
3621
|
+
input: "text"[];
|
|
3622
|
+
cost: {
|
|
3623
|
+
input: number;
|
|
3624
|
+
output: number;
|
|
3625
|
+
cacheRead: number;
|
|
3626
|
+
cacheWrite: number;
|
|
3627
|
+
};
|
|
3628
|
+
contextWindow: number;
|
|
3629
|
+
maxTokens: number;
|
|
3630
|
+
};
|
|
3631
|
+
readonly "moonshotai/Kimi-K2.5": {
|
|
3632
|
+
id: string;
|
|
3633
|
+
name: string;
|
|
3634
|
+
api: "openai-completions";
|
|
3635
|
+
provider: string;
|
|
3636
|
+
baseUrl: string;
|
|
3637
|
+
compat: {
|
|
3638
|
+
supportsDeveloperRole: false;
|
|
3639
|
+
};
|
|
3640
|
+
reasoning: true;
|
|
3641
|
+
input: ("image" | "text")[];
|
|
3642
|
+
cost: {
|
|
3643
|
+
input: number;
|
|
3644
|
+
output: number;
|
|
3645
|
+
cacheRead: number;
|
|
3646
|
+
cacheWrite: number;
|
|
3647
|
+
};
|
|
3648
|
+
contextWindow: number;
|
|
3649
|
+
maxTokens: number;
|
|
3650
|
+
};
|
|
3651
|
+
readonly "zai-org/GLM-4.7": {
|
|
3652
|
+
id: string;
|
|
3653
|
+
name: string;
|
|
3654
|
+
api: "openai-completions";
|
|
3655
|
+
provider: string;
|
|
3656
|
+
baseUrl: string;
|
|
3657
|
+
compat: {
|
|
3658
|
+
supportsDeveloperRole: false;
|
|
3659
|
+
};
|
|
3660
|
+
reasoning: true;
|
|
3661
|
+
input: "text"[];
|
|
3662
|
+
cost: {
|
|
3663
|
+
input: number;
|
|
3664
|
+
output: number;
|
|
3665
|
+
cacheRead: number;
|
|
3666
|
+
cacheWrite: number;
|
|
3667
|
+
};
|
|
3668
|
+
contextWindow: number;
|
|
3669
|
+
maxTokens: number;
|
|
3670
|
+
};
|
|
3671
|
+
readonly "zai-org/GLM-4.7-Flash": {
|
|
3672
|
+
id: string;
|
|
3673
|
+
name: string;
|
|
3674
|
+
api: "openai-completions";
|
|
3675
|
+
provider: string;
|
|
3676
|
+
baseUrl: string;
|
|
3677
|
+
compat: {
|
|
3678
|
+
supportsDeveloperRole: false;
|
|
3679
|
+
};
|
|
3680
|
+
reasoning: true;
|
|
3681
|
+
input: "text"[];
|
|
3682
|
+
cost: {
|
|
3683
|
+
input: number;
|
|
3684
|
+
output: number;
|
|
3685
|
+
cacheRead: number;
|
|
3686
|
+
cacheWrite: number;
|
|
3687
|
+
};
|
|
3688
|
+
contextWindow: number;
|
|
3689
|
+
maxTokens: number;
|
|
3690
|
+
};
|
|
3691
|
+
};
|
|
3692
|
+
readonly "kimi-coding": {
|
|
3693
|
+
readonly k2p5: {
|
|
3694
|
+
id: string;
|
|
3695
|
+
name: string;
|
|
3696
|
+
api: "anthropic-messages";
|
|
3697
|
+
provider: string;
|
|
3698
|
+
baseUrl: string;
|
|
3699
|
+
reasoning: true;
|
|
3700
|
+
input: ("image" | "text")[];
|
|
3701
|
+
cost: {
|
|
3702
|
+
input: number;
|
|
3703
|
+
output: number;
|
|
3704
|
+
cacheRead: number;
|
|
3705
|
+
cacheWrite: number;
|
|
3706
|
+
};
|
|
3707
|
+
contextWindow: number;
|
|
3708
|
+
maxTokens: number;
|
|
3709
|
+
};
|
|
3710
|
+
readonly "kimi-k2-thinking": {
|
|
3711
|
+
id: string;
|
|
3712
|
+
name: string;
|
|
3713
|
+
api: "anthropic-messages";
|
|
3714
|
+
provider: string;
|
|
3715
|
+
baseUrl: string;
|
|
3716
|
+
reasoning: true;
|
|
3717
|
+
input: "text"[];
|
|
3718
|
+
cost: {
|
|
3719
|
+
input: number;
|
|
3720
|
+
output: number;
|
|
3721
|
+
cacheRead: number;
|
|
3722
|
+
cacheWrite: number;
|
|
3723
|
+
};
|
|
3724
|
+
contextWindow: number;
|
|
3725
|
+
maxTokens: number;
|
|
3726
|
+
};
|
|
3727
|
+
};
|
|
3410
3728
|
readonly minimax: {
|
|
3411
3729
|
readonly "MiniMax-M2": {
|
|
3412
3730
|
id: string;
|
|
@@ -4948,6 +5266,40 @@ export declare const MODELS: {
|
|
|
4948
5266
|
contextWindow: number;
|
|
4949
5267
|
maxTokens: number;
|
|
4950
5268
|
};
|
|
5269
|
+
readonly "kimi-k2.5": {
|
|
5270
|
+
id: string;
|
|
5271
|
+
name: string;
|
|
5272
|
+
api: "openai-completions";
|
|
5273
|
+
provider: string;
|
|
5274
|
+
baseUrl: string;
|
|
5275
|
+
reasoning: true;
|
|
5276
|
+
input: ("image" | "text")[];
|
|
5277
|
+
cost: {
|
|
5278
|
+
input: number;
|
|
5279
|
+
output: number;
|
|
5280
|
+
cacheRead: number;
|
|
5281
|
+
cacheWrite: number;
|
|
5282
|
+
};
|
|
5283
|
+
contextWindow: number;
|
|
5284
|
+
maxTokens: number;
|
|
5285
|
+
};
|
|
5286
|
+
readonly "minimax-m2.1": {
|
|
5287
|
+
id: string;
|
|
5288
|
+
name: string;
|
|
5289
|
+
api: "openai-completions";
|
|
5290
|
+
provider: string;
|
|
5291
|
+
baseUrl: string;
|
|
5292
|
+
reasoning: true;
|
|
5293
|
+
input: "text"[];
|
|
5294
|
+
cost: {
|
|
5295
|
+
input: number;
|
|
5296
|
+
output: number;
|
|
5297
|
+
cacheRead: number;
|
|
5298
|
+
cacheWrite: number;
|
|
5299
|
+
};
|
|
5300
|
+
contextWindow: number;
|
|
5301
|
+
maxTokens: number;
|
|
5302
|
+
};
|
|
4951
5303
|
readonly "qwen3-coder": {
|
|
4952
5304
|
id: string;
|
|
4953
5305
|
name: string;
|
|
@@ -5307,6 +5659,23 @@ export declare const MODELS: {
|
|
|
5307
5659
|
contextWindow: number;
|
|
5308
5660
|
maxTokens: number;
|
|
5309
5661
|
};
|
|
5662
|
+
readonly "arcee-ai/trinity-large-preview:free": {
|
|
5663
|
+
id: string;
|
|
5664
|
+
name: string;
|
|
5665
|
+
api: "openai-completions";
|
|
5666
|
+
provider: string;
|
|
5667
|
+
baseUrl: string;
|
|
5668
|
+
reasoning: false;
|
|
5669
|
+
input: "text"[];
|
|
5670
|
+
cost: {
|
|
5671
|
+
input: number;
|
|
5672
|
+
output: number;
|
|
5673
|
+
cacheRead: number;
|
|
5674
|
+
cacheWrite: number;
|
|
5675
|
+
};
|
|
5676
|
+
contextWindow: number;
|
|
5677
|
+
maxTokens: number;
|
|
5678
|
+
};
|
|
5310
5679
|
readonly "arcee-ai/trinity-mini": {
|
|
5311
5680
|
id: string;
|
|
5312
5681
|
name: string;
|
|
@@ -6191,23 +6560,6 @@ export declare const MODELS: {
|
|
|
6191
6560
|
contextWindow: number;
|
|
6192
6561
|
maxTokens: number;
|
|
6193
6562
|
};
|
|
6194
|
-
readonly "mistralai/devstral-2512:free": {
|
|
6195
|
-
id: string;
|
|
6196
|
-
name: string;
|
|
6197
|
-
api: "openai-completions";
|
|
6198
|
-
provider: string;
|
|
6199
|
-
baseUrl: string;
|
|
6200
|
-
reasoning: false;
|
|
6201
|
-
input: "text"[];
|
|
6202
|
-
cost: {
|
|
6203
|
-
input: number;
|
|
6204
|
-
output: number;
|
|
6205
|
-
cacheRead: number;
|
|
6206
|
-
cacheWrite: number;
|
|
6207
|
-
};
|
|
6208
|
-
contextWindow: number;
|
|
6209
|
-
maxTokens: number;
|
|
6210
|
-
};
|
|
6211
6563
|
readonly "mistralai/devstral-medium": {
|
|
6212
6564
|
id: string;
|
|
6213
6565
|
name: string;
|
|
@@ -6718,6 +7070,23 @@ export declare const MODELS: {
|
|
|
6718
7070
|
contextWindow: number;
|
|
6719
7071
|
maxTokens: number;
|
|
6720
7072
|
};
|
|
7073
|
+
readonly "moonshotai/kimi-k2.5": {
|
|
7074
|
+
id: string;
|
|
7075
|
+
name: string;
|
|
7076
|
+
api: "openai-completions";
|
|
7077
|
+
provider: string;
|
|
7078
|
+
baseUrl: string;
|
|
7079
|
+
reasoning: true;
|
|
7080
|
+
input: ("image" | "text")[];
|
|
7081
|
+
cost: {
|
|
7082
|
+
input: number;
|
|
7083
|
+
output: number;
|
|
7084
|
+
cacheRead: number;
|
|
7085
|
+
cacheWrite: number;
|
|
7086
|
+
};
|
|
7087
|
+
contextWindow: number;
|
|
7088
|
+
maxTokens: number;
|
|
7089
|
+
};
|
|
6721
7090
|
readonly "nex-agi/deepseek-v3.1-nex-n1": {
|
|
6722
7091
|
id: string;
|
|
6723
7092
|
name: string;
|
|
@@ -8520,6 +8889,23 @@ export declare const MODELS: {
|
|
|
8520
8889
|
contextWindow: number;
|
|
8521
8890
|
maxTokens: number;
|
|
8522
8891
|
};
|
|
8892
|
+
readonly "upstage/solar-pro-3:free": {
|
|
8893
|
+
id: string;
|
|
8894
|
+
name: string;
|
|
8895
|
+
api: "openai-completions";
|
|
8896
|
+
provider: string;
|
|
8897
|
+
baseUrl: string;
|
|
8898
|
+
reasoning: true;
|
|
8899
|
+
input: "text"[];
|
|
8900
|
+
cost: {
|
|
8901
|
+
input: number;
|
|
8902
|
+
output: number;
|
|
8903
|
+
cacheRead: number;
|
|
8904
|
+
cacheWrite: number;
|
|
8905
|
+
};
|
|
8906
|
+
contextWindow: number;
|
|
8907
|
+
maxTokens: number;
|
|
8908
|
+
};
|
|
8523
8909
|
readonly "x-ai/grok-3": {
|
|
8524
8910
|
id: string;
|
|
8525
8911
|
name: string;
|
|
@@ -9015,6 +9401,23 @@ export declare const MODELS: {
|
|
|
9015
9401
|
contextWindow: number;
|
|
9016
9402
|
maxTokens: number;
|
|
9017
9403
|
};
|
|
9404
|
+
readonly "alibaba/qwen3-max-thinking": {
|
|
9405
|
+
id: string;
|
|
9406
|
+
name: string;
|
|
9407
|
+
api: "anthropic-messages";
|
|
9408
|
+
provider: string;
|
|
9409
|
+
baseUrl: string;
|
|
9410
|
+
reasoning: true;
|
|
9411
|
+
input: "text"[];
|
|
9412
|
+
cost: {
|
|
9413
|
+
input: number;
|
|
9414
|
+
output: number;
|
|
9415
|
+
cacheRead: number;
|
|
9416
|
+
cacheWrite: number;
|
|
9417
|
+
};
|
|
9418
|
+
contextWindow: number;
|
|
9419
|
+
maxTokens: number;
|
|
9420
|
+
};
|
|
9018
9421
|
readonly "anthropic/claude-3-haiku": {
|
|
9019
9422
|
id: string;
|
|
9020
9423
|
name: string;
|
|
@@ -9202,6 +9605,23 @@ export declare const MODELS: {
|
|
|
9202
9605
|
contextWindow: number;
|
|
9203
9606
|
maxTokens: number;
|
|
9204
9607
|
};
|
|
9608
|
+
readonly "arcee-ai/trinity-large-preview": {
|
|
9609
|
+
id: string;
|
|
9610
|
+
name: string;
|
|
9611
|
+
api: "anthropic-messages";
|
|
9612
|
+
provider: string;
|
|
9613
|
+
baseUrl: string;
|
|
9614
|
+
reasoning: false;
|
|
9615
|
+
input: "text"[];
|
|
9616
|
+
cost: {
|
|
9617
|
+
input: number;
|
|
9618
|
+
output: number;
|
|
9619
|
+
cacheRead: number;
|
|
9620
|
+
cacheWrite: number;
|
|
9621
|
+
};
|
|
9622
|
+
contextWindow: number;
|
|
9623
|
+
maxTokens: number;
|
|
9624
|
+
};
|
|
9205
9625
|
readonly "bytedance/seed-1.6": {
|
|
9206
9626
|
id: string;
|
|
9207
9627
|
name: string;
|
|
@@ -9899,6 +10319,23 @@ export declare const MODELS: {
|
|
|
9899
10319
|
contextWindow: number;
|
|
9900
10320
|
maxTokens: number;
|
|
9901
10321
|
};
|
|
10322
|
+
readonly "moonshotai/kimi-k2.5": {
|
|
10323
|
+
id: string;
|
|
10324
|
+
name: string;
|
|
10325
|
+
api: "anthropic-messages";
|
|
10326
|
+
provider: string;
|
|
10327
|
+
baseUrl: string;
|
|
10328
|
+
reasoning: true;
|
|
10329
|
+
input: ("image" | "text")[];
|
|
10330
|
+
cost: {
|
|
10331
|
+
input: number;
|
|
10332
|
+
output: number;
|
|
10333
|
+
cacheRead: number;
|
|
10334
|
+
cacheWrite: number;
|
|
10335
|
+
};
|
|
10336
|
+
contextWindow: number;
|
|
10337
|
+
maxTokens: number;
|
|
10338
|
+
};
|
|
9902
10339
|
readonly "nvidia/nemotron-nano-12b-v2-vl": {
|
|
9903
10340
|
id: string;
|
|
9904
10341
|
name: string;
|
|
@@ -11444,6 +11881,27 @@ export declare const MODELS: {
|
|
|
11444
11881
|
contextWindow: number;
|
|
11445
11882
|
maxTokens: number;
|
|
11446
11883
|
};
|
|
11884
|
+
readonly "glm-4.7-flash": {
|
|
11885
|
+
id: string;
|
|
11886
|
+
name: string;
|
|
11887
|
+
api: "openai-completions";
|
|
11888
|
+
provider: string;
|
|
11889
|
+
baseUrl: string;
|
|
11890
|
+
compat: {
|
|
11891
|
+
supportsDeveloperRole: false;
|
|
11892
|
+
thinkingFormat: "zai";
|
|
11893
|
+
};
|
|
11894
|
+
reasoning: true;
|
|
11895
|
+
input: "text"[];
|
|
11896
|
+
cost: {
|
|
11897
|
+
input: number;
|
|
11898
|
+
output: number;
|
|
11899
|
+
cacheRead: number;
|
|
11900
|
+
cacheWrite: number;
|
|
11901
|
+
};
|
|
11902
|
+
contextWindow: number;
|
|
11903
|
+
maxTokens: number;
|
|
11904
|
+
};
|
|
11447
11905
|
};
|
|
11448
11906
|
};
|
|
11449
11907
|
//# sourceMappingURL=models.generated.d.ts.map
|