Bedrock coding agent 配置

Bedrock coding agent 配置

发现AWS的文档很烂,而且各家AI对此幻觉严重,给出的配置也要多次调整才能用。

至于用bedrock的原因,很重要的一点是它是少数个人能买zero data retention的主流提供商

Amazon Bedrock doesn't store or log your prompts and completions. Amazon Bedrock doesn't use your prompts and completions to train any AWS models and doesn't distribute them to third parties.

遇到的坑

  • model ID不唯一,例如runtime端点openai.gpt-oss-120b-1:0,而mantle端点openai.gpt-oss-120b,而这在model catalog里还是没有的

  • 无论端点是否支持,sample code 都有,也就是网站上放着不能运行的code,如:https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-qwen-qwen3-coder-next.html

尽管有多个开源选项,但感觉上模型自家的codex和claude code应该harness做得比较好。claude code似乎会悄悄检测是否是claude自家的模型,不是的话降智,而且不开源,因此优先选codex。codex 通过bedrock只支持gpt-oss,好处是相当便宜,就是性能目前没深入使用,不知道差距多大,如果不够可以考虑Roo Code/Aider/Continue.dev。Cline对我的use case(更多的单独审批而非全自动agent),prompt似乎过重了。

AWS billing里的token和codex输出的完全一致。

下面的能回hello,但bash等基本的tool不能调用,实际是没用的。这里也提到过

以下是能用的codex配置,与0.120.0兼容
model_provider = "bedrock_mantle"
model = "openai.gpt-oss-120b" # 替换为支持的 Bedrock 模型 ARN  ID
model_context_window = 128000
web_search = "disabled"

[model_providers.bedrock_mantle]
name = "bedrock_mantle"
# 指向你的 AWS Bedrock Mantle 区域端点
base_url = "https://bedrock-mantle.us-east-1.api.aws/v1" 
experimental_bearer_token = "bedrock-api-key-..."
wire_api = "responses"            # 新版 Codex 必须使用 responses 协议

2026-04-27更新:目前切换到了continue.dev, 但它bedrock也是不能直接用的

尝试了以下几个模型:

GLM-4.7-flash, gpt-oss-120b

工具调用失败

MiniMax M2.5

非常便宜,但幻觉有点重,思考不够深

DeepSeek-V3.2

工具调用比MiniMax更激进,思考质量高一点。在更多的token消耗下回答同问题花费是MiniMax 4倍


GCC creates memcpy when accessing an array