-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add OpenAI-compatible Bedrock provider #3748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add OpenAI-compatible Bedrock provider #3748
Conversation
59d4cfa
to
e4d71e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use this one as a reference #3707
14919c1
to
3a9af0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please report the result of the tests/integration/inference/test_openai_completion.py and other openai related tested.
Also why has the uv.lock changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- nothing from models.py is used, please remove it
- is the /v1/embeddings endpoint available? if not, add a NotImplementedError stub
- is the /v1/compltions endpoint available? if not...
- great find wrt telemetry and stream usage, after this pr we should consider adding that nugget to the mixin for all providers
3a9af0c
to
56bff11
Compare
56bff11
to
7024e56
Compare
Implements AWS Bedrock inference provider using OpenAI-compatible endpoint for Llama models available through Bedrock. Changes: - Add BedrockInferenceAdapter using OpenAIMixin base - Configure region-specific endpoint URLs - Add NotImplementedError stubs for unsupported endpoints - Implement authentication error handling with helpful messages - Remove unused models.py file - Add comprehensive unit tests (12 total) - Add provider registry configuration
7024e56
to
55aaa6e
Compare
Implements AWS Bedrock inference provider using OpenAI-compatible endpoint for Llama models available through Bedrock.
Closes: #3410
What does this PR do?
Adds AWS Bedrock as an inference provider using the OpenAI-compatible endpoint. This lets us use Bedrock models (GPT-OSS, Llama) through the standard llama-stack inference API.
The implementation uses LiteLLM's OpenAI client under the hood, so it gets all the OpenAI compatibility features. The provider handles per-request API key overrides via headers.
Test Plan
Tested the following scenarios:
Bedrock OpenAI-Compatible Provider - Test Results
Model:
bedrock-inference/openai.gpt-oss-20b-1:0
Test 1: Model Listing
Request:
Response:
Test 2: Non-Streaming Completion
Request:
Response:
Test 3: Streaming Completion
Request:
Response:
Test 4: Error Handling - Invalid Model
Request:
Response:
Test 5: Multi-Turn Conversation
Request 1:
Response 1:
Request 2 (with history):
Response 2:
Context retained across turns
Test 6: System Messages
Request:
Response:
Test 7: Tool Calling
Request:
Response:
Test 8: Sampling Parameters
Request:
Response:
Test 9: Authentication Error Handling
Subtest A: Invalid API Key
Request:
Response:
Subtest B: Empty API Key (Fallback to Config)
Request:
Response:
Fell back to config key
Subtest C: Malformed Token
Request:
Response: