Repository navigation
feat(solution-architecture): add self-hosted LLM serving skill - #348
realAlexBarge wants to merge 6 commits into
Conversation
Add self-hosted-llm-serving to aws-startups-solution-architecture, as proposed in RFC awslabs#346. It covers online serving of an open-weight or fine-tuned LLM on a self-managed engine (vLLM or SGLang) on EKS, ECS or EC2, where every GPU replica is paid from a fixed cost ceiling with no committed fleet to absorb an idle GPU. SKILL.md is a router with four decisions: self-host or stay managed (break-even against per-token APIs, Bedrock Custom Model Import and SageMaker inference components), fit one GPU first, adapters on one base model for several fine-tunes, and one warm replica or scale to zero. Six reference files hold the procedures. The skill ships no scripts; numbers come from the engine's startup log, a benchmark on the target instance, and the billing skill's calculation rule. Engine flags are pinned to vLLM v0.31.0 and SGLang v0.5.21. AWS facts were checked against AWS documentation and the Price List API on 2026-10-05. Refs awslabs#346
Price Bedrock Custom Model Import with the pricing page form: copies active in each window times units per copy times the price per unit per minute times 5, summed over active 5-minute windows. The user guide formula divides the window count by 60, which disagrees with the pricing page's own worked example by a factor of 300. The break-even inputs now include per-copy concurrency, measured by a load test, and the copies needed in each hour, so the cost under load no longer assumes a single copy. Name the one-GPU sizes in g5, g6 and g6e explicitly; 12xlarge has four GPUs. Add the Custom Model Import transformers 4.51.3 and CloudFormation constraints to the rule-out list, map the g7 and g7e GPUs to Blackwell and note that the vLLM quantization table has no Blackwell column, and state the ALB 503 behavior with no registered targets. Also: point the weight staging step at the batch skill with Skill(), cite the ECS CreateService reference for the grace period default, link the vLLM production metrics page, align the step 1 router output with its reference, and drop the unsourced claim about what companies with a committed fleet do. Refs awslabs#346
There was a problem hiding this comment.
solution-architecture-reviewer bot: 3 item(s) for a human
Not approving, not blocking. Something below is worth a look, but none of it is the solution-architecture-reviewer bot's call to settle: a human decides.
Reviewed 7 changed file(s).
Axis assessment
- 🟡 PR hygiene (advisory) — The PR body states validation was done on
one model onlyand that anend-to-end run of the procedure on a GPU instancewas not done; this is disclosed, which is what this axis asks for, but a human should decide whether that disclosed gap is acceptable for a new skill of this scope before merge. - 🟡 Upstream duplication (advisory) —
SKILL.mdnamesvLLM/SGLangserving mechanics, GPU sizing, and benchmarking in detail; the suppliedaws-computetext covers EC2/ASG/instance selection generally but not GPU memory sizing, KV cache, or engine-specific serving, so no direct overlap is checkable against the text given.aws-ai-ml's andaws-agents' full bodies were not supplied, so I cannot confirm or rule out overlap with SageMaker inference optimization or AgentCore serving guidance at concern-level confidence; a human should check whetheraws-ai-ml's benchmarking/optimization content already covers the generic engine-tuning material here. - 🟡 Scope (startup-specific) (advisory) — The skill is framed tightly around the fixed-cost-ceiling constraint (
Every GPU replica is paid from a fixed cost ceiling with no committed fleet to absorb an idle GPU) and most content (break-even math, idle floor, one-GPU-first ordering) is genuinely reshaped by that constraint, which looks like a pass on criterion 1. However, large stretches ofengine-configuration.mdandfit-one-gpu.md(pinned vLLM/SGLang flags, GPU memory tables, ALB idle timeout settings, EKS/ECS GPU driver prerequisites) read identically for an enterprise with a committed GPU fleet, since the mechanics of fitting weights plus KV cache on a GPU do not change with the cost ceiling, only the threshold for when a second GPU is tolerable does. A human should weigh whether these generic-engine-mechanics sections tip criterion 1 toward Agent Toolkit for AWS scope despite the startup-specific framing wrapped around them. - ✅ Contradiction — No two files in this PR give guidance that cannot both be followed; the skill is internally consistent and its routing to
aws-coreskills and toself-hosted-llm-batch-inferencedoes not conflict with anything shown. - ✅ Staleness — The skill pins specific dated versions (vLLM
v0.31.0released2026-10-05, SGLangv0.5.21released2026-10-02) and explicitly instructs re-verifying against current docs rather than trusting the date, which is the opposite of staleness. The one sunset-service mention (Text Generation Inference (TGI)inengine-configuration.md:15) warns against it and recommends vLLM/SGLang instead, which is the warn framing criterion 3 wants, not a recommend framing. - ✅ Manifest drift — The new skill directory, its six
references/files, and theSKILL.mdfrontmatter (audience: startup) match what the PR description claims to add; no counts or cross-file version claims disagree with the tree shown. - ✅ Activation quality (advisory) — The
SKILL.mddescription is long but specific: it names the engines (vLLM,SGLang), the platforms (EKS,ECS,EC2), the cost-ceiling constraint, and explicit negative scope (Not for running a model on SageMaker endpoints or Bedrock Custom Model Import, offline batch inference, training, or serving one model across several nodes), which should make activation againstaws-ai-mlandself-hosted-llm-batch-inferencereasonably unambiguous. - ✅ Injection posture (advisory) — This skill does not consume untrusted repo contents, user files, or web pages at runtime; it is a planning/decision skill over measured infrastructure numbers, so an untrusted-content rule is not applicable here.
- ✅ Authoring conventions (advisory) — The
SKILL.mdis a thin router linking to sixreferences/files as the authoring conventions prescribe, body text is in imperative/third-person style consistent withsolution-architecture/CONTRIBUTING.md, and reference files use the prescribed**references/x.md**: Read when...link format, e.g.references/self-host-or-managed.md: Read first, before choosing any GPU.`.
🔴 concern · 🟡 borderline · ✅ clear. Advisory axes are reported but never block, since the contribution gate reserves those criteria for human reviewers.
Reviewed 7 file(s). Model: us.anthropic.claude-sonnet-5. Findings below 0.6 confidence are surfaced as borderline rather than hedged. Judgment-only: formatting, schema, and security scanning are covered by existing CI.
|
Replies to the items marked for a human, checked at d56c1ed:
|
Open SKILL.md and every reference with the decision the idle GPU floor changes and how a company with a committed GPU fleet would decide it instead. SKILL.md gains a table of the six decisions with the fleet answer, this skill's answer and the reason. Anchor the description on the company having no committed GPU fleet, so one idle GPU is a material share of a fixed ceiling. Drop "no platform team" as a reason, since a small platform team in a large company shares it. Price the break-even at on-demand list price before credits, because there is no commitment to amortize a GPU against and the floor outlasts the credits. Cut general engine and platform mechanics that read the same for any company: GPU node prerequisites on EKS, ECS and EC2 now route to aws-containers and aws-compute, the ALB idle timeout section, the TGI note, the prefill and fixed KV cache rows, the per-GPU memory list and warm pool limits are gone or reduced to a pointer. The startup log check moves to fit-one-gpu.md and the cold-start reductions to idle-floor.md, so each lives in one place. Kept, because no upstream skill covers self-managed vLLM or SGLang: the flag table, now mapped to the fit-one-gpu order, and the LoRA and benchmark flags. aws-ai-ml covers these only for SageMaker endpoints. Add the skill to the plugin README skills table, with the intro line worded as in awslabs#343 so that line merges cleanly. Refs awslabs#346
|
@dgeske, I applied your #347 standard here too, in 6b56d92 and 8cca887 (which removes self-hosted serving from the open gap list):
Bot items:
|
…-serving # Conflicts: # solution-architecture/plugins/aws-startups-solution-architecture/README.md
There was a problem hiding this comment.
solution-architecture-reviewer bot: 4 item(s) for a human
Not approving, not blocking. Something below is worth a look, but none of it is the solution-architecture-reviewer bot's call to settle: a human decides.
Reviewed 8 changed file(s).
Axis assessment
- 🟡 Staleness —
references/engine-configuration.md:17and nearby lines pin vLLMv0.31.0and SGLangv0.5.21with release dates in October 2026, which reads as either a forward-dated placeholder or a typo; a human should confirm these are real, current versions before merge since downstream flag defaults are cited from them. - 🟡 Upstream duplication (advisory) — Per the supplied
aws-core/aws-computeandaws-core/amazon-bedrocktext, no upstream skill covers vLLM/SGLang self-managed serving, KV cache sizing, or multi-LoRA adapters, so the core of this skill is not duplicative;fit-one-gpu.md's GPU pricing/memory tables border onaws-compute's instance-selection remit but the skill routes node setup upstream, so this is a judgment call left to a human reviewer rather than a clear violation. - 🟡 Scope (startup-specific) (advisory) — The skill's decision table and references consistently frame answers around the no-committed-GPU-fleet constraint (break-even traffic, one-GPU-before-two, adapters over per-fine-tune endpoints, warm-replica-vs-zero), which is the kind of constraint-reshapes-the-answer content criterion 1 asks for; a human should still confirm the GPU pricing/memory-ratio tables in
fit-one-gpu.mdare substantively startup-specific rather than general GPU-selection advice restated with a startup framing, since that file is dense with general AWS pricing mechanics alongside the startup-specific break-even framing. - ✅ Contradiction — No cross-file contradiction found; the new skill's guidance (stay managed until break-even, prefer one GPU, adapters over endpoints, warm replica or scale-to-zero) is internally consistent and does not conflict with sibling skills like
multi-tenant-isolation,agentcore-patterns, orcost-regression-check, nor with theREADME.mdskills table. - ✅ Manifest drift — The
README.mdskills table addition forself-hosted-llm-servingmatches the new skill directory and files added in this PR, and the removal of the 'Self-hosted inference serving' bullet from the open-gap list (README.md) correctly reflects that the gap is now filled by this PR. - ✅ Activation quality (advisory) — The
self-hosted-llm-servingdescriptioninSKILL.mdis detailed, names concrete triggers (KV cache exhaustion, idle GPU, cost-per-token regression) and explicit exclusions (SageMaker endpoints, Bedrock Custom Model Import, batch, multi-node), and does not obviously overlap with sibling skillsmulti-tenant-isolation,agentcore-patterns, orcost-regression-checkin this plugin. - ✅ Injection posture (advisory) — This skill does not consume untrusted repo contents, user files, or web pages as input in a way that requires an untrusted-content rule; it operates on measured logs, benchmarks, and price lookups, which is the same posture as sibling skills in this plugin.
- ✅ PR hygiene (advisory) — The PR description and prior review thread disclose the RFC linkage (
Closes #346), the deliberate scope narrowing (engine/platform sections routed toaws-core), and the undone GPU end-to-end run, all explicitly flagged rather than hidden; these are sequencing/disclosure matters already settled by the human thread. - ✅ Authoring conventions (advisory) —
SKILL.mdfrontmatter uses onlyname,description,license, andmetadata.audience, consistent with the folder's documented allowed fields, and the body follows the thin-router pattern with bolded backticked reference links, matching theagentcore-patternsexemplar and the suppliedskill-developmentconventions.
🔴 concern · 🟡 borderline · ✅ clear. Advisory axes are reported but never block, since the contribution gate reserves those criteria for human reviewers.
Borderline, for human judgement
Below the reporting threshold, so not stated as findings. A suspicion a reviewer can check beats one silently dropped.
- 🟡 staleness
solution-architecture/plugins/aws-startups-solution-architecture/skills/self-hosted-llm-serving/references/engine-configuration.md:17— The skill pins vLLM v0.31.0 and SGLang v0.5.21 as current with release dates in October 2026, which is a future date relative to any plausible review window and cannot be verified as a real, current release.engine-configuration.md:17states 'vLLM v0.31.0 (released 2026-10-05)' and the SGLang line gives a 2026-10-02 release date. These look like placeholder or speculative version/date combinations rather than verified current releases; if they are fabricated, every downstream flag name and default cited from these versions (--gpu-memory-utilizationdefaulting to 0.92, etc.) is unverifiable. A human should confirm these versions and dates are real before merge.
Reviewed 8 file(s). Model: us.anthropic.claude-sonnet-5. Findings below 0.6 confidence are surfaced as borderline rather than hedged. Judgment-only: formatting, schema, and security scanning are covered by existing CI.
|
@realAlexBarge please resolve the conflicts that have come up |
…-serving # Conflicts: # solution-architecture/plugins/aws-startups-solution-architecture/README.md
There was a problem hiding this comment.
solution-architecture-reviewer bot: 2 item(s) for a human
Not approving, not blocking. Something below is worth a look, but none of it is the solution-architecture-reviewer bot's call to settle: a human decides.
Reviewed 8 changed file(s).
Axis assessment
- 🟡 Upstream duplication (advisory) —
SKILL.md's engine-configuration table maps vLLM/SGLang flags to memory fixes, which is self-managed-engine mechanics not covered by the suppliedaws-core/aws-computeoraws-ai-mldescription text (per the maintainer's own re-check, noaws-core/aws-agentsfile mentions SGLang or KV cache). Without the fullaws-ai-mlbody supplied, I can't fully rule out overlap on model-deployment benchmarking/sizing mechanics, so this stays borderline rather than a concern, consistent with the human thread's own conclusion that it was checked and found non-overlapping. - 🟡 Scope (startup-specific) (advisory) — The skill's core break-even/one-GPU/adapters/idle-floor decisions are plausibly startup-shaped per criterion 1, as the human thread argues, but large stretches of
fit-one-gpu.md,engine-configuration.md, andbenchmark-on-target.mdare detailed vLLM/SGLang/EC2-GPU mechanics (flag tables, log line formats, benchmark CLI flags) that would read identically for an enterprise with a committed fleet once the floor arithmetic is set aside — criterion 1 explicitly reserves this judgment to human review, and the maintainer thread has already weighed in, so this is left open rather than asserted as a defect. - ✅ Contradiction — No cross-file contradiction found; the new skill's guidance (stay managed until break-even, bound before adding a GPU, adapters over one-endpoint-per-fine-tune) is consistent with the rest of the plugin and does not conflict with
aws-coreoradvisor/guidance supplied. - ✅ Staleness — All dated facts (
2026-10-05price lookups, pinnedvLLM v0.31.0andSGLang v0.5.21) are presented as measured-on-this-date values with explicit re-check instructions, not as evergreen claims; no sunset service is recommended anywhere in the diff — Bedrock Custom Model Import, SageMaker endpoints and Spot are all discussed factually or as comparators, never recommended as the final answer over a non-deprecated alternative. - ✅ Manifest drift — The
README.mdskills table and the 'What to contribute' gap list are updated consistently: the newself-hosted-llm-servingrow is added and the old 'Self-hosted inference serving' gap bullet is removed in the same diff, so the manifest and the gap list agree with the new skill's existence. - ✅ Activation quality (advisory) — The
self-hosted-llm-servingdescription is detailed and scoped (online self-managed serving on vLLM/SGLang with no committed GPU fleet) and explicitly excludes SageMaker endpoints, Custom Model Import, batch, training, and multi-node serving, with disclosed validation runs showing clean routing against sibling skills andaws-ai-ml; no overlap with a sibling in this plugin's table is apparent. - ✅ Injection posture (advisory) — The skill consumes production logs, benchmark output, and prompt samples, but these are operator-supplied measurement artifacts rather than untrusted third-party content (e.g. web pages or arbitrary repo contents), and
benchmark-on-target.md:9even instructs removing personal/customer data before use, which is the closest sibling convention to an untrusted-content rule for this kind of input. - ✅ PR hygiene (advisory) — The PR discloses the one undone item (no end-to-end GPU run) plainly in its description and the discussion thread, and the human reviewer thread already resolved the scope/overlap/PR-hygiene questions that were flagged; per instructions this sequencing is left to the people who own the process.
- ✅ Authoring conventions (advisory) —
SKILL.mdfrontmatter uses onlyname,description,license, andmetadata.audience(no bannedversionorwhen_to_use), the description opens with the required third-personThis skill should be used when, and the file follows the thin-router-plus-references/layout mandated bysolution-architecture/CONTRIBUTING.md, consistent with the exemplaragentcore-patternsskill cited in the README.
🔴 concern · 🟡 borderline · ✅ clear. Advisory axes are reported but never block, since the contribution gate reserves those criteria for human reviewers.
Reviewed 8 file(s). Model: us.anthropic.claude-sonnet-5. Findings below 0.6 confidence are surfaced as borderline rather than hedged. Judgment-only: formatting, schema, and security scanning are covered by existing CI.
Problem
A startup moves an open-weight or fine-tuned model off a per-token API and starts vLLM or SGLang with defaults on whatever GPU it could get. The result is a KV cache exhausted under real concurrency, a GPU idle most of the day, or a cost per token above the API it left. The company has no committed GPU fleet to absorb an idle GPU, so every replica is new spend from a fixed cost ceiling, and one replica can be a material share of it.
Closes #346.
Solution
Add the
self-hosted-llm-servingskill with a thinSKILL.mdrouter (metadata.audience: startup) and six references. Each file opens with the decision it covers and what a committed GPU fleet would allow instead.SKILL.md: a table of six decisions with the committed-fleet answer, this skill's answer and the reason; scope; the four ordered decisions; required deliverables; upstreamSkill()pointers and anti-patterns. Every number comes from a log, a benchmark or a price lookup, at on-demand list price before credits.self-host-or-managed.md: a break-even traffic number against per-token Bedrock, Custom Model Import and SageMaker inference components.fit-one-gpu.md: weights plus KV cache at measured context and concurrency, the startup log lines that confirm it, and the fixes to try before a second GPU.engine-configuration.md: pinned vLLM and SGLang versions, and each fix fromfit-one-gpu.mdmapped to its engine flag. GPU node setup routes toaws-containersandaws-compute.multi-lora.md: serve several fine-tunes as LoRA adapters on one base model instead of one endpoint each.idle-floor.md: one warm replica or scale to zero, priced against measured cold start, and how to shorten it.benchmark-on-target.md: a concurrency sweep on the target instance against a latency target.Also adds the skill to the plugin README's skills table.
SageMaker endpoints and Custom Model Import route to
aws-core, offline batch work routes toself-hosted-llm-batch-inference, and multi-node serving is out of scope.Type of Change
Team Folder
advisor/migrate/solution-architecture/Validation
mise run fmt,mise run lint:mdandmise run buildpassed.Skill()pointers exist (agent-toolkit-for-aws at 188af2f foraws-core), and all 25 cited URLs returned HTTP 200.aws-coreandaws-agentsloaded, two runs per prompt on one model: serving prompts activated this skill, SageMaker or Custom Model Import prompts activatedaws-ai-ml, and the batch prompt activatedself-hosted-llm-batch-inference, in 18 of 18 runs. A prompt about an enterprise with a reserved GPU fleet activated no skill in 2 of 2 runs.Detailed validation notes are available on request.
Checklist
mise run buildlocally and it passesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.