Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(enterprise): region-aware Bedrock models, Agent Mode chat support, live model catalog (#1118)

Gabriel Stein382c77451005
diff --git a/package-lock.json b/package-lock.json
index 67efbdcd0..72566264f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17,6 +17,8 @@
"@ai-sdk/google-vertex": "^4.0.108",
"@ai-sdk/groq": "^3.0.29",
"@ai-sdk/openai": "^3.0.41",
+ "@ai-sdk/provider": "^3.0.14",
+ "@aws-sdk/client-bedrock": "^3.1085.0",
"@aws-sdk/credential-providers": "^3.1029.0",
"@better-auth/sso": "1.6.19",
"@homebridge/dbus-native": "^0.7.7",
@@ -117,6 +119,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/amazon-bedrock/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/anthropic": {
"version": "3.0.93",
"resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-3.0.93.tgz",
@@ -133,6 +147,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/azure": {
"version": "3.0.84",
"resolved": "https://registry.npmjs.org/@ai-sdk/azure/-/azure-3.0.84.tgz",
@@ -151,6 +177,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/azure/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/deepseek": {
"version": "2.0.44",
"resolved": "https://registry.npmjs.org/@ai-sdk/deepseek/-/deepseek-2.0.44.tgz",
@@ -167,6 +205,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/deepseek/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/gateway": {
"version": "3.0.143",
"resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-3.0.143.tgz",
@@ -184,6 +234,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/google": {
"version": "3.0.88",
"resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-3.0.88.tgz",
@@ -220,6 +282,30 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/google-vertex/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/groq": {
"version": "3.0.47",
"resolved": "https://registry.npmjs.org/@ai-sdk/groq/-/groq-3.0.47.tgz",
@@ -236,6 +322,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/groq/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/openai": {
"version": "3.0.80",
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-3.0.80.tgz",
@@ -268,7 +366,7 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
- "node_modules/@ai-sdk/provider": {
+ "node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider": {
"version": "3.0.13",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
"integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
@@ -280,6 +378,30 @@
"node": ">=18"
}
},
+ "node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@ai-sdk/provider": {
+ "version": "3.0.14",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.14.tgz",
+ "integrity": "sha512-5X1k57JBJ4H7H1QjX7CnJYAB1I19r/trVZTMcSms7/kLNZ8RaU4Nt2agcwZzv82Hfx6Q7/TOLU7agAKeFfc8cA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@ai-sdk/provider-utils": {
"version": "4.0.35",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-4.0.35.tgz",
@@ -297,6 +419,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@authenio/xml-encryption": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@authenio/xml-encryption/-/xml-encryption-2.0.2.tgz",
@@ -320,6 +454,43 @@
"node": ">=0.6.0"
}
},
+ "node_modules/@aws-sdk/client-bedrock": {
+ "version": "3.1085.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock/-/client-bedrock-3.1085.0.tgz",
+ "integrity": "sha512-unzpjV2M++lBK6QN35vj2t6sQQsUm52i3SmdsZX/kz1kN5qlKaCZIwv3rJmKi8gLMRec9PowBvrRkzw3n72Fsg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/credential-provider-node": "^3.972.66",
+ "@aws-sdk/token-providers": "3.1085.0",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/fetch-http-handler": "^5.6.4",
+ "@smithy/node-http-handler": "^4.9.4",
+ "@smithy/types": "^4.16.0",
+ "tslib": "^2.6.2"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ }
+ },
+ "node_modules/@aws-sdk/client-bedrock/node_modules/@aws-sdk/token-providers": {
+ "version": "3.1085.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1085.0.tgz",
+ "integrity": "sha512-+QxFprsPw7GTCuRN86OFhDYowgkoT/+Gn0L7feWY1kpIwUoOgzLi24esQ6PgG6pf3tHE/vs5qFmO7QcFMP82TQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/nested-clients": "^3.997.31",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/types": "^4.16.0",
+ "tslib": "^2.6.2"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ }
+ },
"node_modules/@aws-sdk/client-cognito-identity": {
"version": "3.1080.0",
"resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.1080.0.tgz",
@@ -340,17 +511,17 @@
}
},
"node_modules/@aws-sdk/core": {
- "version": "3.974.28",
- "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.974.28.tgz",
- "integrity": "sha512-4/1DtLwgLqzIg2uFzkFaFjMQHhhhwHIZN4PfziIVqXYX7koO78omuchQlLHyzQBw80l255dtmTA/J4W5yhb7zw==",
+ "version": "3.975.1",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.975.1.tgz",
+ "integrity": "sha512-8qh/6EYb7hl/ZwVfQufhbMEZs1gQIc7GbdrIf4eprQJ7cv042+74nE6l3YDfyWNzb9iPXb8fRyYSHkNIk5eE6Q==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/types": "^3.973.15",
- "@aws-sdk/xml-builder": "^3.972.33",
+ "@aws-sdk/types": "^3.974.0",
+ "@aws-sdk/xml-builder": "^3.972.34",
"@aws/lambda-invoke-store": "^0.3.0",
- "@smithy/core": "^3.29.0",
- "@smithy/signature-v4": "^5.6.1",
- "@smithy/types": "^4.15.1",
+ "@smithy/core": "^3.29.2",
+ "@smithy/signature-v4": "^5.6.3",
+ "@smithy/types": "^4.16.0",
"bowser": "^2.11.0",
"tslib": "^2.6.2"
},
@@ -375,15 +546,15 @@
}
},
"node_modules/@aws-sdk/credential-provider-env": {
- "version": "3.972.54",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.54.tgz",
- "integrity": "sha512-F4WQCG8GULIt+XrMHsqUM9dZc0eTwZM3HUWByOjIKOwBqJSzUxX8CFAtbgMvWfCua52FS1oi5FXarH3+khFq8A==",
+ "version": "3.972.57",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.57.tgz",
+ "integrity": "sha512-1RfJaF7SW1TOnvNGU7kaYjwUf5H3sfm+synGH1bHhRlqcnxCt3szebH3dmKEyY4tuGcbQ6ffzUT89cRitBV8OQ==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -391,17 +562,17 @@
}
},
"node_modules/@aws-sdk/credential-provider-http": {
- "version": "3.972.56",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.56.tgz",
- "integrity": "sha512-PiwHgEK2srdfi/lFveyQ+3w/qikyh6MKvuZAdlMC+dwQi4K5iVBr32oh7cugnYw+jA8iGtnQMhCGvLm/mqplmw==",
+ "version": "3.972.59",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.59.tgz",
+ "integrity": "sha512-sRCkpTiFnCdQvuaRVjQ6SVoHu6i7RUpurVo1c4F81HWhPvUJ7Wdp5MNtSdX1O29CNXc8em3O5m52hCjVtAD9SA==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/fetch-http-handler": "^5.6.2",
- "@smithy/node-http-handler": "^4.9.2",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/fetch-http-handler": "^5.6.4",
+ "@smithy/node-http-handler": "^4.9.4",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -409,23 +580,23 @@
}
},
"node_modules/@aws-sdk/credential-provider-ini": {
- "version": "3.972.61",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.972.61.tgz",
- "integrity": "sha512-9CZWMjhBlgfKlqJk40R7kvMOLEIoOr3HJ1J/ELjAH9H5LzR4bCxLujPVM/1PKAEjzSZKZCxWOalm7JUGZbhQqw==",
+ "version": "3.973.1",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.973.1.tgz",
+ "integrity": "sha512-6d8H6ZAh3ZPKZ6fe1nG2OWeZEZPtt9ravoD1dezPdPtsSkJRoxGAnFSHwKT3E/Te6fHE30zRzjV6TD12rvF6yQ==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/credential-provider-env": "^3.972.54",
- "@aws-sdk/credential-provider-http": "^3.972.56",
- "@aws-sdk/credential-provider-login": "^3.972.60",
- "@aws-sdk/credential-provider-process": "^3.972.54",
- "@aws-sdk/credential-provider-sso": "^3.972.60",
- "@aws-sdk/credential-provider-web-identity": "^3.972.60",
- "@aws-sdk/nested-clients": "^3.997.28",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/credential-provider-imds": "^4.4.5",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/credential-provider-env": "^3.972.57",
+ "@aws-sdk/credential-provider-http": "^3.972.59",
+ "@aws-sdk/credential-provider-login": "^3.972.63",
+ "@aws-sdk/credential-provider-process": "^3.972.57",
+ "@aws-sdk/credential-provider-sso": "^3.973.1",
+ "@aws-sdk/credential-provider-web-identity": "^3.972.63",
+ "@aws-sdk/nested-clients": "^3.997.31",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/credential-provider-imds": "^4.4.7",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -433,16 +604,16 @@
}
},
"node_modules/@aws-sdk/credential-provider-login": {
- "version": "3.972.60",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.60.tgz",
- "integrity": "sha512-Ak6OOrCbXvACyxLFIP1mcS+JTLS9ZpW1ZqyBtqu6axvdpsbG1gVNhUlAfQq8TK/gar/h2w35LrzlQU0PcUzJpw==",
+ "version": "3.972.63",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.63.tgz",
+ "integrity": "sha512-GREWRrMj0XnNKMaVa/Mauoaui26qBEHu71WWqXbwZOu/jFQOnPZjTf7u0KtGKC8VGa6VUs9kDWGgocrKNLS9vw==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/nested-clients": "^3.997.28",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/nested-clients": "^3.997.31",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -450,21 +621,21 @@
}
},
"node_modules/@aws-sdk/credential-provider-node": {
- "version": "3.972.63",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.63.tgz",
- "integrity": "sha512-YmgWtTPZDStyT74ApSHpApD3r7W9znsc+WEZjW0vceom+NAxRx9/F3TyukOKix8kJkPaa49aIREQJdpGeLDiEw==",
+ "version": "3.972.66",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.66.tgz",
+ "integrity": "sha512-f+qjRXZpz7sgzbc4QB+6nLKfyKFgRRXzWdXbsKPv/VhVRyHsDyq4yBWC/B75BAJpFIcUeI2XR/3gdWJ677zB4A==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/credential-provider-env": "^3.972.54",
- "@aws-sdk/credential-provider-http": "^3.972.56",
- "@aws-sdk/credential-provider-ini": "^3.972.61",
- "@aws-sdk/credential-provider-process": "^3.972.54",
- "@aws-sdk/credential-provider-sso": "^3.972.60",
- "@aws-sdk/credential-provider-web-identity": "^3.972.60",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/credential-provider-imds": "^4.4.5",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/credential-provider-env": "^3.972.57",
+ "@aws-sdk/credential-provider-http": "^3.972.59",
+ "@aws-sdk/credential-provider-ini": "^3.973.1",
+ "@aws-sdk/credential-provider-process": "^3.972.57",
+ "@aws-sdk/credential-provider-sso": "^3.973.1",
+ "@aws-sdk/credential-provider-web-identity": "^3.972.63",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/credential-provider-imds": "^4.4.7",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -472,15 +643,15 @@
}
},
"node_modules/@aws-sdk/credential-provider-process": {
- "version": "3.972.54",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.54.tgz",
- "integrity": "sha512-UNmUjtTnp3wH3YTZcctN7yK17S2AdaJpiNIdIf0l70hHOdGuDfdMxk62P5rt64GwGm6qkFOYG0js/cU6cdZDdg==",
+ "version": "3.972.57",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.57.tgz",
+ "integrity": "sha512-TiVQhuU0pbhIZAUZacbPHMyzrIdiH+lnx+PMY/Pu/b93dJrq3wdZwzUJ0TPpvNxaqbHsxJvQZW3/h/beLiKq7Q==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -488,17 +659,17 @@
}
},
"node_modules/@aws-sdk/credential-provider-sso": {
- "version": "3.972.60",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.972.60.tgz",
- "integrity": "sha512-zH8SvJkTRw1Kb7GARjGPjzkQPfL3jDi/OxK32I5SQq7bgwgFHJZaoDEwkEvFlfNfpByM6n4Rs20Y1mLyOdb6ag==",
+ "version": "3.973.1",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.973.1.tgz",
+ "integrity": "sha512-3foTZUJ4821Ij60X7K3NJroygiZLnbBmarN+T//O2cjkISan90zElN3NBmgSlDrTQ7Gs6z/yO8V7h60QNcDZHQ==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/nested-clients": "^3.997.28",
- "@aws-sdk/token-providers": "3.1080.0",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/nested-clients": "^3.997.31",
+ "@aws-sdk/token-providers": "3.1083.0",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -506,16 +677,16 @@
}
},
"node_modules/@aws-sdk/credential-provider-web-identity": {
- "version": "3.972.60",
- "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.60.tgz",
- "integrity": "sha512-q2rJSQ/AMjemUS18OtQqczqSo2R6VjOCLmLVmLVcdrP5/AKoj632lGCrMUWQ6EgnaLMEHbq0UO4mWh/u6gjPhA==",
+ "version": "3.972.63",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.63.tgz",
+ "integrity": "sha512-8qZLFhM69eKcS37m459ctPR05Qimycm/74OPVioe6wNZabMT54GYhwBju0+J656RkMasNSawWQu+c8CmBe3TUQ==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/nested-clients": "^3.997.28",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/nested-clients": "^3.997.31",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -551,18 +722,18 @@
}
},
"node_modules/@aws-sdk/nested-clients": {
- "version": "3.997.28",
- "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.997.28.tgz",
- "integrity": "sha512-1oG/mM3jmE2M3kad2zWJS6IKIY8hjRV4l5kAgg+xTQdLMTtehhcSucL/y4WqQpcHmQwi6+gRK8E46GYl1NBW9Q==",
+ "version": "3.997.31",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.997.31.tgz",
+ "integrity": "sha512-BDHTpwcsZHEBNEJzOg/B1BkFYJxAXY50dau/NyVWs3d51F0WgIUGSWZot/Os+N3KpDhXeaXnz37mWffAvduREw==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/signature-v4-multi-region": "^3.996.38",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/fetch-http-handler": "^5.6.2",
- "@smithy/node-http-handler": "^4.9.2",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/signature-v4-multi-region": "^3.996.39",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/fetch-http-handler": "^5.6.4",
+ "@smithy/node-http-handler": "^4.9.4",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -570,14 +741,14 @@
}
},
"node_modules/@aws-sdk/signature-v4-multi-region": {
- "version": "3.996.38",
- "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.996.38.tgz",
- "integrity": "sha512-C379Sk+MiFZCfWZphKlMyLHKxV22OjoGM5KJjj5IJNJcOCWL4IGIpnEGzv1FQiRwhYXfq55SJMfxlqPE08JJ9g==",
+ "version": "3.996.39",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.996.39.tgz",
+ "integrity": "sha512-8+srXqYIF8KYMLC4FxMLEM5Ek7kUNibJu1R4m8/fUhhNYIZZz26oGtKkCr8I/HiG2fFQxBvaGgQZT4/mqRCSnA==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/types": "^3.973.15",
- "@smithy/signature-v4": "^5.6.1",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/signature-v4": "^5.6.3",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -585,16 +756,16 @@
}
},
"node_modules/@aws-sdk/token-providers": {
- "version": "3.1080.0",
- "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1080.0.tgz",
- "integrity": "sha512-8PufAQvncWXvdZUvODbuyXa8l3aszefEzwSMBUcgheNbZOmJMcNn388Ebt/piVrUHyxKN1MlxnR2OonzTyZaGw==",
+ "version": "3.1083.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1083.0.tgz",
+ "integrity": "sha512-s0woKnxuHrExLc5L2ArIH5BMkbonHPtt+5hSBM8oknp9M6QTuUmmAmJ2E0EdzCGONrO+8+ADPqvv6UX0nNcc7A==",
"license": "Apache-2.0",
"dependencies": {
- "@aws-sdk/core": "^3.974.28",
- "@aws-sdk/nested-clients": "^3.997.28",
- "@aws-sdk/types": "^3.973.15",
- "@smithy/core": "^3.29.0",
- "@smithy/types": "^4.15.1",
+ "@aws-sdk/core": "^3.975.1",
+ "@aws-sdk/nested-clients": "^3.997.31",
+ "@aws-sdk/types": "^3.974.0",
+ "@smithy/core": "^3.29.2",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -602,12 +773,12 @@
}
},
"node_modules/@aws-sdk/types": {
- "version": "3.973.15",
- "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.973.15.tgz",
- "integrity": "sha512-IULn8uBV/SMtmOIANsm4WHXIOtVPBWfOWs3WGL0j/sI+KhaYehvOw0ET+9urnn8MBpiijuU/0JOpuwKOE451PQ==",
+ "version": "3.974.0",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.974.0.tgz",
+ "integrity": "sha512-QIBrw90CDm4O0UaIIzkU6DrFdeJzEb2Va5EPEVpyldj6sHJxB6cshhStJuhZxk3wR3PmjJlYsjPmY1kNb+KGBg==",
"license": "Apache-2.0",
"dependencies": {
- "@smithy/types": "^4.15.1",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -615,12 +786,12 @@
}
},
"node_modules/@aws-sdk/xml-builder": {
- "version": "3.972.33",
- "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.33.tgz",
- "integrity": "sha512-ezbwz9WpuLctm6o7P2t2naDhVVPI5jFGrVefVybhcKGjU57VIyT46pQVO0RI2RYkUdhdj2Z9uSIlAzGZE9NW9A==",
+ "version": "3.972.34",
+ "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.34.tgz",
+ "integrity": "sha512-wHhWL1y7sN3enBA8POrPpQM5jCcmu2ozyhbRei4c8OjVcEaEs6yLucLa/pla457ggS/ysuy7bosagz3HaJkZXA==",
"license": "Apache-2.0",
"dependencies": {
- "@smithy/types": "^4.15.1",
+ "@smithy/types": "^4.16.0",
"tslib": "^2.6.2"
},
"engines": {
@@ -3514,12 +3685,12 @@
}
},
"node_modules/@smithy/core": {
- "version": "3.29.1",
- "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.29.1.tgz",
- "integrity": "sha512-qoiY4nrk5OCu1+eIR1VB8l5DmON/oKiqrd5zZFAhXJXjJlLWQusKEW/SkBDAtGDcPaz86m9kfcE1lngU0GlM6A==",
+ "version": "3.29.3",
+ "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.29.3.tgz",
+ "integrity": "sha512-L+Ys6ecjk5vwPMAKHBpPKlJ3DkqwNcnfEISXBZIsVvWG/XKXfsAP8mwIYlTeLcd2ElHdesPI8OuOmJSFAPhm6A==",
"license": "Apache-2.0",
"dependencies": {
- "@smithy/types": "^4.15.1",
+ "@smithy/types": "^4.16.1",
"tslib": "^2.6.2"
},
"engines": {
@@ -3527,13 +3698,13 @@
}
},
"node_modules/@smithy/credential-provider-imds": {
- "version": "4.4.6",
- "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.4.6.tgz",
- "integrity": "sha512-B2WQ/PV/H6Jeg3lrIq6bKUfa6Hy01mtK7CGs6lhjzHA6k4aagldH6T6eEjnzKl4HI0cJnAsxfJ19pgb5PV+CVQ==",
+ "version": "4.4.8",
+ "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.4.8.tgz",
+ "integrity": "sha512-q9J7JTiXrAhB8sDp4px97uEPT7CwKH61Co78grdNQvU8QZAdiuaSRhP0tUVf2ogy36RZTrlMU1rBmDEH+cnkiA==",
"license": "Apache-2.0",
"dependencies": {
- "@smithy/core": "^3.29.1",
- "@smithy/types": "^4.15.1",
+ "@smithy/core": "^3.29.3",
+ "@smithy/types": "^4.16.1",
"tslib": "^2.6.2"
},
"engines": {
@@ -3554,13 +3725,13 @@
}
},
"node_modules/@smithy/fetch-http-handler": {
- "version": "5.6.3",
- "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.6.3.tgz",
- "integrity": "sha512-CwCc/7SMTj45y97MUnDTbTaxvtAsiNNRm81z3abROIuMbMsC2Iy5EKfkkVdsKrz8WExQAAMx1EJapq+9j4fFTQ==",
+ "version": "5.6.5",
+ "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.6.5.tgz",
+ "integrity": "sha512-SuqeisTyPoiIPtIYru/sGxGyXzmZ+8nnFOhC+qRPglt06Ebd1yH//CDltZB2J/3WBNVhwfUaZ0EtHB3cm2X32g==",
"license": "Apache-2.0",
"dependencies": {
- "@smithy/core": "^3.29.1",
- "@smithy/types": "^4.15.1",
+ "@smithy/core": "^3.29.3",
+ "@smithy/types": "^4.16.1",
"tslib": "^2.6.2"
},
"engines": {
@@ -3568,13 +3739,13 @@
}
},
"node_modules/@smithy/node-http-handler": {
- "version": "4.9.3",
- "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.9.3.tgz",
- "integrity": "sha512-qZTa4gQFUo8RM02rk6q5UVTDLNrQ1oS20LsepBzqq1QBVc/EHJ03OOUADcqMZiXHArW+Y7+OGY0BpdTwZRq/Yg==",
+ "version": "4.9.5",
+ "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.9.5.tgz",
+ "integrity": "sha512-bNqdxTQTxmLbomSmlkZFz8L6B/feQ2HHzw4L2zY7Ecp2XffYAZq2uzdWDdxJHJFbEvqd+SRuluJso0P8+xPdbw==",
"license": "Apache-2.0",
"dependencies": {
- "@smithy/core": "^3.29.1",
- "@smithy/types": "^4.15.1",
+ "@smithy/core": "^3.29.3",
+ "@smithy/types": "^4.16.1",
"tslib": "^2.6.2"
},
"engines": {
@@ -3582,13 +3753,13 @@
}
},
"node_modules/@smithy/signature-v4": {
- "version": "5.6.2",
- "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.6.2.tgz",
- "integrity": "sha512-QgHflghMoPxCJ9axiCVh8KZfbC9fuP6vkXXyK//E3cq7nLaSSyyLj0GAoqVWezYeDQmXIZhmlRvLE16jsqDK6g==",
+ "version": "5.6.4",
+ "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.6.4.tgz",
+ "integrity": "sha512-B89bpf2t/y/wia6LZ+4JfHXYQT9PnVftsH05rgJKKIStS7r/4XSs9HOjtPoLtgcA6HCW9jVqX5DBbq7E0PAkiQ==",
"license": "Apache-2.0",
"dependencies": {
- "@smithy/core": "^3.29.1",
- "@smithy/types": "^4.15.1",
+ "@smithy/core": "^3.29.3",
+ "@smithy/types": "^4.16.1",
"tslib": "^2.6.2"
},
"engines": {
@@ -3596,9 +3767,9 @@
}
},
"node_modules/@smithy/types": {
- "version": "4.15.1",
- "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.15.1.tgz",
- "integrity": "sha512-x3L0XSACF6UYzKpa9biqiRMgvH5+wnFFew9Tm/grFYqgaupPwx/+ojDPpPJM8dZON3S9tjz5U+PQYsCBd1Mw5Q==",
+ "version": "4.16.1",
+ "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.16.1.tgz",
+ "integrity": "sha512-0JFs3V2y2M9tKW5na/qxe69Zv+uxLMO7QBbhxF/FHu/Gp2NFZAAL9tWl9PU02xxo07pb3G9FTyjNc6D5uZrJIg==",
"license": "Apache-2.0",
"dependencies": {
"tslib": "^2.6.2"
@@ -4982,6 +5153,18 @@
"zod": "^3.25.76 || ^4.1.8"
}
},
+ "node_modules/ai/node_modules/@ai-sdk/provider": {
+ "version": "3.0.13",
+ "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.13.tgz",
+ "integrity": "sha512-ZPtVYt5QIJzOta1kdUiDuCx4HhFkvNPv/rvmZ2b1iXwybYjJsCnNYR4PAw4kW7rgVfDARvHXcU64efWuqNp6bw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "json-schema": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/ajv": {
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
diff --git a/package.json b/package.json
index c29898779..f7fff4354 100644
--- a/package.json
+++ b/package.json
@@ -121,6 +121,8 @@
"@ai-sdk/google-vertex": "^4.0.108",
"@ai-sdk/groq": "^3.0.29",
"@ai-sdk/openai": "^3.0.41",
+ "@ai-sdk/provider": "^3.0.14",
+ "@aws-sdk/client-bedrock": "^3.1085.0",
"@aws-sdk/credential-providers": "^3.1029.0",
"@better-auth/sso": "1.6.19",
"@napi-rs/keyring": "^1.3.0",
diff --git a/preload.js b/preload.js
index 09ea89d78..11fb30c58 100644
--- a/preload.js
+++ b/preload.js
@@ -443,6 +443,13 @@ contextBridge.exposeInMainWorld("electronAPI", {
// Node-only SDKs (AWS/Azure/Google credential providers) can resolve.
processEnterpriseReasoning: (text, modelId, agentName, config) =>
ipcRenderer.invoke("process-enterprise-reasoning", text, modelId, agentName, config),
+ enterpriseStreamStart: (payload) => ipcRenderer.invoke("enterprise-stream-start", payload),
+ enterpriseStreamCancel: (streamId) => ipcRenderer.invoke("enterprise-stream-cancel", streamId),
+ onEnterpriseStreamPart: registerListener(
+ "enterprise-stream-part",
+ (callback) => (_event, payload) => callback(payload)
+ ),
+ listBedrockModels: (config) => ipcRenderer.invoke("bedrock-list-models", config),
// llama.cpp
llamaCppCheck: () => ipcRenderer.invoke("llama-cpp-check"),
diff --git a/src/components/EnterpriseProviderConfig.tsx b/src/components/EnterpriseProviderConfig.tsx
index 2b3024bd5..2dfc5b1f6 100644
--- a/src/components/EnterpriseProviderConfig.tsx
+++ b/src/components/EnterpriseProviderConfig.tsx
@@ -1,13 +1,17 @@
-import { useMemo } from "react";
+import { useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
+import { Loader2, Search } from "lucide-react";
+import { Button } from "./ui/button";
import { Input } from "./ui/input";
import ApiKeyInput from "./ui/ApiKeyInput";
-import ModelCardList from "./ui/ModelCardList";
+import ModelCardList, { type ModelCardOption } from "./ui/ModelCardList";
+import SearchableModelList from "./ui/SearchableModelList";
import CustomModelInput from "./ui/CustomModelInput";
import TestConnectionButton from "./TestConnectionButton";
import { REASONING_PROVIDERS } from "../models/ModelRegistry";
import { useSettingsStore } from "../stores/settingsStore";
import { getProviderIcon, isMonochromeProvider } from "../utils/providerIcons";
+import { adjustBedrockModelForRegion } from "../utils/bedrockRegions";
interface EnterpriseProviderConfigProps {
provider: "bedrock" | "azure" | "vertex";
@@ -128,17 +132,68 @@ function useSuggestedModels(provider: "bedrock" | "vertex") {
}, [t, provider]);
}
+type BedrockCatalogState =
+ | { status: "idle" }
+ | { status: "loading" }
+ | { status: "error"; error: string }
+ | { status: "loaded"; models: ModelCardOption[] };
+
function BedrockConfig({ reasoningModel, setReasoningModel }: EnterpriseProviderConfigProps) {
const { t } = useTranslation();
const store = useSettingsStore();
const suggestedModels = useSuggestedModels("bedrock");
+ const [catalog, setCatalog] = useState<BedrockCatalogState>({ status: "idle" });
+ const catalogRequestRef = useRef(0);
+
+ const regionModels = useMemo(
+ () =>
+ suggestedModels.map((m) => ({
+ ...m,
+ value: adjustBedrockModelForRegion(m.value, store.bedrockRegion),
+ })),
+ [suggestedModels, store.bedrockRegion]
+ );
- const getTestConfig = () => ({
+ const getConnectionConfig = () => ({
bedrockRegion: store.bedrockRegion,
bedrockProfile: store.bedrockAuthMode === "sso" ? store.bedrockProfile : "",
bedrockAccessKeyId: store.bedrockAuthMode === "keys" ? store.bedrockAccessKeyId : "",
bedrockSecretAccessKey: store.bedrockAuthMode === "keys" ? store.bedrockSecretAccessKey : "",
bedrockSessionToken: store.bedrockAuthMode === "keys" ? store.bedrockSessionToken : "",
+ });
+
+ const loadCatalog = async (region: string) => {
+ const requestId = ++catalogRequestRef.current;
+ setCatalog({ status: "loading" });
+ const result = await window.electronAPI?.listBedrockModels?.({
+ ...getConnectionConfig(),
+ bedrockRegion: region,
+ });
+ if (requestId !== catalogRequestRef.current) return;
+ if (result?.success && result.models) {
+ setCatalog({
+ status: "loaded",
+ models: result.models.map((m) => ({ value: m.value, label: m.label, group: m.vendor })),
+ });
+ } else {
+ setCatalog({
+ status: "error",
+ error:
+ result?.error ||
+ t("reasoning.enterprise.modelListError", { defaultValue: "Could not load models." }),
+ });
+ }
+ };
+
+ const handleRegionChange = (region: string) => {
+ store.setBedrockRegion(region);
+ const adjusted = adjustBedrockModelForRegion(reasoningModel, region);
+ if (adjusted !== reasoningModel) setReasoningModel(adjusted);
+ if (catalog.status !== "idle") void loadCatalog(region);
+ };
+
+ const getTestConfig = () => ({
+ ...getConnectionConfig(),
model: reasoningModel,
});
@@ -227,7 +282,7 @@ function BedrockConfig({ reasoningModel, setReasoningModel }: EnterpriseProvider
<FieldLabel>{t("reasoning.enterprise.region", { defaultValue: "Region" })}</FieldLabel>
<select
value={store.bedrockRegion}
- onChange={(e) => store.setBedrockRegion(e.target.value)}
+ onChange={(e) => handleRegionChange(e.target.value)}
className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
>
{BEDROCK_REGIONS.map((r) => (
@@ -238,13 +293,13 @@ function BedrockConfig({ reasoningModel, setReasoningModel }: EnterpriseProvider
</select>
</div>
- {suggestedModels.length > 0 && (
+ {regionModels.length > 0 && (
<div className="space-y-1.5">
<FieldLabel>
{t("reasoning.enterprise.suggestedModels", { defaultValue: "Suggested Models" })}
</FieldLabel>
<ModelCardList
- models={suggestedModels}
+ models={regionModels}
selectedModel={reasoningModel}
onModelSelect={setReasoningModel}
colorScheme="purple"
@@ -252,6 +307,53 @@ function BedrockConfig({ reasoningModel, setReasoningModel }: EnterpriseProvider
</div>
)}
+ {catalog.status === "loaded" ? (
+ <div className="space-y-1.5">
+ <FieldLabel>
+ {t("reasoning.enterprise.allModels", {
+ defaultValue: "All Models in {{region}}",
+ region: store.bedrockRegion,
+ })}
+ </FieldLabel>
+ <SearchableModelList
+ models={catalog.models}
+ selectedModel={reasoningModel}
+ onModelSelect={setReasoningModel}
+ />
+ </div>
+ ) : (
+ <div className="space-y-1.5">
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ className="w-full"
+ aria-busy={catalog.status === "loading"}
+ onClick={() => {
+ if (catalog.status !== "loading") void loadCatalog(store.bedrockRegion);
+ }}
+ >
+ {catalog.status === "loading" ? (
+ <Loader2 className="w-3.5 h-3.5 mr-1.5 animate-spin" />
+ ) : (
+ <Search className="w-3.5 h-3.5 mr-1.5" />
+ )}
+ {catalog.status === "loading"
+ ? t("reasoning.enterprise.loadingModels", { defaultValue: "Fetching models..." })
+ : catalog.status === "error"
+ ? t("common.retry", { defaultValue: "Retry" })
+ : t("reasoning.enterprise.browseModels", { defaultValue: "Browse all models" })}
+ </Button>
+ {catalog.status === "error" && (
+ <FieldHint>
+ <span role="alert" className="text-destructive">
+ {catalog.error}
+ </span>
+ </FieldHint>
+ )}
+ </div>
+ )}
+
<CustomModelInput value={reasoningModel} onChange={setReasoningModel} />
<TestConnectionButton provider="bedrock" getConfig={getTestConfig} />
diff --git a/src/components/EnterpriseSection.tsx b/src/components/EnterpriseSection.tsx
index adb373455..d23b5b02f 100644
--- a/src/components/EnterpriseSection.tsx
+++ b/src/components/EnterpriseSection.tsx
@@ -2,6 +2,7 @@ import { ProviderTabs } from "./ui/ProviderTabs";
import EnterpriseProviderConfig from "./EnterpriseProviderConfig";
import { REASONING_PROVIDERS } from "../models/ModelRegistry";
import { useSettingsStore } from "../stores/settingsStore";
+import { adjustBedrockModelForRegion } from "../utils/bedrockRegions";
const ENTERPRISE_PROVIDER_TABS = [
{ id: "bedrock", name: "AWS Bedrock" },
@@ -23,6 +24,7 @@ export default function EnterpriseSection({
setLocalReasoningProvider,
}: EnterpriseSectionProps) {
const azureDeploymentName = useSettingsStore((s) => s.azureDeploymentName);
+ const bedrockRegion = useSettingsStore((s) => s.bedrockRegion);
const selectedEnterprise = ENTERPRISE_PROVIDER_TABS.some((p) => p.id === currentProvider)
? currentProvider
: "";
@@ -33,7 +35,12 @@ export default function EnterpriseSection({
const providerData = REASONING_PROVIDERS[providerId];
if (providerData?.models?.length) {
- setReasoningModel(providerData.models[0].value);
+ const defaultModel = providerData.models[0].value;
+ setReasoningModel(
+ providerId === "bedrock"
+ ? adjustBedrockModelForRegion(defaultModel, bedrockRegion)
+ : defaultModel
+ );
} else if (providerId === "azure" && azureDeploymentName) {
setReasoningModel(azureDeploymentName);
}
diff --git a/src/components/chat/useChatStreaming.ts b/src/components/chat/useChatStreaming.ts
index b52feae44..bff65535a 100644
--- a/src/components/chat/useChatStreaming.ts
+++ b/src/components/chat/useChatStreaming.ts
@@ -1,6 +1,7 @@
import { useState, useRef, useEffect, useCallback } from "react";
import { useTranslation } from "react-i18next";
import ReasoningService, { type AgentStreamChunk } from "../../services/ReasoningService";
+import { isEnterpriseProvider } from "../../models/ModelRegistry";
import { getSettings } from "../../stores/settingsStore";
import { getAgentSystemPrompt } from "../../config/prompts";
import { createToolRegistry } from "../../services/tools";
@@ -99,15 +100,11 @@ export function useChatStreaming({
const isLanAgent = chatAgentMode === "self-hosted" && !!settings.chatAgentRemoteUrl;
const isCustomAgent =
chatAgentMode === "providers" && settings.chatAgentProvider === "custom";
- const isLocalProvider = ![
- "openai",
- "groq",
- "custom",
- "anthropic",
- "gemini",
- "tinfoil",
- "openrouter",
- ].includes(settings.chatAgentProvider);
+ const isLocalProvider =
+ !isEnterpriseProvider(settings.chatAgentProvider) &&
+ !["openai", "groq", "custom", "anthropic", "gemini", "tinfoil", "openrouter"].includes(
+ settings.chatAgentProvider
+ );
const localModelCanUseTool =
isLocalProvider && estimateModelSizeB(settings.chatAgentModel) >= LOCAL_TOOL_MIN_PARAMS_B;
const supportsTools = isCloudAgent || !isLocalProvider || localModelCanUseTool;
diff --git a/src/components/ui/ModelCardList.tsx b/src/components/ui/ModelCardList.tsx
index 6051461eb..be64f5d79 100644
--- a/src/components/ui/ModelCardList.tsx
+++ b/src/components/ui/ModelCardList.tsx
@@ -12,6 +12,9 @@ export interface ModelCardOption {
specUrl?: string;
icon?: string;
invertInDark?: boolean;
+ // Explicit group for SearchableModelList; falls back to the "provider/"
+ // prefix of `value` when absent (e.g. Bedrock ids carry no slash).
+ group?: string;
// Local model properties (optional)
isDownloaded?: boolean;
isDownloading?: boolean;
diff --git a/src/components/ui/SearchableModelList.tsx b/src/components/ui/SearchableModelList.tsx
index 5acf99c6a..a2fb847d0 100644
--- a/src/components/ui/SearchableModelList.tsx
+++ b/src/components/ui/SearchableModelList.tsx
@@ -36,7 +36,13 @@ function matchesQuery(model: ModelCardOption, normalizedQuery: string): boolean
// "Selected" row keeps the full id so its provider stays identifiable.
function toDisplayOption(model: ModelCardOption, stripPrefix: boolean): ModelCardOption {
const prefix = providerPrefix(model.value);
- if (!prefix) return model;
+ if (!prefix) {
+ if (!model.group || model.icon) return model;
+ // Vendor names like "Mistral AI" or "Z.AI" → icon slugs like "mistralai".
+ const groupSlug = model.group.toLowerCase().replace(/[^a-z0-9]/g, "");
+ const { icon, invertInDark } = getRemoteProviderIcon(groupSlug, model.value);
+ return { ...model, icon, invertInDark };
+ }
const name = model.value.slice(prefix.length + 1);
const { icon, invertInDark } = getRemoteProviderIcon(prefix, name);
const label = (stripPrefix && name) || model.label;
@@ -74,7 +80,7 @@ export default function SearchableModelList({
if (seen.has(model.value)) continue;
if (normalizedQuery && !matchesQuery(model, normalizedQuery)) continue;
seen.add(model.value);
- const prefix = providerPrefix(model.value);
+ const prefix = model.group ?? providerPrefix(model.value);
const key = prefix ? prefix.replace(/^~/, "").toLowerCase() : OTHER_GROUP;
const bucket = groups.get(key);
if (bucket) bucket.push(model);
diff --git a/src/helpers/bedrockCatalog.js b/src/helpers/bedrockCatalog.js
new file mode 100644
index 000000000..4c25d7149
--- /dev/null
+++ b/src/helpers/bedrockCatalog.js
@@ -0,0 +1,44 @@
+// On-demand models are invoked by their bare foundation-model ID;
+// INFERENCE_PROFILE-only models must go through the geo-scoped cross-region
+// profile (us./eu./apac.) that the target region actually serves.
+
+function profileIdByModelId(inferenceProfileSummaries) {
+ const map = new Map();
+ for (const profile of inferenceProfileSummaries || []) {
+ if (!profile?.inferenceProfileId) continue;
+ for (const model of profile.models || []) {
+ const modelId = model?.modelArn?.split("/").pop();
+ if (modelId && !map.has(modelId)) map.set(modelId, profile.inferenceProfileId);
+ }
+ }
+ return map;
+}
+
+function normalizeBedrockCatalog(modelSummaries, inferenceProfileSummaries) {
+ const profiles = profileIdByModelId(inferenceProfileSummaries);
+ const seen = new Set();
+ const models = [];
+
+ for (const summary of modelSummaries || []) {
+ if (!summary?.modelId) continue;
+ if (!(summary.outputModalities || []).includes("TEXT")) continue;
+ const status = summary.modelLifecycle?.status;
+ if (status && status !== "ACTIVE") continue;
+
+ const types = summary.inferenceTypesSupported || [];
+ const value = types.includes("ON_DEMAND") ? summary.modelId : profiles.get(summary.modelId);
+ if (!value || seen.has(value)) continue;
+ seen.add(value);
+
+ models.push({
+ value,
+ label: summary.modelName || summary.modelId,
+ vendor: summary.providerName || "",
+ });
+ }
+
+ models.sort((a, b) => a.vendor.localeCompare(b.vendor) || a.label.localeCompare(b.label));
+ return models;
+}
+
+module.exports = { normalizeBedrockCatalog };
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index cd688b4f0..519b3a638 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -2932,6 +2932,141 @@ class IPCHandlers {
}
);
+ // Runs doStream for the renderer's enterprise chat model shim; parts are
+ // relayed verbatim over enterprise-stream-part, ending with {done}/{error}.
+ this.enterpriseStreamAborts = new Map();
+ ipcMain.handle("enterprise-stream-start", async (event, payload) => {
+ const {
+ isEnterpriseProvider,
+ mapEnterpriseError,
+ pickEnterpriseConfig,
+ validateEnterpriseEndpoint,
+ } = require("./enterpriseProviderErrors");
+ const { streamId, provider, modelId, config, options } = payload || {};
+ const send = (message) => {
+ if (!event.sender.isDestroyed()) {
+ event.sender.send("enterprise-stream-part", { streamId, ...message });
+ }
+ };
+ const abortController = new AbortController();
+ this.enterpriseStreamAborts.set(streamId, abortController);
+ // isDestroyed() stays false across reload/navigation, which wipes the
+ // renderer listeners — abort so the provider request isn't billed for
+ // a generation nobody receives.
+ const abortOnGone = (_event, _url, isInPlace, isMainFrame) => {
+ if (isMainFrame && !isInPlace) abortController.abort();
+ };
+ const abortOnDestroyed = () => abortController.abort();
+ event.sender.on("did-start-navigation", abortOnGone);
+ event.sender.once("destroyed", abortOnDestroyed);
+ try {
+ if (!streamId || !isEnterpriseProvider(provider)) {
+ throw new Error(`Unsupported enterprise provider: ${provider}`);
+ }
+ if (!modelId) {
+ throw new Error("No model specified for enterprise streaming");
+ }
+ validateEnterpriseEndpoint(config?.azureEndpoint);
+
+ const { getEnterpriseAIModel } = require("./enterpriseAiProviders");
+ const model = getEnterpriseAIModel(
+ provider,
+ modelId,
+ config?.apiKey || "",
+ pickEnterpriseConfig(config || {})
+ );
+
+ const { stream } = await model.doStream({
+ ...options,
+ abortSignal: abortController.signal,
+ });
+ const reader = stream.getReader();
+ try {
+ for (;;) {
+ const { done, value } = await reader.read();
+ if (done) break;
+ if (event.sender.isDestroyed()) {
+ abortController.abort();
+ break;
+ }
+ send({ part: value });
+ }
+ } finally {
+ reader.releaseLock();
+ }
+ send({ done: true });
+ return { success: true };
+ } catch (err) {
+ debugLogger.error("Enterprise stream error:", err);
+ const mapped = mapEnterpriseError(provider, err, config || {});
+ send({ error: mapped.message });
+ return { success: false, error: mapped.message };
+ } finally {
+ this.enterpriseStreamAborts.delete(streamId);
+ if (!event.sender.isDestroyed()) {
+ event.sender.removeListener("did-start-navigation", abortOnGone);
+ event.sender.removeListener("destroyed", abortOnDestroyed);
+ }
+ }
+ });
+
+ ipcMain.handle("enterprise-stream-cancel", async (event, streamId) => {
+ this.enterpriseStreamAborts.get(streamId)?.abort();
+ this.enterpriseStreamAborts.delete(streamId);
+ });
+
+ // Lists the text models the account serves in the selected region,
+ // resolved to invocable IDs (bare on-demand or geo-scoped profile IDs).
+ ipcMain.handle("bedrock-list-models", async (event, config) => {
+ const { mapEnterpriseError } = require("./enterpriseProviderErrors");
+ try {
+ const {
+ BedrockClient,
+ ListFoundationModelsCommand,
+ paginateListInferenceProfiles,
+ } = require("@aws-sdk/client-bedrock");
+ const { normalizeBedrockCatalog } = require("./bedrockCatalog");
+
+ const region = config?.bedrockRegion || "us-east-1";
+ let credentials;
+ if (config?.bedrockProfile) {
+ const { fromNodeProviderChain } = require("@aws-sdk/credential-providers");
+ credentials = fromNodeProviderChain({ profile: config.bedrockProfile });
+ } else if (config?.bedrockAccessKeyId && config?.bedrockSecretAccessKey) {
+ credentials = {
+ accessKeyId: config.bedrockAccessKeyId,
+ secretAccessKey: config.bedrockSecretAccessKey,
+ sessionToken: config.bedrockSessionToken || undefined,
+ };
+ }
+ const client = new BedrockClient({ region, ...(credentials ? { credentials } : {}) });
+
+ const [foundationModels, profileSummaries] = await Promise.all([
+ client.send(new ListFoundationModelsCommand({ byOutputModality: "TEXT" })),
+ (async () => {
+ const summaries = [];
+ const paginator = paginateListInferenceProfiles(
+ { client },
+ { typeEquals: "SYSTEM_DEFINED" }
+ );
+ for await (const page of paginator) {
+ summaries.push(...(page.inferenceProfileSummaries || []));
+ }
+ return summaries;
+ })(),
+ ]);
+
+ return {
+ success: true,
+ models: normalizeBedrockCatalog(foundationModels.modelSummaries, profileSummaries),
+ };
+ } catch (err) {
+ debugLogger.error("Bedrock model listing error:", err);
+ const mapped = mapEnterpriseError("bedrock", err, config || {});
+ return { success: false, error: mapped.message };
+ }
+ });
+
ipcMain.handle("get-dictation-key", async () => {
return this.environmentManager.getDictationKey();
});
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 62e82e31d..82d5234da 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "Der native Push-to-Talk-Listener ist nicht verfügbar"
},
"common": {
+ "retry": "Erneut versuchen",
"back": "Zurück",
"next": "Weiter",
"complete": "Fertig",
@@ -492,6 +493,10 @@
"customModelId": "Eigene Modell-ID",
"customModelPlaceholder": "Modell-ID oder Deployment-Name eingeben",
"suggestedModels": "Empfohlene Modelle",
+ "browseModels": "Alle Modelle durchsuchen",
+ "loadingModels": "Modelle werden geladen...",
+ "allModels": "Alle Modelle in {{region}}",
+ "modelListError": "Modelle konnten nicht geladen werden.",
"bedrock": {
"ssoHelp": "Verwendet Ihre AWS-CLI-SSO-Konfiguration. Stellen Sie sicher, dass Sie 'aws sso login' ausgeführt haben.",
"keysHelp": "Geben Sie Ihre AWS-IAM-Zugriffsschlüssel ein."
@@ -1921,9 +1926,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "Schnell und günstig. Ideal zum Bereinigen von Text.",
- "bedrock_claude_sonnet_4_6": "Ausgewogen. Empfohlener Standard für den Agent-Modus.",
- "bedrock_claude_opus_4_7": "Höchste Intelligenz. Für komplexe Aufgaben im Agent-Modus.",
- "bedrock_nova_lite": "Günstigste Option. Nativ in AWS, ideal für hohe Volumen.",
+ "bedrock_claude_sonnet_5": "Ausgewogen. Empfohlener Standard für den Agent-Modus.",
+ "bedrock_claude_opus_4_8": "Höchste Intelligenz. Für komplexe Aufgaben im Agent-Modus.",
+ "bedrock_gpt_oss_120b": "Offenes OpenAI-Modell. Starkes Reasoning zu geringen Kosten.",
+ "bedrock_deepseek_v3_2": "Offenes Frontier-Modell. Starker Wert für den Agent-Modus.",
+ "bedrock_qwen3_next_80b": "Sparsames offenes Modell. Schnell und mehrsprachig.",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 111d030e2..ae7bf36cb 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "Push-to-Talk native listener not available"
},
"common": {
+ "retry": "Retry",
"back": "Back",
"next": "Next",
"complete": "Complete",
@@ -492,6 +493,10 @@
"customModelId": "Custom Model ID",
"customModelPlaceholder": "Enter model ID or deployment name",
"suggestedModels": "Suggested Models",
+ "browseModels": "Browse all models",
+ "loadingModels": "Fetching models...",
+ "allModels": "All Models in {{region}}",
+ "modelListError": "Could not load models.",
"bedrock": {
"ssoHelp": "Uses your AWS CLI SSO configuration. Ensure you have run 'aws sso login'.",
"keysHelp": "Enter your AWS IAM access keys."
@@ -2013,9 +2018,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "Fast and cheap. Great default for text cleanup.",
- "bedrock_claude_sonnet_4_6": "Balanced workhorse. Best default for Agent Mode.",
- "bedrock_claude_opus_4_7": "Max intelligence. Best for complex Agent Mode tasks.",
- "bedrock_nova_lite": "Cheapest option. AWS-native, ideal for high volume.",
+ "bedrock_claude_sonnet_5": "Balanced workhorse. Best default for Agent Mode.",
+ "bedrock_claude_opus_4_8": "Max intelligence. Best for complex Agent Mode tasks.",
+ "bedrock_gpt_oss_120b": "Open-weight OpenAI model. Strong reasoning at low cost.",
+ "bedrock_deepseek_v3_2": "Open-weight frontier model. Great value for Agent Mode.",
+ "bedrock_qwen3_next_80b": "Sparse open-weight model. Fast and multilingual.",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index e1af69ccd..086b2dcca 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "El módulo nativo de Push-to-Talk no está disponible"
},
"common": {
+ "retry": "Reintentar",
"back": "Atrás",
"next": "Siguiente",
"complete": "Completar",
@@ -492,6 +493,10 @@
"customModelId": "ID de modelo personalizado",
"customModelPlaceholder": "Introduce un ID de modelo o nombre de deployment",
"suggestedModels": "Modelos sugeridos",
+ "browseModels": "Explorar todos los modelos",
+ "loadingModels": "Obteniendo modelos...",
+ "allModels": "Todos los modelos en {{region}}",
+ "modelListError": "No se pudieron cargar los modelos.",
"bedrock": {
"ssoHelp": "Usa tu configuración SSO de AWS CLI. Asegúrate de haber ejecutado 'aws sso login'.",
"keysHelp": "Introduce tus claves de acceso de AWS IAM."
@@ -1969,9 +1974,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "Rápido y económico. Ideal para limpiar texto.",
- "bedrock_claude_sonnet_4_6": "Equilibrado. Opción por defecto para el Modo Agente.",
- "bedrock_claude_opus_4_7": "Máxima inteligencia. Para tareas complejas del Modo Agente.",
- "bedrock_nova_lite": "La opción más económica. Nativo de AWS, ideal para alto volumen.",
+ "bedrock_claude_sonnet_5": "Equilibrado. Opción por defecto para el Modo Agente.",
+ "bedrock_claude_opus_4_8": "Máxima inteligencia. Para tareas complejas del Modo Agente.",
+ "bedrock_gpt_oss_120b": "Modelo abierto de OpenAI. Gran razonamiento a bajo costo.",
+ "bedrock_deepseek_v3_2": "Modelo frontera de pesos abiertos. Gran valor para el Modo Agente.",
+ "bedrock_qwen3_next_80b": "Modelo abierto disperso. Rápido y multilingüe.",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 9feac79a0..3edc6c0b6 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "L'écouteur natif Push-to-Talk n'est pas disponible"
},
"common": {
+ "retry": "Réessayer",
"back": "Retour",
"next": "Suivant",
"complete": "Terminer",
@@ -492,6 +493,10 @@
"customModelId": "ID de modèle personnalisé",
"customModelPlaceholder": "Saisissez un ID de modèle ou un nom de déploiement",
"suggestedModels": "Modèles suggérés",
+ "browseModels": "Parcourir tous les modèles",
+ "loadingModels": "Récupération des modèles...",
+ "allModels": "Tous les modèles dans {{region}}",
+ "modelListError": "Impossible de charger les modèles.",
"bedrock": {
"ssoHelp": "Utilise votre configuration SSO d'AWS CLI. Assurez-vous d'avoir exécuté 'aws sso login'.",
"keysHelp": "Saisissez vos clés d'accès AWS IAM."
@@ -1969,9 +1974,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "Rapide et économique. Parfait pour nettoyer le texte.",
- "bedrock_claude_sonnet_4_6": "Équilibré. Choix par défaut pour le Mode Agent.",
- "bedrock_claude_opus_4_7": "Intelligence maximale. Pour les tâches complexes en Mode Agent.",
- "bedrock_nova_lite": "Option la moins chère. Natif à AWS, idéal pour les gros volumes.",
+ "bedrock_claude_sonnet_5": "Équilibré. Choix par défaut pour le Mode Agent.",
+ "bedrock_claude_opus_4_8": "Intelligence maximale. Pour les tâches complexes en Mode Agent.",
+ "bedrock_gpt_oss_120b": "Modèle ouvert d'OpenAI. Raisonnement solide à faible coût.",
+ "bedrock_deepseek_v3_2": "Modèle frontière à poids ouverts. Excellent rapport qualité-prix en Mode Agent.",
+ "bedrock_qwen3_next_80b": "Modèle ouvert épars. Rapide et multilingue.",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 84bafa004..72bc9f442 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "Il listener nativo Push-to-Talk non è disponibile"
},
"common": {
+ "retry": "Riprova",
"back": "Indietro",
"next": "Avanti",
"complete": "Completa",
@@ -492,6 +493,10 @@
"customModelId": "ID modello personalizzato",
"customModelPlaceholder": "Inserisci un ID modello o nome di deployment",
"suggestedModels": "Modelli suggeriti",
+ "browseModels": "Sfoglia tutti i modelli",
+ "loadingModels": "Recupero dei modelli...",
+ "allModels": "Tutti i modelli in {{region}}",
+ "modelListError": "Impossibile caricare i modelli.",
"bedrock": {
"ssoHelp": "Usa la tua configurazione SSO di AWS CLI. Assicurati di aver eseguito 'aws sso login'.",
"keysHelp": "Inserisci le tue chiavi di accesso AWS IAM."
@@ -1921,9 +1926,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "Veloce ed economico. Ideale per ripulire il testo.",
- "bedrock_claude_sonnet_4_6": "Equilibrato. Scelta predefinita per la Modalità Agente.",
- "bedrock_claude_opus_4_7": "Massima intelligenza. Per compiti complessi in Modalità Agente.",
- "bedrock_nova_lite": "Opzione più economica. Nativo di AWS, ideale per grandi volumi.",
+ "bedrock_claude_sonnet_5": "Equilibrato. Scelta predefinita per la Modalità Agente.",
+ "bedrock_claude_opus_4_8": "Massima intelligenza. Per compiti complessi in Modalità Agente.",
+ "bedrock_gpt_oss_120b": "Modello aperto di OpenAI. Ottimo ragionamento a basso costo.",
+ "bedrock_deepseek_v3_2": "Modello frontier a pesi aperti. Ottimo valore per la Modalità Agente.",
+ "bedrock_qwen3_next_80b": "Modello aperto sparso. Veloce e multilingue.",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index ca4479424..469b515a8 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "プッシュトゥトークのネイティブリスナーが利用できません"
},
"common": {
+ "retry": "再試行",
"back": "戻る",
"next": "次へ",
"complete": "完了",
@@ -492,6 +493,10 @@
"customModelId": "カスタムモデル ID",
"customModelPlaceholder": "モデル ID またはデプロイメント名を入力",
"suggestedModels": "推奨モデル",
+ "browseModels": "すべてのモデルを表示",
+ "loadingModels": "モデルを取得中...",
+ "allModels": "{{region}} のすべてのモデル",
+ "modelListError": "モデルを読み込めませんでした。",
"bedrock": {
"ssoHelp": "AWS CLI の SSO 設定を使用します。'aws sso login' を実行済みであることを確認してください。",
"keysHelp": "AWS IAM のアクセスキーを入力してください。"
@@ -1921,9 +1926,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "高速で低コスト。テキスト整形に最適です。",
- "bedrock_claude_sonnet_4_6": "バランス型。エージェントモードの既定モデルに最適です。",
- "bedrock_claude_opus_4_7": "最高性能。複雑なエージェントモードのタスクに最適です。",
- "bedrock_nova_lite": "最も安価。AWS ネイティブで大量処理に最適です。",
+ "bedrock_claude_sonnet_5": "バランス型。エージェントモードの既定モデルに最適です。",
+ "bedrock_claude_opus_4_8": "最高性能。複雑なエージェントモードのタスクに最適です。",
+ "bedrock_gpt_oss_120b": "OpenAI のオープンウェイトモデル。低コストで高い推論力。",
+ "bedrock_deepseek_v3_2": "オープンウェイトのフロンティアモデル。エージェントモードに最適。",
+ "bedrock_qwen3_next_80b": "スパースなオープンウェイトモデル。高速で多言語対応。",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index ecfcd71df..e5d4472f3 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -105,6 +105,7 @@
"pttUnavailable": "O listener nativo de Push-to-Talk não está disponível"
},
"common": {
+ "retry": "Tentar novamente",
"back": "Voltar",
"next": "Avançar",
"complete": "Concluir",
@@ -471,6 +472,10 @@
"customModelId": "ID de modelo personalizado",
"customModelPlaceholder": "Informe um ID de modelo ou nome de deployment",
"suggestedModels": "Modelos sugeridos",
+ "browseModels": "Explorar todos os modelos",
+ "loadingModels": "Buscando modelos...",
+ "allModels": "Todos os modelos em {{region}}",
+ "modelListError": "Não foi possível carregar os modelos.",
"bedrock": {
"ssoHelp": "Usa sua configuração SSO do AWS CLI. Certifique-se de ter executado 'aws sso login'.",
"keysHelp": "Informe suas chaves de acesso AWS IAM."
@@ -1900,9 +1905,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "Rápido e barato. Ótimo para limpar texto.",
- "bedrock_claude_sonnet_4_6": "Equilibrado. Padrão recomendado para o Modo Agente.",
- "bedrock_claude_opus_4_7": "Máxima inteligência. Para tarefas complexas do Modo Agente.",
- "bedrock_nova_lite": "Opção mais barata. Nativo da AWS, ideal para alto volume.",
+ "bedrock_claude_sonnet_5": "Equilibrado. Padrão recomendado para o Modo Agente.",
+ "bedrock_claude_opus_4_8": "Máxima inteligência. Para tarefas complexas do Modo Agente.",
+ "bedrock_gpt_oss_120b": "Modelo aberto da OpenAI. Ótimo raciocínio a baixo custo.",
+ "bedrock_deepseek_v3_2": "Modelo de fronteira de pesos abertos. Ótimo custo-benefício para o Modo Agente.",
+ "bedrock_qwen3_next_80b": "Modelo aberto esparso. Rápido e multilíngue.",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index fc6f8a3f1..dffc9e565 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "Нативный слушатель Push-to-Talk недоступен"
},
"common": {
+ "retry": "Повторить",
"back": "Назад",
"next": "Далее",
"complete": "Готово",
@@ -492,6 +493,10 @@
"customModelId": "Пользовательский ID модели",
"customModelPlaceholder": "Введите ID модели или имя развёртывания",
"suggestedModels": "Рекомендуемые модели",
+ "browseModels": "Просмотреть все модели",
+ "loadingModels": "Загрузка моделей...",
+ "allModels": "Все модели в {{region}}",
+ "modelListError": "Не удалось загрузить модели.",
"bedrock": {
"ssoHelp": "Использует настройки SSO из AWS CLI. Убедитесь, что выполнили 'aws sso login'.",
"keysHelp": "Введите ключи доступа AWS IAM."
@@ -1921,9 +1926,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "Быстрая и дешёвая. Отлично подходит для очистки текста.",
- "bedrock_claude_sonnet_4_6": "Сбалансированная. Лучший выбор для режима агента.",
- "bedrock_claude_opus_4_7": "Максимальный интеллект. Для сложных задач в режиме агента.",
- "bedrock_nova_lite": "Самая дешёвая. Нативная для AWS, идеальна для больших объёмов.",
+ "bedrock_claude_sonnet_5": "Сбалансированная. Лучший выбор для режима агента.",
+ "bedrock_claude_opus_4_8": "Максимальный интеллект. Для сложных задач в режиме агента.",
+ "bedrock_gpt_oss_120b": "Открытая модель OpenAI. Сильные рассуждения по низкой цене.",
+ "bedrock_deepseek_v3_2": "Открытая передовая модель. Отличный выбор для режима агента.",
+ "bedrock_qwen3_next_80b": "Разреженная открытая модель. Быстрая и многоязычная.",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 8a727efe4..c0279ba55 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "按住说话原生监听器不可用"
},
"common": {
+ "retry": "重试",
"back": "返回",
"next": "下一步",
"complete": "完成",
@@ -492,6 +493,10 @@
"customModelId": "自定义模型 ID",
"customModelPlaceholder": "输入模型 ID 或部署名称",
"suggestedModels": "推荐模型",
+ "browseModels": "浏览全部模型",
+ "loadingModels": "正在获取模型...",
+ "allModels": "{{region}} 的全部模型",
+ "modelListError": "无法加载模型。",
"bedrock": {
"ssoHelp": "使用你的 AWS CLI SSO 配置。请确保已运行 'aws sso login'。",
"keysHelp": "输入你的 AWS IAM 访问密钥。"
@@ -1916,9 +1921,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "快速且低成本。适合文本清理。",
- "bedrock_claude_sonnet_4_6": "均衡性能。推荐用作智能助手模式的默认模型。",
- "bedrock_claude_opus_4_7": "最高智能。适用于复杂的智能助手模式任务。",
- "bedrock_nova_lite": "最便宜的选择。AWS 原生,适合高流量场景。",
+ "bedrock_claude_sonnet_5": "均衡性能。推荐用作智能助手模式的默认模型。",
+ "bedrock_claude_opus_4_8": "最高智能。适用于复杂的智能助手模式任务。",
+ "bedrock_gpt_oss_120b": "OpenAI 开放权重模型。低成本下的强大推理能力。",
+ "bedrock_deepseek_v3_2": "开放权重前沿模型。智能助手模式的高性价比之选。",
+ "bedrock_qwen3_next_80b": "稀疏开放权重模型。快速且多语言。",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 193d4a361..a4762c3f3 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -126,6 +126,7 @@
"pttUnavailable": "按住說話原生監聽程式無法使用"
},
"common": {
+ "retry": "重試",
"back": "返回",
"next": "下一步",
"complete": "完成",
@@ -492,6 +493,10 @@
"customModelId": "自訂模型 ID",
"customModelPlaceholder": "輸入模型 ID 或部署名稱",
"suggestedModels": "建議模型",
+ "browseModels": "瀏覽全部模型",
+ "loadingModels": "正在取得模型...",
+ "allModels": "{{region}} 的全部模型",
+ "modelListError": "無法載入模型。",
"bedrock": {
"ssoHelp": "使用你的 AWS CLI SSO 設定。請確保已執行 'aws sso login'。",
"keysHelp": "輸入你的 AWS IAM 存取金鑰。"
@@ -1916,9 +1921,11 @@
},
"enterprise": {
"bedrock_claude_haiku_4_5": "快速且低成本。適合文字清理。",
- "bedrock_claude_sonnet_4_6": "均衡效能。建議作為智慧助手模式的預設模型。",
- "bedrock_claude_opus_4_7": "最高智能。適用於複雜的智慧助手模式任務。",
- "bedrock_nova_lite": "最便宜的選擇。AWS 原生,適合高流量場景。",
+ "bedrock_claude_sonnet_5": "均衡效能。建議作為智慧助手模式的預設模型。",
+ "bedrock_claude_opus_4_8": "最高智能。適用於複雜的智慧助手模式任務。",
+ "bedrock_gpt_oss_120b": "OpenAI 開放權重模型。低成本下的強大推理能力。",
+ "bedrock_deepseek_v3_2": "開放權重前沿模型。智慧助手模式的高性價比之選。",
+ "bedrock_qwen3_next_80b": "稀疏開放權重模型。快速且多語言。",
"vertex_gemini_2_5_flash": "Fast multimodal model via Vertex",
"vertex_gemini_2_5_pro": "Advanced reasoning via Vertex"
},
diff --git a/src/models/modelRegistryData.json b/src/models/modelRegistryData.json
index e956be8b9..3a329719f 100644
--- a/src/models/modelRegistryData.json
+++ b/src/models/modelRegistryData.json
@@ -508,22 +508,34 @@
"descriptionKey": "models.descriptions.enterprise.bedrock_claude_haiku_4_5"
},
{
- "id": "us.anthropic.claude-sonnet-4-6",
- "name": "Claude Sonnet 4.6",
+ "id": "us.anthropic.claude-sonnet-5",
+ "name": "Claude Sonnet 5",
"description": "Balanced workhorse. Best default for Agent Mode.",
- "descriptionKey": "models.descriptions.enterprise.bedrock_claude_sonnet_4_6"
+ "descriptionKey": "models.descriptions.enterprise.bedrock_claude_sonnet_5"
},
{
- "id": "us.anthropic.claude-opus-4-7",
- "name": "Claude Opus 4.7",
+ "id": "us.anthropic.claude-opus-4-8",
+ "name": "Claude Opus 4.8",
"description": "Max intelligence. Best for complex Agent Mode tasks.",
- "descriptionKey": "models.descriptions.enterprise.bedrock_claude_opus_4_7"
+ "descriptionKey": "models.descriptions.enterprise.bedrock_claude_opus_4_8"
+ },
+ {
+ "id": "openai.gpt-oss-120b-1:0",
+ "name": "GPT-OSS 120B",
+ "description": "Open-weight OpenAI model. Strong reasoning at low cost.",
+ "descriptionKey": "models.descriptions.enterprise.bedrock_gpt_oss_120b"
+ },
+ {
+ "id": "deepseek.v3.2",
+ "name": "DeepSeek V3.2",
+ "description": "Open-weight frontier model. Great value for Agent Mode.",
+ "descriptionKey": "models.descriptions.enterprise.bedrock_deepseek_v3_2"
},
{
- "id": "us.amazon.nova-lite-v1:0",
- "name": "Amazon Nova Lite",
- "description": "Cheapest option. AWS-native, ideal for high volume.",
- "descriptionKey": "models.descriptions.enterprise.bedrock_nova_lite"
+ "id": "qwen.qwen3-next-80b-a3b",
+ "name": "Qwen3 Next 80B",
+ "description": "Sparse open-weight model. Fast and multilingual.",
+ "descriptionKey": "models.descriptions.enterprise.bedrock_qwen3_next_80b"
}
]
},
diff --git a/src/services/ReasoningService.ts b/src/services/ReasoningService.ts
index eeff93301..7a0d1ee21 100644
--- a/src/services/ReasoningService.ts
+++ b/src/services/ReasoningService.ts
@@ -4,6 +4,7 @@ import {
getOpenAiApiConfig,
getProviderDisplayName,
isEnterpriseProvider,
+ type EnterpriseProvider,
} from "../models/ModelRegistry";
import { BaseReasoningService, ReasoningConfig } from "./BaseReasoningService";
import { SecureCache } from "../utils/SecureCache";
@@ -14,6 +15,7 @@ import { getSettings, isCloudCleanupMode } from "../stores/settingsStore";
import { wrapCleanupTranscript } from "../config/prompts";
import { streamText, stepCountIs } from "ai";
import { getAIModel } from "./ai/providers";
+import { createEnterpriseChatModel } from "./ai/enterpriseChatModel";
import { PROVIDER_REGISTRY, type ProviderContext } from "./ai/inferenceProviders";
import { getConfiguredOpenAIBase } from "./ai/openaiBase";
import { applyThinkingSuppression } from "./ai/thinkingSuppression";
@@ -565,12 +567,10 @@ class ReasoningService extends BaseReasoningService {
config: ReasoningConfig & { systemPrompt: string },
tools?: Record<string, import("ai").Tool>
): AsyncGenerator<AgentStreamChunk, void, unknown> {
- if (isEnterpriseProvider(provider)) {
- throw new Error(
- "Agent Mode is not yet supported with enterprise providers (Bedrock/Azure/Vertex). " +
- "Switch to Cloud or Local for Agent Mode, or use this provider for text cleanup only."
- );
- }
+ const lanOverride = config.lanUrl?.trim();
+ // An explicit self-hosted URL is the caller's declared route — it must win
+ // even when a stale enterprise provider id is left in the scope's settings.
+ const isEnterprise = !lanOverride && isEnterpriseProvider(provider);
const cloudProviders = [
"openai",
@@ -581,11 +581,10 @@ class ReasoningService extends BaseReasoningService {
"custom",
"openrouter",
];
- const isLocalProvider = !cloudProviders.includes(provider);
+ const isLocalProvider = !isEnterprise && !cloudProviders.includes(provider);
const settings = getSettings();
- const lanOverride = config.lanUrl?.trim();
- const isLanCleanup = !!lanOverride || this.isLanCleanupMode();
+ const isLanCleanup = !isEnterprise && (!!lanOverride || this.isLanCleanupMode());
if ((isLocalProvider || isLanCleanup) && !tools) {
const contentGen = this.processTextStreaming(messages, model, provider, config);
@@ -599,7 +598,10 @@ class ReasoningService extends BaseReasoningService {
let apiKey = "";
let baseURL: string | undefined;
- if (isLanCleanup) {
+ if (isEnterprise) {
+ // Enterprise SDKs run in the main process; the model below proxies
+ // doStream over IPC, so no key or base URL is resolved here.
+ } else if (isLanCleanup) {
const rawUrl = lanOverride || settings.cleanupRemoteUrl.trim();
baseURL = ensureV1Suffix(rawUrl);
} else if (isLocalProvider) {
@@ -625,9 +627,11 @@ class ReasoningService extends BaseReasoningService {
// exemption below can't apply — honor the toggle directly.
const openrouterDisableThinking = provider === "openrouter" && config.disableThinking === true;
// Resolving a Tinfoil model refreshes the registry, so read model config after it.
- const aiModel = await getAIModel(aiProvider, model, apiKey, baseURL, {
- disableThinking: openrouterDisableThinking,
- });
+ const aiModel = isEnterprise
+ ? createEnterpriseChatModel(provider as EnterpriseProvider, model)
+ : await getAIModel(aiProvider, model, apiKey, baseURL, {
+ disableThinking: openrouterDisableThinking,
+ });
const apiConfig = getOpenAiApiConfig(model, provider);
const modelDef = getCloudModel(model);
@@ -653,6 +657,11 @@ class ReasoningService extends BaseReasoningService {
const useTemperature = isLocalProvider || isLanCleanup || apiConfig.supportsTemperature;
+ // cancelActiveStream() aborts this controller; streamText propagates it
+ // into doStream, cancelling the enterprise IPC proxy's request in main.
+ const abortController = new AbortController();
+ this.streamAbortController = abortController;
+
const result = streamText({
model: aiModel,
messages: messages.map((m) => ({
@@ -661,37 +670,50 @@ class ReasoningService extends BaseReasoningService {
})),
tools: tools || undefined,
stopWhen: stepCountIs(tools ? ReasoningService.MAX_TOOL_STEPS : 1),
+ abortSignal: abortController.signal,
...(useTemperature ? { temperature: config.temperature ?? 0.3 } : {}),
maxOutputTokens: config.maxTokens || 4096,
...(hasProviderOptions ? { providerOptions } : {}),
});
- for await (const chunk of result.fullStream) {
- if (chunk.type === "text-delta") {
- yield { type: "content", text: chunk.text };
- } else if (chunk.type === "tool-call") {
- yield {
- type: "tool_calls",
- calls: [
- {
- id: chunk.toolCallId,
- name: chunk.toolName,
- arguments: JSON.stringify(chunk.input),
- },
- ],
- };
- } else if (chunk.type === "tool-result") {
- const output = chunk.output;
- const displayText =
- typeof output === "string" ? output : output?.error ? String(output.error) : "Done";
- yield {
- type: "tool_result",
- callId: chunk.toolCallId,
- toolName: chunk.toolName,
- displayText,
- };
- } else if (chunk.type === "finish") {
- yield { type: "done", finishReason: chunk.finishReason };
+ try {
+ for await (const chunk of result.fullStream) {
+ if (chunk.type === "text-delta") {
+ yield { type: "content", text: chunk.text };
+ } else if (chunk.type === "tool-call") {
+ yield {
+ type: "tool_calls",
+ calls: [
+ {
+ id: chunk.toolCallId,
+ name: chunk.toolName,
+ arguments: JSON.stringify(chunk.input),
+ },
+ ],
+ };
+ } else if (chunk.type === "tool-result") {
+ const output = chunk.output;
+ const displayText =
+ typeof output === "string" ? output : output?.error ? String(output.error) : "Done";
+ yield {
+ type: "tool_result",
+ callId: chunk.toolCallId,
+ toolName: chunk.toolName,
+ displayText,
+ };
+ } else if (chunk.type === "finish") {
+ yield { type: "done", finishReason: chunk.finishReason };
+ }
+ }
+ } catch (error) {
+ if (abortController.signal.aborted) {
+ yield { type: "done", finishReason: "stop" };
+ return;
+ }
+ throw error;
+ } finally {
+ if (this.streamAbortController === abortController) {
+ this.streamAbortController = null;
}
}
}
diff --git a/src/services/ai/enterpriseChatModel.ts b/src/services/ai/enterpriseChatModel.ts
new file mode 100644
index 000000000..842adf387
--- /dev/null
+++ b/src/services/ai/enterpriseChatModel.ts
@@ -0,0 +1,118 @@
+import type {
+ LanguageModelV3,
+ LanguageModelV3CallOptions,
+ LanguageModelV3StreamPart,
+} from "@ai-sdk/provider";
+import type { EnterpriseProvider } from "../../models/ModelRegistry";
+import { getEnterpriseCallSettings } from "./enterpriseSettings";
+
+// Enterprise SDKs (Bedrock/Azure/Vertex) must run in the main process — SigV4
+// signing and CORS rule out renderer fetches. This LanguageModelV3 shim keeps
+// streamText and tool execution in the renderer while proxying doStream over
+// IPC: main runs the provider stream and relays each part verbatim.
+
+// Structured-clone whitelist — abortSignal and other non-serializable call
+// options must not cross the IPC boundary.
+const SERIALIZABLE_OPTION_KEYS = [
+ "prompt",
+ "maxOutputTokens",
+ "temperature",
+ "stopSequences",
+ "topP",
+ "topK",
+ "presencePenalty",
+ "frequencyPenalty",
+ "responseFormat",
+ "seed",
+ "tools",
+ "toolChoice",
+ "providerOptions",
+] as const;
+
+function pickSerializableOptions(options: LanguageModelV3CallOptions) {
+ const picked: Record<string, unknown> = {};
+ for (const key of SERIALIZABLE_OPTION_KEYS) {
+ const value = options[key];
+ if (value !== undefined) picked[key] = value;
+ }
+ return picked;
+}
+
+export function createEnterpriseChatModel(
+ provider: EnterpriseProvider,
+ modelId: string
+): LanguageModelV3 {
+ return {
+ specificationVersion: "v3",
+ provider: `enterprise.${provider}`,
+ modelId,
+ supportedUrls: {},
+
+ async doGenerate() {
+ throw new Error("Enterprise chat models are streaming-only; use doStream.");
+ },
+
+ async doStream(options: LanguageModelV3CallOptions) {
+ const api = window.electronAPI;
+ if (!api?.enterpriseStreamStart || !api.onEnterpriseStreamPart) {
+ throw new Error("Enterprise streaming is not available in this environment");
+ }
+
+ const streamId = crypto.randomUUID();
+ const config = getEnterpriseCallSettings(provider);
+ let unsubscribe: (() => void) | undefined;
+ const stopListening = () => {
+ unsubscribe?.();
+ unsubscribe = undefined;
+ };
+
+ const stream = new ReadableStream<LanguageModelV3StreamPart>({
+ start: (controller) => {
+ let settled = false;
+ const fail = (message: string) => {
+ if (settled) return;
+ settled = true;
+ stopListening();
+ controller.error(new Error(message));
+ };
+
+ unsubscribe = api.onEnterpriseStreamPart!((payload) => {
+ if (payload.streamId !== streamId) return;
+ if (payload.error) {
+ fail(payload.error);
+ } else if (payload.done) {
+ if (settled) return;
+ settled = true;
+ stopListening();
+ controller.close();
+ } else if (payload.part) {
+ controller.enqueue(payload.part as LanguageModelV3StreamPart);
+ }
+ });
+
+ options.abortSignal?.addEventListener("abort", () => {
+ api.enterpriseStreamCancel?.(streamId);
+ });
+
+ api.enterpriseStreamStart!({
+ streamId,
+ provider,
+ modelId,
+ config,
+ options: pickSerializableOptions(options),
+ })
+ .then((result) => {
+ if (result && !result.success) fail(result.error || "Enterprise stream failed");
+ })
+ .catch((error: Error) => fail(error.message));
+ },
+ cancel: () => {
+ stopListening();
+ api.enterpriseStreamCancel?.(streamId);
+ },
+ });
+
+ return { stream };
+ },
+ };
+}
diff --git a/src/services/ai/enterpriseSettings.ts b/src/services/ai/enterpriseSettings.ts
new file mode 100644
index 000000000..2acad31ee
--- /dev/null
+++ b/src/services/ai/enterpriseSettings.ts
@@ -0,0 +1,31 @@
+import { getSettings } from "../../stores/settingsStore";
+import type { EnterpriseProvider } from "../../models/ModelRegistry";
+
+export type EnterpriseCallSettings = {
+ apiKey: string;
+ bedrockRegion: string;
+ bedrockProfile: string;
+ bedrockAccessKeyId: string;
+ bedrockSecretAccessKey: string;
+ bedrockSessionToken: string;
+ azureEndpoint: string;
+ azureApiVersion: string;
+ vertexProject: string;
+ vertexLocation: string;
+};
+
+export function getEnterpriseCallSettings(provider: EnterpriseProvider): EnterpriseCallSettings {
+ const s = getSettings();
+ return {
+ apiKey: provider === "azure" ? s.azureApiKey : provider === "vertex" ? s.vertexApiKey : "",
+ bedrockRegion: s.bedrockRegion,
+ bedrockProfile: s.bedrockProfile,
+ bedrockAccessKeyId: s.bedrockAccessKeyId,
+ bedrockSecretAccessKey: s.bedrockSecretAccessKey,
+ bedrockSessionToken: s.bedrockSessionToken,
+ azureEndpoint: s.azureEndpoint,
+ azureApiVersion: s.azureApiVersion,
+ vertexProject: s.vertexProject,
+ vertexLocation: s.vertexLocation,
+ };
+}
diff --git a/src/services/ai/inferenceProviders/enterprise.ts b/src/services/ai/inferenceProviders/enterprise.ts
index 4400c52cc..4eb98f047 100644
--- a/src/services/ai/inferenceProviders/enterprise.ts
+++ b/src/services/ai/inferenceProviders/enterprise.ts
@@ -5,6 +5,7 @@ import {
type EnterpriseProvider as EnterpriseProviderId,
} from "../../../models/ModelRegistry";
import { getSettings } from "../../../stores/settingsStore";
+import { getEnterpriseCallSettings } from "../enterpriseSettings";
import { wrapCleanupTranscript } from "../../../config/prompts";
import logger from "../../../utils/logger";
@@ -15,7 +16,7 @@ export const enterpriseProvider: InferenceProvider = {
throw new Error("Enterprise reasoning is not available in this environment");
}
- const provider = getSettings().cleanupProvider;
+ const provider = config.provider || getSettings().cleanupProvider;
if (!isEnterpriseProvider(provider)) {
throw new Error(`Unsupported enterprise provider: ${provider}`);
}
@@ -25,9 +26,6 @@ export const enterpriseProvider: InferenceProvider = {
const systemPrompt = config.systemPrompt || ctx.getSystemPrompt(agentName);
const userContent = config.systemPrompt ? text : wrapCleanupTranscript(text);
- const s = getSettings();
- const apiKey =
- enterpriseId === "azure" ? s.azureApiKey : enterpriseId === "vertex" ? s.vertexApiKey : "";
const { supportsTemperature } = getOpenAiApiConfig(model);
const startTime = Date.now();
@@ -39,17 +37,8 @@ export const enterpriseProvider: InferenceProvider = {
...config,
systemPrompt,
provider: enterpriseId,
- apiKey,
supportsTemperature,
- bedrockRegion: s.bedrockRegion,
- bedrockProfile: s.bedrockProfile,
- bedrockAccessKeyId: s.bedrockAccessKeyId,
- bedrockSecretAccessKey: s.bedrockSecretAccessKey,
- bedrockSessionToken: s.bedrockSessionToken,
- azureEndpoint: s.azureEndpoint,
- azureApiVersion: s.azureApiVersion,
- vertexProject: s.vertexProject,
- vertexLocation: s.vertexLocation,
+ ...getEnterpriseCallSettings(enterpriseId),
}
);
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 7e24f4529..ec18d4914 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -875,6 +875,27 @@ declare global {
agentName: string | null,
config: any
) => Promise<{ success: boolean; text?: string; error?: string; retryable?: boolean }>;
+ enterpriseStreamStart?: (payload: {
+ streamId: string;
+ provider: string;
+ modelId: string;
+ config: Record<string, string>;
+ options: Record<string, unknown>;
+ }) => Promise<{ success: boolean; error?: string }>;
+ enterpriseStreamCancel?: (streamId: string) => Promise<void>;
+ onEnterpriseStreamPart?: (
+ callback: (payload: {
+ streamId: string;
+ part?: unknown;
+ done?: boolean;
+ error?: string;
+ }) => void
+ ) => () => void;
+ listBedrockModels?: (config: Record<string, string>) => Promise<{
+ success: boolean;
+ models?: Array<{ value: string; label: string; vendor: string }>;
+ error?: string;
+ }>;
// llama.cpp management
llamaCppCheck: () => Promise<{ isInstalled: boolean; version?: string }>;
diff --git a/src/utils/bedrockRegions.ts b/src/utils/bedrockRegions.ts
new file mode 100644
index 000000000..aa2680c68
--- /dev/null
+++ b/src/utils/bedrockRegions.ts
@@ -0,0 +1,17 @@
+// Bedrock cross-region inference profile IDs are geo-scoped (us./eu./apac.)
+// and only resolve in regions within that geography. On-demand models use
+// bare, prefix-free IDs that work in any region serving them.
+
+const GEO_PROFILE_PATTERN = /^(us|eu|apac)\.(.+)$/;
+
+export function bedrockGeoPrefix(region: string): "us" | "eu" | "apac" {
+ if (region.startsWith("eu-")) return "eu";
+ if (region.startsWith("ap-")) return "apac";
+ return "us";
+}
+
+export function adjustBedrockModelForRegion(modelId: string, region: string): string {
+ const match = GEO_PROFILE_PATTERN.exec(modelId);
+ if (!match) return modelId;
+ return `${bedrockGeoPrefix(region)}.${match[2]}`;
+}
diff --git a/test/helpers/bedrockCatalog.test.js b/test/helpers/bedrockCatalog.test.js
new file mode 100644
index 000000000..ebe9d8059
--- /dev/null
+++ b/test/helpers/bedrockCatalog.test.js
@@ -0,0 +1,98 @@
+const test = require("node:test");
+const assert = require("node:assert/strict");
+
+const { normalizeBedrockCatalog } = require("../../src/helpers/bedrockCatalog");
+
+const arn = (modelId) => `arn:aws:bedrock:eu-west-2::foundation-model/${modelId}`;
+
+const MODELS = [
+ {
+ modelId: "anthropic.claude-haiku-4-5-20251001-v1:0",
+ modelName: "Claude Haiku 4.5",
+ providerName: "Anthropic",
+ outputModalities: ["TEXT"],
+ inferenceTypesSupported: ["INFERENCE_PROFILE"],
+ modelLifecycle: { status: "ACTIVE" },
+ },
+ {
+ modelId: "openai.gpt-oss-120b-1:0",
+ modelName: "GPT-OSS 120B",
+ providerName: "OpenAI",
+ outputModalities: ["TEXT"],
+ inferenceTypesSupported: ["ON_DEMAND"],
+ modelLifecycle: { status: "ACTIVE" },
+ },
+ {
+ modelId: "amazon.nova-lite-v1:0",
+ modelName: "Nova Lite",
+ providerName: "Amazon",
+ outputModalities: ["TEXT"],
+ inferenceTypesSupported: ["ON_DEMAND", "INFERENCE_PROFILE"],
+ modelLifecycle: { status: "ACTIVE" },
+ },
+ {
+ modelId: "amazon.nova-lite-v1:0:24k",
+ modelName: "Nova Lite 24K",
+ providerName: "Amazon",
+ outputModalities: ["TEXT"],
+ inferenceTypesSupported: ["PROVISIONED"],
+ modelLifecycle: { status: "ACTIVE" },
+ },
+ {
+ modelId: "amazon.titan-image-generator-v1",
+ modelName: "Titan Image Generator",
+ providerName: "Amazon",
+ outputModalities: ["IMAGE"],
+ inferenceTypesSupported: ["ON_DEMAND"],
+ modelLifecycle: { status: "ACTIVE" },
+ },
+ {
+ modelId: "anthropic.claude-v2",
+ modelName: "Claude 2",
+ providerName: "Anthropic",
+ outputModalities: ["TEXT"],
+ inferenceTypesSupported: ["ON_DEMAND"],
+ modelLifecycle: { status: "LEGACY" },
+ },
+];
+
+const PROFILES = [
+ {
+ inferenceProfileId: "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
+ models: [{ modelArn: arn("anthropic.claude-haiku-4-5-20251001-v1:0") }],
+ },
+];
+
+test("resolves profile-only models to the region's inference profile ID", () => {
+ const models = normalizeBedrockCatalog(MODELS, PROFILES);
+ const haiku = models.find((m) => m.label === "Claude Haiku 4.5");
+ assert.equal(haiku.value, "eu.anthropic.claude-haiku-4-5-20251001-v1:0");
+ assert.equal(haiku.vendor, "Anthropic");
+});
+
+test("keeps bare IDs for on-demand models", () => {
+ const models = normalizeBedrockCatalog(MODELS, PROFILES);
+ assert.ok(models.some((m) => m.value === "openai.gpt-oss-120b-1:0"));
+ assert.ok(models.some((m) => m.value === "amazon.nova-lite-v1:0"));
+});
+
+test("drops provisioned-only variants, non-text, non-active, and unresolvable models", () => {
+ const models = normalizeBedrockCatalog(MODELS, PROFILES);
+ const values = models.map((m) => m.value);
+ assert.ok(!values.some((v) => v.includes(":24k")));
+ assert.ok(!values.some((v) => v.includes("titan-image")));
+ assert.ok(!values.some((v) => v.includes("claude-v2")));
+
+ const noProfile = normalizeBedrockCatalog(
+ [{ ...MODELS[0], inferenceTypesSupported: ["INFERENCE_PROFILE"] }],
+ []
+ );
+ assert.equal(noProfile.length, 0);
+});
+
+test("sorts by vendor then label and dedupes by value", () => {
+ const models = normalizeBedrockCatalog([...MODELS, MODELS[1]], PROFILES);
+ assert.equal(models.filter((m) => m.value === "openai.gpt-oss-120b-1:0").length, 1);
+ const vendors = models.map((m) => m.vendor);
+ assert.deepEqual(vendors, [...vendors].sort((a, b) => a.localeCompare(b)));
+});
diff --git a/test/utils/bedrockRegions.test.js b/test/utils/bedrockRegions.test.js
new file mode 100644
index 000000000..8a7b8992d
--- /dev/null
+++ b/test/utils/bedrockRegions.test.js
@@ -0,0 +1,53 @@
+const test = require("node:test");
+const assert = require("node:assert/strict");
+
+// Requires Node's native TypeScript type-stripping (Node >= 22.6 with
+// --experimental-strip-types, on by default in Node 23.6+/24). CI runs Node 24.
+
+test("bedrockGeoPrefix maps regions to inference profile geographies", async () => {
+ const { bedrockGeoPrefix } = await import("../../src/utils/bedrockRegions.ts");
+
+ assert.equal(bedrockGeoPrefix("us-east-1"), "us");
+ assert.equal(bedrockGeoPrefix("us-west-2"), "us");
+ assert.equal(bedrockGeoPrefix("ca-central-1"), "us");
+ assert.equal(bedrockGeoPrefix("eu-west-2"), "eu");
+ assert.equal(bedrockGeoPrefix("eu-central-1"), "eu");
+ assert.equal(bedrockGeoPrefix("ap-southeast-1"), "apac");
+ assert.equal(bedrockGeoPrefix("ap-northeast-1"), "apac");
+});
+
+test("adjustBedrockModelForRegion rewrites geo-prefixed profile IDs", async () => {
+ const { adjustBedrockModelForRegion } = await import("../../src/utils/bedrockRegions.ts");
+
+ assert.equal(
+ adjustBedrockModelForRegion("us.anthropic.claude-haiku-4-5-20251001-v1:0", "eu-west-2"),
+ "eu.anthropic.claude-haiku-4-5-20251001-v1:0"
+ );
+ assert.equal(
+ adjustBedrockModelForRegion("eu.anthropic.claude-sonnet-4-6", "us-east-1"),
+ "us.anthropic.claude-sonnet-4-6"
+ );
+ assert.equal(
+ adjustBedrockModelForRegion("apac.anthropic.claude-opus-4-7", "ap-southeast-2"),
+ "apac.anthropic.claude-opus-4-7"
+ );
+});
+
+test("adjustBedrockModelForRegion leaves on-demand and custom IDs untouched", async () => {
+ const { adjustBedrockModelForRegion } = await import("../../src/utils/bedrockRegions.ts");
+
+ assert.equal(
+ adjustBedrockModelForRegion("openai.gpt-oss-120b-1:0", "eu-west-2"),
+ "openai.gpt-oss-120b-1:0"
+ );
+ assert.equal(adjustBedrockModelForRegion("deepseek.v3.2", "ap-south-1"), "deepseek.v3.2");
+ assert.equal(
+ adjustBedrockModelForRegion("amazon.nova-lite-v1:0", "eu-west-2"),
+ "amazon.nova-lite-v1:0"
+ );
+ assert.equal(adjustBedrockModelForRegion("", "eu-west-2"), "");
+ assert.equal(
+ adjustBedrockModelForRegion("arn:aws:bedrock:eu-west-2:123:inference-profile/x", "eu-west-2"),
+ "arn:aws:bedrock:eu-west-2:123:inference-profile/x"
+ );
+});