Repository navigation
feat(bedrock): serve OpenAI models hosted on Bedrock - #439
Open
taciturnaxolotl wants to merge 3 commits into
Open
taciturnaxolotl wants to merge 3 commits into
taciturnaxolotl wants to merge 3 commits into
Conversation
isReasoningModel (chat completions) and getResponsesModelConfig (Responses API) only matched "gpt-5", so gpt-6 IDs were handled as non-reasoning models: chat completions sent max_tokens, which GPT-6 rejects with a 400, and the Responses API dropped the reasoning effort with an unsupported-setting warning. Both checks now use reasoningGenerationPattern (gpt-[5-9]), next to the responsesGenerationPattern added in #354. It stays on a single digit so Azure's gpt-35-turbo is not caught. Co-Authored-By: Claude <noreply@anthropic.com>
Reasoning detection was copied between Chat Completions and Responses, which is how GPT-6 got fixed in one place and missed in the other. Both now share one classifier. Chat Completions keeps an allow list of known reasoning families, since it also serves arbitrary compatible models. Responses only sees OpenAI models, all current generations of which reason, so it now treats everything as reasoning except the known gpt-3, gpt-4 and chat snapshots. Prefixed IDs such as Bedrock's us.openai.o3 are now recognized too. The client-side flex and priority checks are removed. They were wrong in both directions (they blocked every GPT-6 model and allowed several unsupported ones), and OpenAI changes the supported list often, so the requested tier is now sent as is and the API reports what it rejects. A fast service tier constant is added, since priority is now an alias. IsResponsesReasoningModel now returns false for gpt-4 models. 💘 Generated with Crush Assisted-by: Crush:claude-opus-5-5
Bedrock hosts OpenAI's GPT models behind its OpenAI-compatible endpoint, but the Bedrock provider only spoke the Anthropic API, so using GPT-6 on Bedrock meant hand-configuring a separate OpenAI-compatible provider. The Bedrock provider now picks the API by model: Anthropic models keep the Anthropic SDK, GPT models use the Responses API, and gpt-oss uses Chat Completions, the only OpenAI API Bedrock serves it on. Authentication matches the Anthropic path: a Bedrock API key, then AWS_BEARER_TOKEN_BEDROCK, then SigV4 with the default AWS credential chain. Ambient OPENAI_* environment variables are never sent to AWS. 💘 Generated with Crush Assisted-by: Crush:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #386; only the last commit is new here. Merge #386 first.
bedrock-runtime, and gpt-oss uses Chat Completions, the only OpenAI API Bedrock serves it on.Authentication works the same as for Claude: a Bedrock API key, then
AWS_BEARER_TOKEN_BEDROCK, then SigV4 with the default AWS credential chain. It's built on the vendored openai-gobedrockpackage, which handles signing and keeps ambientOPENAI_*environment variables from reaching AWS.Provider options for these models use the
openaikey, so callers (Crush included) need to send OpenAI-shaped options when the model is a GPT model.Tested against a local server: Responses routing, reasoning effort and the developer role, gpt-oss on Chat Completions, SigV4 signing for the
bedrockservice and region, custom base URLs, and Claude routing unchanged. I don't have Bedrock credentials, so this hasn't been run against real AWS yet.💘 Generated with Crush