Skip to content
Skills Library
DevOps & cloud · Planning

self-hosted-llm-batch-inference

/self-hosted-llm-batch-inference

This skill should be used when a startup without a dedicated ML platform team needs recurring, latency-tolerant offline inference for a self-hosted 1B to 8B generative language model on AWS while minimizing GPU spend and recovering automatically from Spot interruption. It prescribes AWS Batch backed by Amazon ECS Managed Instances Spot, with model artifacts staged in Amazon S3, deterministic input shards, vLLM offline inference on one GPU, bounded retries, and output reconciliation before success. Covers sizing from the real prompt and model footprint, choosing networking without an avoidable

Repository
startups ↗
Licence
Apache-2.0
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

This skill should be used when a startup without a dedicated ML platform team needs recurring, latency-tolerant offline inference for a self-hosted 1B to 8B generative language model on AWS while minimizing GPU spend and recovering automatically from Spot interruption. It prescribes AWS Batch backed by Amazon ECS Managed Instances Spot, with model artifacts staged in Amazon S3, deterministic input shards, vLLM offline inference on one GPU, bounded retries, and output reconciliation before success. Covers sizing from the real prompt and model footprint, choosing networking without an avoidable

Original author description

This skill should be used when a startup without a dedicated ML platform team needs recurring, latency-tolerant offline inference for a self-hosted 1B to 8B generative language model on AWS while minimizing GPU spend and recovering automatically from Spot interruption. It prescribes AWS Batch backed by Amazon ECS Managed Instances Spot, with model artifacts staged in Amazon S3, deterministic input shards, vLLM offline inference on one GPU, bounded retries, and output reconciliation before success. Covers sizing from the real prompt and model footprint, choosing networking without an avoidable

How it works

  1. Scope
  2. Workflow
  3. Required deliverables
  4. Upstream skills
  5. Reference files
Original SKILL.md headings · 81 lines, 567 words
SKILL.md preview
---
name: self-hosted-llm-batch-inference
description: "This skill should be used when a startup without a dedicated ML platform team needs recurring, latency-tolerant offline inference for a self-hosted 1B to 8B generative language model on AWS while minimizing GPU spend and recovering automatically from Spot interruption. It prescribes AWS Batch backed by Amazon ECS Managed Instances Spot, with model artifacts staged in Amazon S3, deterministic input shards, vLLM offline inference on one GPU, bounded retries, and output reconciliation before success. Covers sizing from the real prompt and model footprint, choosing networking without an avoidable idle cost floor, and verifying that results are complete and GPU capacity is gone. Not for online endpoints, training, embeddings, other inference engines, multi-GPU or distributed inference, or one-off experiments where manual rerun is acceptable."
license: Apache-2.0
metadata:
  audience: startup
---

# Self-Hosted LLM Batch Inference

Build a repeatable offline inference path for a startup that needs GPU economics without operating
an ML platform. Use one AWS Batch job for one corpus run, backed by Amazon ECS Managed Instances
Spot. Stage model weights in Amazon S3, divide the corpus into deterministic shards, and process
those shards sequentially with vLLM on one GPU.

Keep the infrastructure stack separate from each run. Provision reusable Batch, ECR, IAM, logging,
and optional networking resources with infrastructure as code. Submit each run separately with
immutable image, model, prompt, input manifest, and output identifiers.

Set `scaleInAfter` to `0` for this architecture. No follow-up task is expected on the instance after
the Batch job ends, so retaining idle GPU capacity adds cost without improving the run.

## Scope

Apply this skill only when all of these conditions hold:

- The workload is recurring, latency-tolerant, generative offline inference.
- The model is approximately 1B to 8B parameters and fits on one GPU after measurement.
- The team accepts Spot interruption and requires automatic recovery.
- One model is loaded once and reused across many input shards in a corpus run.
- Persistent artifacts and completion records can live in Amazon S3.

Do not apply this skill to online endpoints, training or fine-tuning, embedding models, other
inference engines, multi-GPU or distributed inference, or one-off experiments where an operator can
rerun the command manually.

## Workflow

1. Read **`references/prepare-model-and-input.md`** and define the immutable model artifact, prompt
   contract, deterministic shard manifest, output schema, quarantine schema, and measured sizing
   inputs.
