Skip to content

Commit 8430e60

Browse files
mrubensroomote
andauthored
[Fix] Route Amazon Bedrock API keys through Mantle (#245)
* [Fix] Route Amazon Bedrock through Mantle * [Fix] Resolve Mantle model metadata --------- Co-authored-by: Roomote <roomote@roocode.com>
1 parent 238a6b1 commit 8430e60

16 files changed

Lines changed: 345 additions & 48 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@roomote/web': patch
3+
---
4+
5+
Route Amazon Bedrock API keys through the Mantle endpoint and clarify Mantle key setup in model settings.

apps/docs/environment-variables.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ as per-task auth tokens or workspace paths.
179179
| `OPENCODE_API_KEY` | Provider key | OpenCode Zen / Go API key. |
180180
| `GEMINI_API_KEY` | Provider key | Google Gemini API key. Can also be saved from **Settings > Models**. |
181181
| `GOOGLE_GENERATIVE_AI_API_KEY` | Provider key | Alternate Google/Gemini provider key forwarded when configured or inferred. |
182-
| `AWS_BEARER_TOKEN_BEDROCK` | Provider key | Amazon Bedrock API key (bearer token). Can also be saved from **Settings > Models**. |
183-
| `AWS_REGION` | Provider key | AWS region for Amazon Bedrock models. Defaults to `us-east-1` at the runtime when unset. |
182+
| `AWS_BEARER_TOKEN_BEDROCK` | Provider key | Amazon Bedrock Mantle API key. Can also be saved from **Settings > Models**. |
183+
| `AWS_REGION` | Provider key | AWS region where the Bedrock API key was created. Defaults to `us-east-1` at runtime when unset. |
184184
| `GOOGLE_APPLICATION_CREDENTIALS` | Provider key | Google Vertex AI service account credentials: a file path, or pasted JSON contents that Roomote materializes to a file for the runtime. |
185185
| `GOOGLE_VERTEX_PROJECT` | Provider key | Google Cloud project ID for Vertex AI models. |
186186
| `GOOGLE_VERTEX_LOCATION` | Provider key | Vertex AI location. Defaults to `us-central1` at the runtime when unset. |

apps/docs/models.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ in the setup wizard and from **Settings > Models**. You stay in control: you
3737
can disable or remove any of the added models, add more later, and reconnecting
3838
a provider never re-adds models you removed.
3939

40+
### Amazon Bedrock
41+
42+
Roomote connects Amazon Bedrock through the Bedrock Mantle endpoint used by
43+
AWS's current API-key console. Generate a short-term or long-term Bedrock API
44+
key in the AWS console, save it from **Settings > Models**, and set the AWS
45+
region where the key was created. Bedrock model IDs use the
46+
`bedrock-mantle/` prefix, for example:
47+
48+
```text
49+
bedrock-mantle/anthropic.claude-haiku-4-5
50+
bedrock-mantle/anthropic.claude-sonnet-5
51+
```
52+
53+
Short-term keys expire with the AWS console session (and after at most 12
54+
hours), so replace the saved key when it expires.
55+
4056
### ChatGPT subscription
4157

4258
Roomote also supports connecting a **ChatGPT (subscription)** provider, which
@@ -82,6 +98,7 @@ openai/gpt-5.6-terra
8298
vercel/openai/gpt-5.6-terra
8399
baseten/moonshotai/Kimi-K2.7-Code
84100
togetherai/deepseek-ai/DeepSeek-V4-Pro
101+
bedrock-mantle/anthropic.claude-sonnet-5
85102
```
86103

87104
The prefix matters because two providers can expose similar model families with

apps/web/src/components/settings/InferenceProviderSection.test.tsx

Lines changed: 18 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/web/src/components/settings/InferenceProviderSection.tsx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,32 @@ function ProviderCredentialsDialog({
321321
<span className="text-sm font-medium">
322322
{primaryCredentialLabel}
323323
</span>
324-
<Input
325-
secret
326-
className="font-mono"
327-
value={apiKey}
328-
onChange={(event) => setApiKey(event.target.value)}
329-
placeholder={`${primaryCredentialLabel} for ${selectedProvider.label}`}
330-
disabled={isSaving}
331-
aria-label={`${mode === 'edit' ? 'New ' : ''}${primaryCredentialLabel} for ${selectedProvider.label}`}
332-
data-1p-ignore
333-
/>
324+
<div className="space-y-1.5">
325+
<Input
326+
secret
327+
className="font-mono"
328+
value={apiKey}
329+
onChange={(event) => setApiKey(event.target.value)}
330+
placeholder={`${primaryCredentialLabel} for ${selectedProvider.label}`}
331+
disabled={isSaving}
332+
aria-label={`${mode === 'edit' ? 'New ' : ''}${primaryCredentialLabel} for ${selectedProvider.label}`}
333+
data-1p-ignore
334+
/>
335+
{selectedProvider.credentialHelp ? (
336+
<p className="text-xs text-muted-foreground">
337+
{selectedProvider.credentialHelp.text}{' '}
338+
<a
339+
className="font-medium underline underline-offset-2 hover:text-foreground"
340+
href={selectedProvider.credentialHelp.href}
341+
target="_blank"
342+
rel="noreferrer"
343+
>
344+
{selectedProvider.credentialHelp.linkLabel}
345+
</a>
346+
.
347+
</p>
348+
) : null}
349+
</div>
334350
</div>
335351
{additionalEnvFields.map((field) => (
336352
<div

apps/web/src/trpc/commands/task-models/models-dev.test.ts

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/web/src/trpc/commands/task-models/models-dev.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
} from '@roomote/types';
66

77
const MODELS_DEV_CATALOG_URL = 'https://models.dev/catalog.json';
8+
const BEDROCK_MANTLE_PROVIDER_PREFIX = 'bedrock-mantle/';
89

910
type ModelsDevModalities = {
1011
input?: string[];
@@ -173,6 +174,8 @@ export async function fetchModelsDevCatalog(
173174
* Resolves the models.dev catalog slug for a Roomote task model id.
174175
* Strips a leading gateway provider prefix (`openrouter/`, `vercel/`,
175176
* `requesty/`, `baseten/`, `togetherai/`) and any leading `~` alias marker.
177+
* Mantle's `lab.model` identifiers are converted to models.dev's `lab/model`
178+
* slugs so metadata continues to resolve through the underlying model lab.
176179
*/
177180
export function resolveModelsDevSlug(modelId: string): string {
178181
let slug = modelId;
@@ -186,6 +189,13 @@ export function resolveModelsDevSlug(modelId: string): string {
186189
if (slug.startsWith('~')) {
187190
slug = slug.slice(1);
188191
}
192+
if (slug.startsWith(BEDROCK_MANTLE_PROVIDER_PREFIX)) {
193+
const mantleModelId = slug.slice(BEDROCK_MANTLE_PROVIDER_PREFIX.length);
194+
const labSeparatorIndex = mantleModelId.indexOf('.');
195+
if (labSeparatorIndex > 0) {
196+
return `${mantleModelId.slice(0, labSeparatorIndex)}/${mantleModelId.slice(labSeparatorIndex + 1)}`;
197+
}
198+
}
189199
return slug;
190200
}
191201

apps/worker/src/run-task/agent-home.test.ts

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)