AGENT SKILL

serving

Use SageMaker Python SDK v3 serving workflows for ModelBuilder, local inference, JumpStart, optimization, Bedrock, and inference recommender.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
serving
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use SageMaker Python SDK v3 serving workflows for ModelBuilder, local inference, JumpStart, optimization, Bedrock, and inference recommender.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

SageMaker Python SDK v3 Serving Sub-skill

Use this sub-skill for model deployment and inference with sagemaker-serve. It covers ModelBuilder, InferenceSpec, SchemaBuilder, ModelServer, build(), deploy(), deploy_local(), local container mode, in-process mode, JumpStart deployment, train-to-inference, optimization, recommendation-driven deployments, Bedrock deployment, and inference pipelines.

Trigger phrases

Read this sub-skill when the user says or implies:

  • deploy a model, serve a model, or create an endpoint
  • ModelBuilder, ModelServer, InferenceSpec, or SchemaBuilder
  • deploy_local(), local container mode, or in-process mode
  • real-time, serverless, async, or batch transform deployment
  • train-to-inference or deploy from ModelTrainer / TrainingJob
  • JumpStart deployment or ModelBuilder.from_jumpstart_config(...)
  • optimization, quantization, compilation, sharding, or speculative decoding
  • BedrockModelBuilder or deployment to Amazon Bedrock
  • inference recommender, right sizing, or deployment recommendations
  • inference pipelines, multi-container serving, or chained models

Read this when

  • You need the v3 deployment flow built around ModelBuilder.
  • You need a custom InferenceSpec or SchemaBuilder for request/response marshalling.
  • You need local testing without cloud calls, either in Docker or in-process.
  • You need JumpStart, train-to-inference, optimization, or Bedrock serving.
  • You need recommendation-driven deployment selection before creating an endpoint.

Do not read this when

Short workflow

  1. Identify the source of the serving artifact: raw model object, trained job, ModelTrainer, JumpStart config, custom InferenceSpec, or fine-tuned model package.
  2. Pick the transport contract early: define SchemaBuilder(sample_input, sample_output) or a custom InferenceSpec.load() / invoke() pair. If the runtime should serialize itself, choose the right content_type and accept_type up front.
  3. Build with ModelBuilder(...) or ModelBuilder.from_jumpstart_config(...). If the source is a ModelTrainer or TrainingJob, make sure training has completed before build.
  4. Choose the deployment mode:
    • Mode.SAGEMAKER_ENDPOINT for cloud serving
    • Mode.LOCAL_CONTAINER for Docker-based local serving
    • Mode.IN_PROCESS for pure Python local serving
  5. Use build() before deploy() for normal serving flows. Use deploy_local() only for LOCAL_CONTAINER or IN_PROCESS.
  6. Route the deployment type:
    • no inference_config or ServerlessInferenceConfig / AsyncInferenceConfig -> real-time Endpoint
    • BatchTransformInferenceConfig -> Transformer
    • ResourceRequirements -> inference-component-based endpoint path
  7. Invoke with endpoint.invoke(body=..., content_type=..., accept=...) or local_endpoint.invoke(...). Keep transport examples self-contained and use placeholders for all real AWS identifiers.
  8. For optimization, recommendations, or Bedrock, read the dedicated reference before calling optimize(), generate_deployment_recommendations(), or BedrockModelBuilder.deploy().
  9. If the request becomes a low-level endpoint or batch job task, hand it off to the sibling sub-skill instead of expanding this one.

Verified API surface

Use these signatures as the source of truth for runtime-safe guidance:

  • ModelBuilder(...)
  • ModelBuilder.build(...)
  • ModelBuilder.deploy(...)
  • ModelBuilder.deploy_local(...)
  • ModelBuilder.optimize(...)
  • ModelBuilder.from_jumpstart_config(...)
  • InferenceSpec.load(...) / InferenceSpec.invoke(...)
  • SchemaBuilder(...)
  • BedrockModelBuilder.deploy(...)

See the bundled references for the full verified signatures and examples.

Common guardrails

  • Use v3 imports only. Do not introduce v2 Model, Predictor, Processor, or Estimator patterns except in a clearly labeled deprecated migration note.
  • Do not hardcode real account IDs, role ARNs, regions, bucket names, subnet IDs, security group IDs, or credentials.
  • Remember that ModelBuilder may resolve a role during construction if no role_arn is provided; without credentials, that can fail before build() or deploy() runs.
  • Prefer endpoint.invoke() over deprecated predictor.predict() patterns.
  • If a user asks for Endpoint or TransformJob creation directly, route to ../core-resources/SKILL.md.

Reference map

Handoff notes

  • Keep detailed APIs, matrices, and failure recovery in the references.
  • Keep this file router-like: classify the request, point to the right flow, and stop.
  • When a deployment question crosses into training, model customization, or low-level resources, hand off to the sibling sub-skill instead of duplicating that logic here.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351