Getting started¶
Subscribe, create one real-time endpoint on ml.c5.xlarge, run the
synthetic examples, and delete the endpoint. The runnable copy is the
sample notebook.
You need: a subscription, a SageMaker execution role that can use this product and the bucket you choose, permission to create SageMaker resources and to pass that role, and an existing private S3 bucket in the same Region. No external dataset is required. The notebook's examples are synthetic.
1. Subscribe¶
Open the listing, choose View purchase options, review the terms, and subscribe. The examples repository states USD 0.70 per instance-hour and a 14-day software trial. Infrastructure charges still apply during the trial.
2. Create the model¶
Set MODEL_PACKAGE_ARN to the subscribed package in your Region,
EXECUTION_ROLE_ARN to your SageMaker role, and S3_BUCKET to a private
bucket that already exists in that Region. The notebook rejects placeholders.
Create the model with network isolation:
sm.create_model(
ModelName="<name>",
ExecutionRoleArn="<execution-role-arn>",
EnableNetworkIsolation=True,
PrimaryContainer={"ModelPackageName": "<subscribed-model-package-arn>"},
)
The container listens on SAGEMAKER_BIND_TO_PORT (default 8080) for
GET /ping, POST /invocations, and GET /execution-parameters. It
reports ready only after the weights load and warmup finishes.
3. Real-time endpoint¶
The notebook creates an endpoint configuration and an endpoint on
ml.c5.xlarge with one instance, waits until the endpoint is in service,
invokes the included samples, and deletes the endpoint, configuration, and
model in a finally block. Provisioning can take several minutes. Do not
stop the kernel before that cleanup. If you do, use the resource names the
notebook printed and delete them in the SageMaker console.
sm.create_endpoint_config(
EndpointConfigName="<name>",
ProductionVariants=[{
"VariantName": "AllTraffic",
"ModelName": "<name>",
"InitialInstanceCount": 1,
"InstanceType": "ml.c5.xlarge",
"InitialVariantWeight": 1.0,
}],
)
sm.create_endpoint(EndpointName="<name>", EndpointConfigName="<name>")
One sample body from the listing usage is:
{"id": "T-1", "subject": "Cobro duplicado", "body": "Me cobraron dos veces. Revisen la factura hoy."}
{"text": "..."} is also accepted. Explicit text takes precedence over
subject and body.
4. Batch transform¶
The notebook uploads UTF-8 JSON Lines to your bucket and starts a job with
BatchStrategy SingleRecord, SplitType Line, MaxPayloadInMB 6, and
MaxConcurrentTransforms 1. ContentType and Accept are
application/jsonlines. TransformResources uses ml.c5.xlarge and one
instance. SageMaker reads and writes S3. The container itself has no
network access.
The notebook waits up to 30 minutes, then deletes the temporary model after the job reaches a terminal state. Output stays under the S3 prefix it prints until you run the cleanup cell. A model cannot be deleted safely while its job is still running.
5. Clean up¶
The real-time cell deletes the endpoint, waits until it is gone, then deletes the endpoint configuration and the model. The batch cell deletes its model after the job stops. A later cell deletes the two sample S3 objects. If a cell is interrupted, stop a running job before you delete its model, and delete any objects left under the printed prefix.
An endpoint is billed until you delete it. A batch job is billed until it finishes.
Last updated November 11, 2026 · Suggest an improvement