2. Read **`references/run-with-aws-batch.md`** and author the reusable infrastructure plus the
   separate `SubmitJob` invocation. Preserve one Batch job per corpus run.
3. Read **`references/verify-and-optimize.md`** before the canary and again after the full run.
   Reconcile records, confirm retry behavior, measure cost inputs, and verify that GPU capacity has
   terminated.

## Required deliverables

- A reusable infrastructure stack for the Batch compute environment, queue, job definition, ECR
  repository, IAM roles and instance profile, log group, and only the networking resources that the
  chosen path requires.
- An immutable model artifact and manifest in Amazon S3.
- Deterministic input shards and an input manifest in Amazon S3.
- A separate `SubmitJob` invocation containing immutable image, model, prompt, input manifest, and
  output prefix identifiers.
- Output, quarantine, and run metadata that survive infrastructure deletion.
- A verification record proving completion, record reconciliation, and GPU capacity release.

## Upstream skills

Invoke upstream skills only when authoring the artifacts they own:

- **`Skill("aws-core:aws-containers")`**: ECS Managed Instances, ECR, and container mechanics.
- **`Skill("aws-core:aws-cloudformation")`** or **`Skill("aws-core:aws-cdk")`**: the selected
  infrastructure-as-code implementation.
- **`Skill("aws-core:aws-iam")`**: role and policy implementation.
- **`Skill("aws-core:aws-storage")`**: S3 storage and transfer implementation.
- **`Skill("aws-core:aws-compute")`**: actual single-GPU instance candidates after measuring the
  workload.
- **`Skill("aws-core:aws-billing-and-cost-management")`**: current rates and cost calculations
  using the measurements defined here.
- **`Skill("aws-core:aws-messaging-and-streaming")`**: Batch state-change notifications when
  unattended completion needs a notification path.
- **`Skill("aws-core:aws-secrets-manager")`**: gated model credentials during staging only.

## Reference files

- **`references/prepare-model-and-input.md`**: Read before choosing GPU capacity or writing
  infrastructure. Defines model staging, prompt and record contracts, deterministic shards,
  manifests, output and quarantine schemas, and measurement inputs.
- **`references/run-with-aws-batch.md`**: Read before authoring the stack or submitting a run.
  Defines the AWS Batch architecture, `scaleInAfter`, networking decision, job lifecycle, retries,
  resumability, IAM boundaries, and stack-to-run contract.
- **`references/verify-and-optimize.md`**: Read before the canary and after every full run. Defines
  acceptance checks, reconciliation, interruption testing, capacity-release verification, and the
  measurements passed to cost analysis.
Files in this package (4)
  • SKILL.md 5 KB
  • references/prepare-model-and-input.md 5 KB
  • references/run-with-aws-batch.md 10 KB
  • references/verify-and-optimize.md 5 KB

Versions

The database has no other skills named self-hosted-llm-batch-inference.

Database snapshot: 13.11.2026 · package version 6bd1be27111a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100aws-ec2
    Amazon EC2 provides resizable virtual servers on AWS. Use this skill to launch and manage EC2 instances with the AWS CLI: pick a current AMI, set up security groups, enforce IMDSv2, attach EBS volumes, build launch templates and Auto Scaling groups, and run Spot instances. Use…
  • 100mlops
    End-to-end MLOps guidance on AWS — platform selection, training, inference, pipelines, monitoring, and cost optimization. This skill should be used when the user asks to "build an ML pipeline", "deploy a model on SageMaker", "set up MLOps", "configure SageMaker Pipelines",…
  • 100hf-cloud-sagemaker-deployment-planner
    Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like \"deploy a model\", \"host this LLM on AWS\", \"serve this embedding model\",…
  • 100model-serving
    Tunes deployed LLM inference servers (vLLM, SGLang, TensorRT-LLM) for latency and throughput. Use when TTFT or p99 latency regresses, a benchmark disagrees with production, sizing GPUs or replicas for an SLO, tuning KV cache, max-model-len, batching or prefix caching, or…
  • 100hf-cloud-sagemaker-deployment-planner
    Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like "deploy a model", "host this LLM on AWS", "serve this embedding model", "deploy a…
  • 100aws-ecs-fargate-container-service
    Use this skill when running serverless containerized applications on AWS using Amazon ECS and AWS Fargate task definitions.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.