Skip to content

Commit 6b51e1a

Browse files
st-grclaude
andcommitted
feat(providers): add aws-bedrock provider profile + discovery spec
Adds `aws-bedrock` to the built-in provider catalog so operators can run `openshell provider create --type aws-bedrock --credential ...` and have the gateway treat it as a first-class inference provider alongside `anthropic`, `openai`, etc. - `providers/aws-bedrock.yaml`: YAML profile declaring four credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION). Default endpoint is `bedrock-runtime.us-east-1.amazonaws.com:443`; operators in other regions or running against a Bedrock-compatible proxy override via the operator-supplied `BEDROCK_BASE_URL` config-key (mirrors `ANTHROPIC_BASE_URL` for the `anthropic` provider). - `crates/openshell-providers/src/providers/aws_bedrock.rs`: the `ProviderDiscoverySpec` so `openshell provider create --auto-providers` picks up AWS_* env vars from local credentials. - `crates/openshell-providers/src/providers/mod.rs`: register the module. - `crates/openshell-providers/src/lib.rs`: register the SPEC in the default registry alongside the other providers. - `crates/openshell-providers/src/profiles.rs`: include the new YAML in `BUILT_IN_PROFILE_YAMLS`. What this PR explicitly does NOT add (intentionally separated for review-size reasons; will follow up): - A SigV4 signer in `openshell-router`. The current change simply declares the protocol; a follow-up PR adds outbound SigV4 signing using the `aws-sigv4` crate and a new `auth_style: sigv4` validator branch in profiles.rs. Operators who don't need SigV4 (e.g. an in-cluster bridge that ignores it and authenticates separately to the upstream) can use this PR today. - Body translation between Bedrock InvokeModel shape and other inference shapes. The router treats Bedrock requests as opaque pass-through; if the operator's upstream is real AWS Bedrock it speaks Bedrock natively, if it's a translating bridge the bridge does any conversion server-side. - `BEDROCK_BASE_URL` placeholder substitution in the YAML loader. Today the YAML's `host` is a literal default; operators override with the config-key the same way `ANTHROPIC_BASE_URL` works. Tested: `cargo test -p openshell-providers` (35 tests green) and `cargo test -p openshell-sandbox --lib l7::inference` (40 tests green including the seven new aws_bedrock cases from the previous commit). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: st-gr <[email protected]>
1 parent 8b30211 commit 6b51e1a

5 files changed

Lines changed: 61 additions & 0 deletions

File tree

‎crates/openshell-providers/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ impl ProviderRegistry {
115115
registry.register(providers::generic::GenericProvider);
116116
registry.register(providers::openai::SPEC);
117117
registry.register(providers::anthropic::SPEC);
118+
registry.register(providers::aws_bedrock::SPEC);
118119
registry.register(providers::nvidia::SPEC);
119120
registry.register(providers::gitlab::SPEC);
120121
registry.register(providers::github::SPEC);

‎crates/openshell-providers/src/profiles.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::collections::{HashMap, HashSet};
1717
use std::sync::OnceLock;
1818

1919
const BUILT_IN_PROFILE_YAMLS: &[&str] = &[
20+
include_str!("../../../providers/aws-bedrock.yaml"),
2021
include_str!("../../../providers/claude-code.yaml"),
2122
include_str!("../../../providers/github.yaml"),
2223
include_str!("../../../providers/nvidia.yaml"),
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
use crate::ProviderDiscoverySpec;
5+
6+
pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec {
7+
id: "aws-bedrock",
8+
credential_env_vars: &[
9+
"AWS_ACCESS_KEY_ID",
10+
"AWS_SECRET_ACCESS_KEY",
11+
"AWS_SESSION_TOKEN",
12+
"AWS_REGION",
13+
],
14+
};
15+
16+
test_discovers_env_credential!(
17+
discovers_aws_bedrock_env_credentials,
18+
"AWS_ACCESS_KEY_ID",
19+
"AKIA-test-key"
20+
);

‎crates/openshell-providers/src/providers/mod.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ macro_rules! test_discovers_env_credential {
3131
};
3232
}
3333
pub mod anthropic;
34+
pub mod aws_bedrock;
3435
pub mod claude;
3536
pub mod codex;
3637
pub mod copilot;

‎providers/aws-bedrock.yaml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
id: aws-bedrock
5+
display_name: AWS Bedrock
6+
description: Anthropic + Mistral + Llama models served via the AWS Bedrock InvokeModel API
7+
category: inference
8+
inference_capable: true
9+
credentials:
10+
- name: aws_access_key_id
11+
description: AWS access key id used for SigV4 signing of outbound Bedrock requests
12+
env_vars: [AWS_ACCESS_KEY_ID]
13+
required: true
14+
- name: aws_secret_access_key
15+
description: AWS secret access key paired with aws_access_key_id
16+
env_vars: [AWS_SECRET_ACCESS_KEY]
17+
required: true
18+
- name: aws_session_token
19+
description: Optional session token for temporary credentials (STS, IAM Roles for Service Accounts)
20+
env_vars: [AWS_SESSION_TOKEN]
21+
required: false
22+
- name: aws_region
23+
description: AWS region the Bedrock endpoint resolves into (e.g. us-east-1)
24+
env_vars: [AWS_REGION, AWS_DEFAULT_REGION]
25+
required: true
26+
discovery:
27+
credentials: [aws_access_key_id, aws_secret_access_key, aws_region]
28+
endpoints:
29+
# Default endpoint targets us-east-1 since the YAML loader does not yet
30+
# substitute the `{region}` placeholder. Operators in other regions
31+
# override via the `BEDROCK_BASE_URL` config-key the same way the
32+
# `anthropic` provider accepts `ANTHROPIC_BASE_URL`.
33+
- host: bedrock-runtime.us-east-1.amazonaws.com
34+
port: 443
35+
protocol: rest
36+
access: read-write
37+
enforcement: enforce
38+
binaries: [/usr/bin/claude, /usr/local/bin/claude]

0 commit comments

Comments
 (0)