Skip to content

feat: bedrock model reuse for OSS models - #6157

Open
mujtaba1747 wants to merge 1 commit into
aws:master-nova-follow-upsfrom
mujtaba1747:bedrock-modelbuilder-oss-fix
Open

feat: bedrock model reuse for OSS models#6157
mujtaba1747 wants to merge 1 commit into
aws:master-nova-follow-upsfrom
mujtaba1747:bedrock-modelbuilder-oss-fix

Conversation

@mujtaba1747

@mujtaba1747 mujtaba1747 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Description of changes:
Adds resource reuse support for open-source (OSS) models imported into Amazon Bedrock via ModelBuilder. When reuse_resources=True, the SDK now checks for existing imported models or in-progress import jobs before starting a new import, avoiding redundant work and reducing
import times.

Changes

  • Reuse logic in bedrock_model_builder.py: Before importing an OSS model, the deploy flow now:
    a. Resolves a stable source identifier from the model package ARN or S3 artifact URI
    b. Searches for an already-imported model matching that source (via resource tags)
    c. Falls back to finding an in-progress import job and waiting for its completion
    d. Only starts a fresh import if no existing resource is found
  • New model_reuse.py module: Provides find_existing_imported_model() and find_existing_model_import_job() — paginated Bedrock API lookups that match resources by a sagemaker.amazonaws.com/model-source tag
  • Idempotent HF model path resolution: Guards against double-appending checkpoints/hf_merged/ when the config is already at the base S3 path
  • Source tagging: Automatically tags imported models and import jobs with their source identifier for future reuse lookups

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant