Booklet.ai supports models deployed to AWS SageMaker. This section highlights SageMaker-specific steps and details to get your model up and running.
Granting Access to AWS SageMaker
You need to grant Booklet read-only access to a limited number of SageMaker actions via an IAM role that is associated with our AWS account.
Follow these steps to create a read-only IAM Role for Booklet:
- Create a new role in the AWS IAM Console.
- Select “Another AWS account” for the Role Type and enter “256039543343” in the Account ID, field (this is the Booklet.ai AWS account id).
- Click the “Next: Permissions” button.
- Click the “Create Policy” button (opens a new window).
- Select the JSON tab. Copy and paste this JSON into the text area.
- Click “Review policy”.
- Name the policy “BookletAWSIntegrationPolicy” and click “Create policy” and close the window.
- Back in the “Create role” window, refresh the list of policies and select the policy you just created.
- Click “Next: Tags” and “Next: Review” to proceed to the review step.
- Give the role a name such as “BookletAWSIntegrationRole”. Click “Create Role”.
- Copy the Role ARN. It looks like something like “arn:aws:iam::123456789012:role/BookletIntegrationRole”.
With the AWS Role created and the ARN on your clipboard, we’re almost there. In the Booklet.ai, head over to your Org Settings (under your email in the top right) and the SageMaker integration settings. Here is where you’ll paste in the AWS Role ARN, select your region, and click the “Save” button:
When you click the “Save” button, Booklet.ai attempts to retrieve a list of SageMaker endpoints for the region you selected. If this API calls fails, Booklet.ai will render the error message. If no InService endpoints are found, the ARN is still saved, but Booklet will let you know that no endpoints were found.
input_fn Schema Requirements
Booklet.ai’s model inference UI generates predictions via the SageMaker InvokeEndpoint API endpoint. Your model’s
input_fn must support the default
application/json format defined in the SageMaker docs for your ML framework. In most cases, this is a JSON object containing a single JSON array. For example:
[ [1, 3], [2, 5] ]
Booklet.ai infers the input schema based on the endpoint’s image name. For example, if the image name is:
Booklet infers that this is a PyTorch model and will invoke the endpoint with a single JSON array (the default format defined in the SageMaker PyTorch docs).