opensite-ai/opensite-skills / aws-ai-ml
aws-ai-ml
VerifiedSelects, deploys, and customizes AI models on Amazon SageMaker. Training or Processing jobs, fine-tuning (SFT/DPO/RLVR/RLAIF), model selection, dataset preparation, evaluation, SageMaker or Bedrock deployment, inference optimization and endpoint diagnostics. Covers the full lifecycle from planning through production. Use when fine-tuning models on SageMaker, choosing which base model to customize, fine-tune, or deploy from SageMaker JumpStart or Hub, SageMakerPublicHub, or the SageMaker public model catalog, transforming or validating training data, evaluating model quality, deploying or optimizing endpoints, configuring IAM/S3 for training, or managing SageMaker Managed MLflow. Use for endpoint health, failures, latency, logs, metrics, errors. Covers Serverless Model Customization, Nova and OSS deployment paths, and PySDK v3. NOT for Ground Truth labeling, Feature Store, or general-purpose AWS infrastructure.
references/processing-jobs/code_templates/script_processing.py
View on GitHub# Cell 0 [markdown]: Script or Custom-Container Processing
# Cell 1: Install dependencies
%pip install --upgrade 'sagemaker>=3.22.0,<4.0' boto3 -q # NOTEBOOK_ONLY
# Cell 2: Configure the processing job
import boto3
from sagemaker.core import Attribution, image_uris, set_attribution
from sagemaker.core.helper.session_helper import Session, get_execution_role
from sagemaker.core.processing import ScriptProcessor, logs_for_processing_job
from sagemaker.core.shapes import (
ProcessingInput,
ProcessingOutput,
ProcessingS3Input,
ProcessingS3Output,
)
set_attribution(Attribution.SAGEMAKER_AGENT_PLUGIN)
REGION = ""
ROLE_ARN = "[ROLE_ARN]"
SCRIPT_PATH = "[SCRIPT_PATH]"
CUSTOM_IMAGE_URI = ""
IMAGE_FRAMEWORK = "[IMAGE_FRAMEWORK]"
IMAGE_VERSION = ""
IMAGE_PYTHON_VERSION = ""
INPUT_S3_URI = "[INPUT_S3_URI]"
OUTPUT_S3_URI = "[OUTPUT_S3_URI]"
INSTANCE_TYPE = "[INSTANCE_TYPE]"
INSTANCE_COUNT = 1
VOLUME_SIZE_GB = 30
MAX_RUNTIME_SECONDS = 86400
BASE_JOB_NAME = "[BASE_JOB_NAME]"
ARGUMENTS = []
WAIT_FOR_COMPLETION = False
boto_session = boto3.Session(region_name=REGION or None)
region = boto_session.region_name
sm_client = boto_session.client("sagemaker")
sm_session = Session(boto_session=boto_session, sagemaker_client=sm_client)
role = ROLE_ARN or get_execution_role()
image_uri = CUSTOM_IMAGE_URI or image_uris.retrieve(
framework=IMAGE_FRAMEWORK,
region=region,
version=IMAGE_VERSION or None,
py_version=IMAGE_PYTHON_VERSION or None,
instance_type=INSTANCE_TYPE,
)
print(f"Resolved processing image URI: {image_uri}")
# Cell 3: Build and submit the processor
processor = ScriptProcessor(
image_uri=image_uri,
role=role,
command=["python3"],
instance_type=INSTANCE_TYPE,
instance_count=INSTANCE_COUNT,
volume_size_in_gb=VOLUME_SIZE_GB,
max_runtime_in_seconds=MAX_RUNTIME_SECONDS,
base_job_name=BASE_JOB_NAME,
sagemaker_session=sm_session,
)
processor.run(
code=SCRIPT_PATH,
inputs=[
ProcessingInput(
input_name="input",
s3_input=ProcessingS3Input(
s3_uri=INPUT_S3_URI,
local_path="/opt/ml/processing/input",
s3_data_type="S3Prefix",
s3_input_mode="File",
),
)
],
outputs=[
ProcessingOutput(
output_name="output",
s3_output=ProcessingS3Output(
s3_uri=OUTPUT_S3_URI,
local_path="/opt/ml/processing/output",
s3_upload_mode="EndOfJob",
),
)
],
arguments=ARGUMENTS,
wait=False,
logs=False,
)
# Cell 4: Report status and optionally wait
job_name = processor.latest_job.processing_job_name
job_arn = sm_client.describe_processing_job(ProcessingJobName=job_name)["ProcessingJobArn"]
print(f"Processing Job Name: {job_name}")
print(f"Processing Job ARN: {job_arn}")
if WAIT_FOR_COMPLETION:
logs_for_processing_job(sm_session, job_name, wait=True)
print(f"Output: {OUTPUT_S3_URI}")
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |