ladderlore
  • S3 や IAM などのサービス名を入力してください。

概念

Bringing in models built outside AWS

Host an outside model with SageMaker AI, or import its weights into Bedrock.

このレッスンはまだ翻訳されていないため、英語で表示しています。

  • SageMaker AI

    You bring
    model.tar.gz in S3 and a container
    How it runs
    An endpoint you size, any framework
  • Bedrock Custom Model Import

    You bring
    Hugging Face weights in S3, supported architecture
    How it runs
    On demand through InvokeModel
Two routes for a model built elsewhere.
Model built outside AWS
Convert to Hugging Face format
Weights in S3
Import job
Imported model
InvokeModel
  1. 1The model comes from outside AWS.
  2. 2Convert it to safetensors with config and tokenizer files if needed.
  3. 3Upload the files to S3.
  4. 4Run a Custom Model Import job.
  5. 5Call the imported model with InvokeModel.
Importing weights into Bedrock, from file to call.

流れ

  1. 1The model comes from outside AWS.
  2. 2Convert it to safetensors with config and tokenizer files if needed.
  3. 3Upload the files to S3.
  4. 4Run a Custom Model Import job.
  5. 5Call the imported model with InvokeModel.

概要

For SageMaker AI, package the trained model as a model.tar.gz in Amazon S3. Put the model files at the root and any inference script under a code folder. A prebuilt framework container (PyTorch, TensorFlow, scikit-learn) loads the model with your handler functions. If no prebuilt container fits, use your own image. Then create the model, the endpoint configuration and the endpoint as usual. This works for any framework and any size you can fit on an instance.

概要

Amazon Bedrock Custom Model Import brings open-weight models into Bedrock. The weights must be in Hugging Face format: safetensors files, config.json and the tokenizer files, in S3. The architecture must be supported, for example Llama, Mistral, Mixtral, Qwen, Flan-T5 or GPT-OSS. Text models can be up to 200 GB, and the context length must be under 128K. An import job creates the model. You call it with InvokeModel, with no Provisioned Throughput. Bedrock bills by model copies in 5-minute windows after the first call.

概要

Format conversion is often the real work. Convert original Llama or Mistral weights with the Hugging Face conversion scripts, and convert older checkpoint files to safetensors. Embedding models are not supported. Custom Model Import works in a few Regions, and not with batch inference or CloudFormation.

覚えること

  • SageMaker AI: model.tar.gz in S3, a prebuilt or own container, any framework.
  • Bedrock Custom Model Import: Hugging Face weights in S3, a supported architecture.
  • Needs safetensors, config.json and tokenizer files. Text models up to 200 GB.
  • Invoke with InvokeModel on demand. Billing is by model copies in 5-minute windows.

覚えること

  • Not supported: embedding models, batch inference, CloudFormation.

試験では

  • “Use a PyTorch model trained on premises with no changes to its framework” points to SageMaker AI hosting with a prebuilt container.
  • “Serve a fine-tuned Llama model through the Bedrock API” points to Bedrock Custom Model Import.
  • “Weights are in the original checkpoint format” points to converting them to Hugging Face safetensors first.