본문으로 건너뛰기
cccskills
무료GitHub에 공개

cost-guardrail

LLM and cloud cost awareness — model tiering, token budgets, right-sizing, and when a cheaper model suffices. Trigger before finalising any architecture that calls LLMs, before scaling a workload, or when a cost estimate is needed.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md4.8 KB
  • references/model-routing.md3.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Cost Guardrail

The most expensive model is the one running on every request when it does not need to.

LLM cost is not a finance problem — it is an architecture problem. The design determines the bill. This skill enforces cost-awareness as a first-class design constraint, not an afterthought.

When to use

  • Designing any system that calls an LLM (directly or via an agent)
  • Before scaling a workload to higher volumes
  • When a cost estimate is required for a feature or release
  • When reviewing an architecture for unbounded cost vectors
  • When choosing between model tiers for a given task

Procedure

  1. Identify every LLM call in the system — list: which agent or component makes the call, the model tier used, the approximate input and output token counts, and the call frequency (per user action / per minute / per batch).

  2. Apply the model tiering test — for each LLM call, ask:

    • Does this task require deep reasoning, or is it classification / extraction / reformatting?
    • Can the task be completed with a smaller or faster model?
    • Is the model tier choice based on evidence (benchmark, A/B test) or assumption?

    Starting hypotheses only (verify current pricing and qualify each task family before relying on them):

    Task typeAppropriate tier
    Simple classification, extraction, summarisationSmall / fast model
    Complex reasoning, multi-step planning, code generationMid-tier model
    Deep analysis, architecture decisions, adversarial reviewHighest-tier model

    A short ticket or one-file change does not qualify a cheap model. Require independent acceptance, preserve consequence floors, count failed attempts and bound escalation. Use the project's explicitly adopted routing mode; the routing guide is not automatic consumer activation. Model/effort changes require a fresh baseline.

  3. Identify unbounded cost vectors — flag any call pattern where the token count or call volume has no upper bound:

    • Loops that call an LLM until a condition is met (with no max-iteration guard)
    • User-triggered calls with no rate limiting
    • Context windows that grow unboundedly across a conversation
    • Batch jobs with no per-run budget ceiling
  4. Estimate the monthly cost envelope — for each LLM call:

    estimated monthly cost ≈ (input tokens × input price) + (output tokens × output price) × calls/month
    

    Use current published rates from your provider. Do not use rates from training data — they change.

  5. Add cost controls — for each unbounded vector:

    • Set a max-token budget per call (trim context if needed)
    • Add rate limiting at the application layer
    • Add a budget alert at the infrastructure layer
    • Consider caching repeated calls with identical or near-identical inputs
  6. Check for caching opportunities — LLM calls that return the same result for the same input are cacheable. Prompt caching (where supported by the provider) can reduce cost significantly on repeated prefixes.

  7. Document the cost model — in the ADR or design doc, record: model tiers chosen, rationale, estimated monthly cost at target scale, and the controls in place.

Outputs

  • LLM call inventory: component | model tier | input tokens (est.) | output tokens (est.) | frequency | monthly cost (est.)
  • Unbounded cost vectors flagged with mitigations
  • Monthly cost estimate at target scale
  • Recommended model tier per call with rationale

Guardrails

  • Never use pricing from training data. Rates change. Fetch current rates from the provider's documentation before estimating.
  • A call that "works" at low volume may be unaffordable at scale. Always estimate at the target scale, not the current scale.
  • Caching is not optional for high-frequency repeated calls. An uncached LLM call repeated thousands of times per day is a design flaw.
  • Token budgets are architecture decisions. Decide them explicitly; do not let the model decide by consuming whatever context is available.

Anti-rationalization table

ExcuseCounter
"It's only a few cents per call"At scale, cents become thousands of dollars. Estimate the monthly envelope.
"We'll optimise later"Cost optimisation is hardest after the architecture is set. Do it now.
"The big model gives better results"Verify with a test. Small models are often sufficient for structured tasks.
"We don't know the volume yet"Estimate a range. A 10x cost swing between low and high volume is a design risk.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Google ADK (Agent Development Kit) orchestration patterns — boundaries, agent composition, and tool seams. Trigger when designing or reviewing multi-agent systems built on ADK. Authoritative source: adk.dev.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jpantsjoha/ai-native-developer-experience132026년 10월 16일 업데이트

JP's signature red-team pass — "how would I break this?" Argue against your own approach before proceeding. Trigger on any high-stakes decision, architecture choice, or before marking work complete.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jpantsjoha/ai-native-developer-experience132026년 10월 16일 업데이트

Read-only SRE checkup of any GCP project: deterministic probes of the edge, Cloud Run services, 7-day error logs, Cloud Scheduler, alert policies and uptime checks, Secret Manager and IAM, the data stores and the machine's own scheduled jobs, audited into one fixed status table (LIVE / WARNING / RED / INCONCLUSIVE) with evidence, findings by severity, what could not be checked, and a single OVERALL line delivered as one notification. Parametrised by a per-project manifest, so the same routine runs on every project. Use when the operator says "cloud checkup", "SRE check", "is everything live", "what's healthy / warning / red", "any errors this week", "audit the infra", "weekly checkup", "set up the weekly checkup", before a deploy or demo, or after an incident. Cloud Run first; App Engine and GKE differ only in the serving probes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jpantsjoha/ai-native-developer-experience132026년 10월 16일 업데이트

Cloud guardrails for any vendor workload — Google Cloud (GCP, Vertex AI, GKE), AWS (IAM, EKS, Bedrock), Azure (Entra ID, Policy, AKS), Alibaba Cloud (RAM, mainland/international residency). Enforces identity least-privilege, mechanical policy, data boundaries, residency, cost caps, network egress and observability, with official-source validation before any claim. Trigger on any cloud infrastructure design, review, Terraform plan, or LLM/agent deployment; the-architect routes here.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jpantsjoha/ai-native-developer-experience132026년 10월 16일 업데이트

Challenge vision alignment, value, cost, risk and operating ownership at material scope or release decisions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jpantsjoha/ai-native-developer-experience132026년 10월 16일 업데이트

Decompose an epic into atomic parallelizable tasks, route each to the right skill, and keep the four delivery records straight — issues, STATUS, ROADMAP, CHANGELOG. Use as a meta-router when several skills could apply, and as the baseline for how delivery state is recorded. Trigger at the start of any multi-track epic, when the skill count exceeds ~12, or when the records have drifted from reality.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jpantsjoha/ai-native-developer-experience132026년 10월 16일 업데이트

jpantsjoha의 스킬 모두 보기

이 스킬의 문제 신고