feat: bedrock-oss-provisioned-throughput-polling#5893
Merged
lucasjia-aws merged 4 commits intoJun 4, 2026
Merged
Conversation
07f6443 to
456b788
Compare
456b788 to
d6636a0
Compare
2aa5e60 to
aa5315a
Compare
aa5315a to
66f316b
Compare
66f316b to
9ce7df3
Compare
…SS deployments - deploy() for non-Nova models now waits for import job completion and returns job details (model ready for on-demand inference). - New public method: create_provisioned_throughput() with polling. - New private methods: _wait_for_import_job_complete(), _wait_for_provisioned_throughput_in_service(). - Added unit tests and integ tests (serial to avoid concurrent quota issues). - Mark bedrock integ tests as serial to avoid concurrent import job quota issues. X-AI-Prompt: add import polling and PT for bedrock OSS deployments X-AI-Tool: kiro-cli
9ce7df3 to
a0da02f
Compare
nargokul
reviewed
Jun 4, 2026
Contributor
nargokul
left a comment
There was a problem hiding this comment.
Can we also update example notebooks ?
nargokul
reviewed
Jun 4, 2026
| ValueError: If model_id or provisioned_model_name is not provided. | ||
| """ | ||
| if not model_id: | ||
| raise ValueError("model_id is required for create_provisioned_throughput.") |
Contributor
There was a problem hiding this comment.
Can this be gotten from the constructor or from class variables ?
Like If I do bedrock_model_builder.deplo
Collaborator
Author
There was a problem hiding this comment.
Good point! I've updated PR with two commits:
- make mode_id optional in
create_provisioned_throughput(), if not provided it will now falls back to the stored model ID afterdeploy()completes - update example notebooks for new OSS deploy polling behavior:
a.bedrock-modelbuilder-deployment.ipynb: deploy() now waits for import completion, removed manual polling cell, added PT usage example
b.mtrl_finetuning_example_notebook_v3_prod.ipynb: removed manual polling loop, updated description to reflect automatic waiting, added optional create_provisioned_throughput() example
- Store imported model ID after deploy() completes - create_provisioned_throughput() now falls back to the stored model ID if model_id is not explicitly passed - Added unit tests for fallback and explicit override behavior
- bedrock-modelbuilder-deployment.ipynb: deploy() now waits for import completion, removed manual polling cell, added PT usage example - mtrl_finetuning_example_notebook_v3_prod.ipynb: removed manual polling loop, updated description to reflect automatic waiting, added optional create_provisioned_throughput() example
nargokul
approved these changes
Jun 4, 2026
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.
Description
Add synchronous polling for Bedrock OSS (non-Nova) model deployments.
Previously,
BedrockModelBuilder.deploy()for OSS models would fire off acreate_model_import_jobcall and return immediately, leaving the user to manually wait for the import to complete. This PR adds polling sodeploy()waits until the import job completes and the model is ready for on-demand inference, matching the synchronous behavior of the Nova deployment path.CreateProvisionedModelThroughputis provided as a separate public method (create_provisioned_throughput()) for users who need dedicated throughput, rather than being mandatory in the deploy flow.Changes
Implementation (
bedrock_model_builder.py):deploy()now waits for the import job to complete and returns the job details. Model is ready for on-demand inference afterdeploy()returns.create_provisioned_throughput()— creates provisioned throughput for an imported model and polls until InService. This is a standalone method, not called bydeploy()._wait_for_import_job_complete(),_wait_for_provisioned_throughput_in_service().Unit tests (
test_bedrock_model_builder.py):deploy()waits for import completion and does NOT call PT APIs.TestWaitForImportJobComplete,TestCreateProvisionedThroughput,TestWaitForProvisionedThroughputInService.Integration test (
test_bedrock_provisioned_throughput.py):test_deploy_oss_model_waits_for_import_completion).create_provisioned_throughput()using a pre-existing Bedrock fine-tuned Llama 3.1 8B custom model.Testing
deploy()validated locally against real Bedrock APIs — import job creation, polling to completion (~9 min), and model readiness all confirmed.create_provisioned_throughput()validated locally end-to-end — PT creation, polling to InService (~18 min), and automatic cleanup all confirmed.