@mariozechner/pi-ai 0.50.0 → 0.50.2
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 +13 -0
- package/dist/env-api-keys.d.ts.map +1 -1
- package/dist/env-api-keys.js +1 -0
- package/dist/env-api-keys.js.map +1 -1
- package/dist/models.generated.d.ts +413 -42
- package/dist/models.generated.d.ts.map +1 -1
- package/dist/models.generated.js +406 -66
- 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 +2 -2
- package/dist/utils/overflow.d.ts.map +1 -1
- package/dist/utils/overflow.js +7 -7
- package/dist/utils/overflow.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -909,6 +909,19 @@ const response = await complete(model, context, {
|
|
|
909
909
|
});
|
|
910
910
|
```
|
|
911
911
|
|
|
912
|
+
#### Cache Retention
|
|
913
|
+
|
|
914
|
+
Set `PI_CACHE_RETENTION=long` to extend prompt cache retention:
|
|
915
|
+
|
|
916
|
+
| Provider | Default | With `PI_CACHE_RETENTION=long` |
|
|
917
|
+
|----------|---------|-------------------------------|
|
|
918
|
+
| Anthropic | 5 minutes | 1 hour |
|
|
919
|
+
| OpenAI | in-memory | 24 hours |
|
|
920
|
+
|
|
921
|
+
This only affects direct API calls to `api.anthropic.com` and `api.openai.com`. Proxies and other providers are unaffected.
|
|
922
|
+
|
|
923
|
+
> **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.
|
|
924
|
+
|
|
912
925
|
### Checking Environment Variables
|
|
913
926
|
|
|
914
927
|
```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};\n\n\tconst envVar = envMap[provider];\n\treturn envVar ? process.env[envVar] : undefined;\n}\n"]}
|
package/dist/env-api-keys.js
CHANGED
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,G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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,QAAQ,EAAE,kBAAkB;KAC5B,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\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.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,I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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;KAC5B,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};\n\n\tconst envVar = envMap[provider];\n\treturn envVar ? process.env[envVar] : undefined;\n}\n"]}
|
|
@@ -3407,6 +3407,288 @@ 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
|
+
};
|
|
3410
3692
|
readonly minimax: {
|
|
3411
3693
|
readonly "MiniMax-M2": {
|
|
3412
3694
|
id: string;
|
|
@@ -4761,23 +5043,6 @@ export declare const MODELS: {
|
|
|
4761
5043
|
contextWindow: number;
|
|
4762
5044
|
maxTokens: number;
|
|
4763
5045
|
};
|
|
4764
|
-
readonly "glm-4.7-free": {
|
|
4765
|
-
id: string;
|
|
4766
|
-
name: string;
|
|
4767
|
-
api: "openai-completions";
|
|
4768
|
-
provider: string;
|
|
4769
|
-
baseUrl: string;
|
|
4770
|
-
reasoning: true;
|
|
4771
|
-
input: "text"[];
|
|
4772
|
-
cost: {
|
|
4773
|
-
input: number;
|
|
4774
|
-
output: number;
|
|
4775
|
-
cacheRead: number;
|
|
4776
|
-
cacheWrite: number;
|
|
4777
|
-
};
|
|
4778
|
-
contextWindow: number;
|
|
4779
|
-
maxTokens: number;
|
|
4780
|
-
};
|
|
4781
5046
|
readonly "gpt-5": {
|
|
4782
5047
|
id: string;
|
|
4783
5048
|
name: string;
|
|
@@ -4931,13 +5196,13 @@ export declare const MODELS: {
|
|
|
4931
5196
|
contextWindow: number;
|
|
4932
5197
|
maxTokens: number;
|
|
4933
5198
|
};
|
|
4934
|
-
readonly "
|
|
5199
|
+
readonly "kimi-k2": {
|
|
4935
5200
|
id: string;
|
|
4936
5201
|
name: string;
|
|
4937
5202
|
api: "openai-completions";
|
|
4938
5203
|
provider: string;
|
|
4939
5204
|
baseUrl: string;
|
|
4940
|
-
reasoning:
|
|
5205
|
+
reasoning: false;
|
|
4941
5206
|
input: "text"[];
|
|
4942
5207
|
cost: {
|
|
4943
5208
|
input: number;
|
|
@@ -4948,13 +5213,13 @@ export declare const MODELS: {
|
|
|
4948
5213
|
contextWindow: number;
|
|
4949
5214
|
maxTokens: number;
|
|
4950
5215
|
};
|
|
4951
|
-
readonly "kimi-k2": {
|
|
5216
|
+
readonly "kimi-k2-thinking": {
|
|
4952
5217
|
id: string;
|
|
4953
5218
|
name: string;
|
|
4954
5219
|
api: "openai-completions";
|
|
4955
5220
|
provider: string;
|
|
4956
5221
|
baseUrl: string;
|
|
4957
|
-
reasoning:
|
|
5222
|
+
reasoning: true;
|
|
4958
5223
|
input: "text"[];
|
|
4959
5224
|
cost: {
|
|
4960
5225
|
input: number;
|
|
@@ -4965,14 +5230,14 @@ export declare const MODELS: {
|
|
|
4965
5230
|
contextWindow: number;
|
|
4966
5231
|
maxTokens: number;
|
|
4967
5232
|
};
|
|
4968
|
-
readonly "kimi-k2
|
|
5233
|
+
readonly "kimi-k2.5": {
|
|
4969
5234
|
id: string;
|
|
4970
5235
|
name: string;
|
|
4971
5236
|
api: "openai-completions";
|
|
4972
5237
|
provider: string;
|
|
4973
5238
|
baseUrl: string;
|
|
4974
5239
|
reasoning: true;
|
|
4975
|
-
input: "text"[];
|
|
5240
|
+
input: ("image" | "text")[];
|
|
4976
5241
|
cost: {
|
|
4977
5242
|
input: number;
|
|
4978
5243
|
output: number;
|
|
@@ -4982,10 +5247,10 @@ export declare const MODELS: {
|
|
|
4982
5247
|
contextWindow: number;
|
|
4983
5248
|
maxTokens: number;
|
|
4984
5249
|
};
|
|
4985
|
-
readonly "minimax-m2.1
|
|
5250
|
+
readonly "minimax-m2.1": {
|
|
4986
5251
|
id: string;
|
|
4987
5252
|
name: string;
|
|
4988
|
-
api: "
|
|
5253
|
+
api: "openai-completions";
|
|
4989
5254
|
provider: string;
|
|
4990
5255
|
baseUrl: string;
|
|
4991
5256
|
reasoning: true;
|
|
@@ -5358,6 +5623,23 @@ export declare const MODELS: {
|
|
|
5358
5623
|
contextWindow: number;
|
|
5359
5624
|
maxTokens: number;
|
|
5360
5625
|
};
|
|
5626
|
+
readonly "arcee-ai/trinity-large-preview:free": {
|
|
5627
|
+
id: string;
|
|
5628
|
+
name: string;
|
|
5629
|
+
api: "openai-completions";
|
|
5630
|
+
provider: string;
|
|
5631
|
+
baseUrl: string;
|
|
5632
|
+
reasoning: false;
|
|
5633
|
+
input: "text"[];
|
|
5634
|
+
cost: {
|
|
5635
|
+
input: number;
|
|
5636
|
+
output: number;
|
|
5637
|
+
cacheRead: number;
|
|
5638
|
+
cacheWrite: number;
|
|
5639
|
+
};
|
|
5640
|
+
contextWindow: number;
|
|
5641
|
+
maxTokens: number;
|
|
5642
|
+
};
|
|
5361
5643
|
readonly "arcee-ai/trinity-mini": {
|
|
5362
5644
|
id: string;
|
|
5363
5645
|
name: string;
|
|
@@ -6242,23 +6524,6 @@ export declare const MODELS: {
|
|
|
6242
6524
|
contextWindow: number;
|
|
6243
6525
|
maxTokens: number;
|
|
6244
6526
|
};
|
|
6245
|
-
readonly "mistralai/devstral-2512:free": {
|
|
6246
|
-
id: string;
|
|
6247
|
-
name: string;
|
|
6248
|
-
api: "openai-completions";
|
|
6249
|
-
provider: string;
|
|
6250
|
-
baseUrl: string;
|
|
6251
|
-
reasoning: false;
|
|
6252
|
-
input: "text"[];
|
|
6253
|
-
cost: {
|
|
6254
|
-
input: number;
|
|
6255
|
-
output: number;
|
|
6256
|
-
cacheRead: number;
|
|
6257
|
-
cacheWrite: number;
|
|
6258
|
-
};
|
|
6259
|
-
contextWindow: number;
|
|
6260
|
-
maxTokens: number;
|
|
6261
|
-
};
|
|
6262
6527
|
readonly "mistralai/devstral-medium": {
|
|
6263
6528
|
id: string;
|
|
6264
6529
|
name: string;
|
|
@@ -6769,6 +7034,23 @@ export declare const MODELS: {
|
|
|
6769
7034
|
contextWindow: number;
|
|
6770
7035
|
maxTokens: number;
|
|
6771
7036
|
};
|
|
7037
|
+
readonly "moonshotai/kimi-k2.5": {
|
|
7038
|
+
id: string;
|
|
7039
|
+
name: string;
|
|
7040
|
+
api: "openai-completions";
|
|
7041
|
+
provider: string;
|
|
7042
|
+
baseUrl: string;
|
|
7043
|
+
reasoning: true;
|
|
7044
|
+
input: ("image" | "text")[];
|
|
7045
|
+
cost: {
|
|
7046
|
+
input: number;
|
|
7047
|
+
output: number;
|
|
7048
|
+
cacheRead: number;
|
|
7049
|
+
cacheWrite: number;
|
|
7050
|
+
};
|
|
7051
|
+
contextWindow: number;
|
|
7052
|
+
maxTokens: number;
|
|
7053
|
+
};
|
|
6772
7054
|
readonly "nex-agi/deepseek-v3.1-nex-n1": {
|
|
6773
7055
|
id: string;
|
|
6774
7056
|
name: string;
|
|
@@ -8571,6 +8853,23 @@ export declare const MODELS: {
|
|
|
8571
8853
|
contextWindow: number;
|
|
8572
8854
|
maxTokens: number;
|
|
8573
8855
|
};
|
|
8856
|
+
readonly "upstage/solar-pro-3:free": {
|
|
8857
|
+
id: string;
|
|
8858
|
+
name: string;
|
|
8859
|
+
api: "openai-completions";
|
|
8860
|
+
provider: string;
|
|
8861
|
+
baseUrl: string;
|
|
8862
|
+
reasoning: true;
|
|
8863
|
+
input: "text"[];
|
|
8864
|
+
cost: {
|
|
8865
|
+
input: number;
|
|
8866
|
+
output: number;
|
|
8867
|
+
cacheRead: number;
|
|
8868
|
+
cacheWrite: number;
|
|
8869
|
+
};
|
|
8870
|
+
contextWindow: number;
|
|
8871
|
+
maxTokens: number;
|
|
8872
|
+
};
|
|
8574
8873
|
readonly "x-ai/grok-3": {
|
|
8575
8874
|
id: string;
|
|
8576
8875
|
name: string;
|
|
@@ -9066,6 +9365,23 @@ export declare const MODELS: {
|
|
|
9066
9365
|
contextWindow: number;
|
|
9067
9366
|
maxTokens: number;
|
|
9068
9367
|
};
|
|
9368
|
+
readonly "alibaba/qwen3-max-thinking": {
|
|
9369
|
+
id: string;
|
|
9370
|
+
name: string;
|
|
9371
|
+
api: "anthropic-messages";
|
|
9372
|
+
provider: string;
|
|
9373
|
+
baseUrl: string;
|
|
9374
|
+
reasoning: true;
|
|
9375
|
+
input: "text"[];
|
|
9376
|
+
cost: {
|
|
9377
|
+
input: number;
|
|
9378
|
+
output: number;
|
|
9379
|
+
cacheRead: number;
|
|
9380
|
+
cacheWrite: number;
|
|
9381
|
+
};
|
|
9382
|
+
contextWindow: number;
|
|
9383
|
+
maxTokens: number;
|
|
9384
|
+
};
|
|
9069
9385
|
readonly "anthropic/claude-3-haiku": {
|
|
9070
9386
|
id: string;
|
|
9071
9387
|
name: string;
|
|
@@ -9253,6 +9569,23 @@ export declare const MODELS: {
|
|
|
9253
9569
|
contextWindow: number;
|
|
9254
9570
|
maxTokens: number;
|
|
9255
9571
|
};
|
|
9572
|
+
readonly "arcee-ai/trinity-large-preview": {
|
|
9573
|
+
id: string;
|
|
9574
|
+
name: string;
|
|
9575
|
+
api: "anthropic-messages";
|
|
9576
|
+
provider: string;
|
|
9577
|
+
baseUrl: string;
|
|
9578
|
+
reasoning: false;
|
|
9579
|
+
input: "text"[];
|
|
9580
|
+
cost: {
|
|
9581
|
+
input: number;
|
|
9582
|
+
output: number;
|
|
9583
|
+
cacheRead: number;
|
|
9584
|
+
cacheWrite: number;
|
|
9585
|
+
};
|
|
9586
|
+
contextWindow: number;
|
|
9587
|
+
maxTokens: number;
|
|
9588
|
+
};
|
|
9256
9589
|
readonly "bytedance/seed-1.6": {
|
|
9257
9590
|
id: string;
|
|
9258
9591
|
name: string;
|
|
@@ -9950,6 +10283,23 @@ export declare const MODELS: {
|
|
|
9950
10283
|
contextWindow: number;
|
|
9951
10284
|
maxTokens: number;
|
|
9952
10285
|
};
|
|
10286
|
+
readonly "moonshotai/kimi-k2.5": {
|
|
10287
|
+
id: string;
|
|
10288
|
+
name: string;
|
|
10289
|
+
api: "anthropic-messages";
|
|
10290
|
+
provider: string;
|
|
10291
|
+
baseUrl: string;
|
|
10292
|
+
reasoning: true;
|
|
10293
|
+
input: ("image" | "text")[];
|
|
10294
|
+
cost: {
|
|
10295
|
+
input: number;
|
|
10296
|
+
output: number;
|
|
10297
|
+
cacheRead: number;
|
|
10298
|
+
cacheWrite: number;
|
|
10299
|
+
};
|
|
10300
|
+
contextWindow: number;
|
|
10301
|
+
maxTokens: number;
|
|
10302
|
+
};
|
|
9953
10303
|
readonly "nvidia/nemotron-nano-12b-v2-vl": {
|
|
9954
10304
|
id: string;
|
|
9955
10305
|
name: string;
|
|
@@ -11495,6 +11845,27 @@ export declare const MODELS: {
|
|
|
11495
11845
|
contextWindow: number;
|
|
11496
11846
|
maxTokens: number;
|
|
11497
11847
|
};
|
|
11848
|
+
readonly "glm-4.7-flash": {
|
|
11849
|
+
id: string;
|
|
11850
|
+
name: string;
|
|
11851
|
+
api: "openai-completions";
|
|
11852
|
+
provider: string;
|
|
11853
|
+
baseUrl: string;
|
|
11854
|
+
compat: {
|
|
11855
|
+
supportsDeveloperRole: false;
|
|
11856
|
+
thinkingFormat: "zai";
|
|
11857
|
+
};
|
|
11858
|
+
reasoning: true;
|
|
11859
|
+
input: "text"[];
|
|
11860
|
+
cost: {
|
|
11861
|
+
input: number;
|
|
11862
|
+
output: number;
|
|
11863
|
+
cacheRead: number;
|
|
11864
|
+
cacheWrite: number;
|
|
11865
|
+
};
|
|
11866
|
+
contextWindow: number;
|
|
11867
|
+
maxTokens: number;
|
|
11868
|
+
};
|
|
11498
11869
|
};
|
|
11499
11870
|
};
|
|
11500
11871
|
//# sourceMappingURL=models.generated.d.ts.map
|