DEV Community

Cover image for Non-functional Application Requirements: Cost

Non-functional Application Requirements: Cost

In January 2024, Jack Ellis, founder of the analytics company Fathom, published a line-by-line account of $94,885 a year in savings on his team's AWS bill (Fathom, 2024). Fathom has no outside funding, and its ingest endpoint takes billions of requests a month on Lambda.

None of it came from a discount. It came from removing work: one Lambda invocation per pageview instead of two, a queue off the hot path, database traffic off a NAT gateway, logs nobody read.

Here's the line that makes it a cost story. Fathom raised its entry-level price by only $1, Ellis wrote, "because we knew we could get our costs down and not have to charge our customers lots more."

Cost decides what you can charge. That's why it belongs in your requirements.

TL;DR

  • Make cost a number: cost per unit of value (per request, tenant or successful task), not the monthly total.
  • Most waste is multiplication. Find the path where the money goes and read it line by line.
  • Run the FinOps loop, Inform → Optimize → Operate, and tag first. You can't optimize spend nobody owns.
  • Give every workload a budget and an anomaly monitor. It's about 90 lines of Terraform.
  • For AI the unit is the token, output costs about 5x input, and an agent without a session budget is an open tab.

What: cost, price and value

People use these three interchangeably. Don't. Cost is what you pay to deliver the service: the AWS bill, plus licenses, support and the people who run it. Price is what your customer pays. Value is what they get, and it caps the price. When cost per pageview drops, you can hold price and keep margin, which is exactly what Fathom did.

Cost, price and value. Cost: what you pay to deliver the service, meaning the AWS bill, licenses, support and the people who run it. Price: what your customer pays. Value: what your customer gets, and it caps the price. When cost per unit drops, you can hold price and keep your margin.

A bill that doubles while traffic triples is good news. The measurable form of this NFR is unit economics: cost divided by a unit the business cares about. The FinOps Framework puts it in the Quantify Business Value domain. AWS Well-Architected calls the same idea "measure overall efficiency."

Pick units you can test:

  • Cost per request, for APIs, and cost per tenant, for SaaS.
  • Cost per successful task, for AI features. Failed and retried calls count against it.
  • Tag coverage: the share of spend you can attribute to an owner. If much of the bill is untagged, every other number is a guess.

Write the target like a latency SLO: "ingest stays under $0.50 per million events at 2x today's traffic."

Why: waste is growing again

Flexera's 2026 State of the Cloud survey of more than 750 cloud decision-makers put estimated wasted cloud spend at 29%, the first increase in five years, with AI workloads named as a driver. 85% called managing cloud spend their top challenge (Flexera, March 2026).

AI moved fast. In the State of FinOps 2026 (1,192 respondents), 98% said they now manage AI spend, up from 31% in 2024 (FinOps Foundation, 2026).

Werner Vogels made it the first law of The Frugal Architect: "Make Cost a Non-functional Requirement." This series started from that keynote, so this part takes the law literally.

The case study: how Fathom cut $94,885 a year

Fathom's ingest path looked like many serverless systems that grew fast. A third-party CDN sent each pageview through AWS WAF and an Application Load Balancer to a Lambda function, which put a job on SQS. A second Lambda wrote it to Redis and SingleStore and logged to CloudWatch. It ran on Laravel Vapor, which deploys Laravel to Lambda.

The queue had a reason. Their database once ran in a single Availability Zone, so SQS buffered ingest from storage. That was an availability decision, and a sound one. Later the databases moved to multiple AZs. For a while, the queue stayed anyway.

flowchart LR
  subgraph B["Before: every pageview"]
    B1["CDN"] --> B2["WAF + ALB"] --> B3["Lambda 1"] --> B4["SQS"] --> B5["Lambda 2"] --> B6["Redis + SingleStore"]
    B5 --> B7["CloudWatch logs<br/>nobody read"]
    B6 -.->|"via NAT gateway"| B8["NAT data charges"]
  end
  subgraph A["After"]
    A1["CDN"] --> A2["WAF + ALB"] --> A3["One Lambda"] --> A6["Redis + SingleStore<br/>VPC peering, PrivateLink"]
    A3 -.->|"only if the database is down"| A4["SQS fallback"]
  end

Each pageview went from two Lambda invocations and a queue hop to one invocation, with SQS kept only as a fallback.

Ellis went after one endpoint, because "that's where all the money was being spent." What he found, in his numbers:

  • SQS, $23,989 a year, and Lambda, $20,862. With multi-AZ databases, the hot path didn't need the queue. One Lambda request per pageview halved invocations, and duration fell because the function now did a Redis hit and an insert, each typically 1 ms or less.
  • NAT gateway, $17,162. Database traffic was crossing the NAT gateway. It moved to VPC peering for Redis and AWS PrivateLink for SingleStore. "After seeing vast amounts of data being moved across it, I admitted I was wrong."
  • CloudWatch, $7,550. Lambda wrote logs nobody used, since errors went to Sentry. He removed the log permission and told readers to set retention, which log groups lack by default.
  • S3, $5,774. Versioning was on in one bucket, quietly keeping history.
  • The rest: WAF $12,201 (rate limiting moving to the CDN), CloudFront $4,800 (an internal sync moving about 4 TB a month), Route 53 $2,547 (longer DNS TTLs, fewer billed queries).

WAF and Route 53 were still in progress when he wrote it up, and CloudFront was a cost he said they "can easily remove", so about $19,500 of the total was still to come. Fathom doesn't publish its total bill, so there's no percentage, only dollars.

Let's put a number on the multiplier. At us-east-1 list prices (October 2026), Lambda requests cost $0.20 per million and SQS standard requests $0.40 per million (AWS Price List). A billion events a month, each making one extra Lambda call and one queue request, add about $600 in request fees alone, before duration, logs or data transfer. Per event it's nothing. Every event, every month, it's a line item.

Four lessons I'd put on any team's wall:

  1. Find the path where the money goes. Fathom audited one endpoint, the one carrying the traffic.
  2. Count work per business event. Two invocations and a queue hop per pageview is a design choice, and it multiplies.
  3. Distrust defaults. No log retention, versioning left on, traffic through NAT. Nobody decided any of them.
  4. Revisit a trade-off when its reason expires. The queue paid for availability until multi-AZ databases took over that job.

The FinOps loop that makes it repeatable

Fathom's review was a project. Keeping the savings takes a loop. The FinOps Framework calls its three phases Inform, Optimize and Operate.

flowchart LR
  I["Inform<br/>tags, Cost Explorer,<br/>CUR 2.0, unit cost"] --> O["Optimize<br/>right-size, delete,<br/>Savings Plans"]
  O --> P["Operate<br/>budgets, anomaly alerts,<br/>monthly review"]
  P -->|"new usage, new questions"| I
  P -.->|"cost in the design doc"| D["Next feature"]
  D -.-> I

The loop only turns if Operate feeds back into Inform, and new features enter with a cost estimate already attached.

Duolingo ran this loop in 2024 and reported 20% annualized savings within months, with weekly cost reports, cost estimates in tech specs and quarterly spend reviews (Duolingo, 2024). One find rhymes with Fathom's: a staging environment cost more than production because someone scaled it up for a test and forgot.

When: where cost enters the lifecycle

  • Design. Estimate unit cost and count calls per business event before you build.
  • Build. Make the cheap path the default: log retention, S3 lifecycle rules, table TTLs, tags in IaC. Infracost (Apache 2.0) adds a cost diff to Terraform pull requests.
  • Test. Read cost per request off your load test, a day later, once Cost Explorer catches up.
  • Operate. Budgets and anomaly alerts per workload, a monthly look at Cost Optimization Hub, one owner per tag.

Where: AWS services and the alternatives

Cost allocation tags come first, because every other tool groups by them. A tag counts only after you activate it, and a backfill reaches back 12 months.

flowchart LR
  T["Tag in IaC<br/>app, team, env"] --> R["Resources and<br/>Bedrock inference profiles"]
  R --> U["Usage records"]
  K["Activate tag<br/>in Billing console"] --> U
  U --> CE["Cost Explorer<br/>group by tag"]
  U --> CUR["Data Exports<br/>CUR 2.0"]
  U --> BU["AWS Budgets<br/>filter by tag"]
  U --> AD["Cost Anomaly Detection<br/>monitor by tag"]
  CUR --> UE["Unit cost<br/>per tenant or request"]

An untagged or unactivated resource never reaches the right-hand side, so it never gets an owner, a budget or an alert.

Cost Explorer is the free console for trends: 13 months back, 18 months of forecast, refreshed at least daily. Its API costs $0.01 per paginated request. For unit cost, export line items with Data Exports (CUR 2.0) and join them with request counts.

AWS Budgets alerts on actual or forecast spend and updates up to three times a day, so it's a smoke alarm, not a circuit breaker. Budget actions can apply an IAM policy or SCP, or stop EC2 and RDS instances.

Cost Anomaly Detection runs about three times a day, can take 24 hours to spot something, and needs 10 days of history for a new service. Each account gets one AWS-managed services monitor, and a management account up to 500 customer-managed ones.

Trusted Advisor, Compute Optimizer and Cost Optimization Hub find idle and oversized resources. The Hub prices them with your discounts. Trusted Advisor's full check set needs Business Support+ or higher.

Open source. OpenCost, a CNCF incubating project, allocates Kubernetes cost down to the container. LiteLLM (MIT) enforces per-key and per-team budgets in an LLM gateway.

Decide: commitments, and what cost work costs elsewhere

Option What it covers Up to Term Choose when
Compute Savings Plans EC2 any family or Region, Fargate, Lambda 66% off 1 or 3 years Your compute mix will change
EC2 Instance Savings Plans One instance family in one Region 72% off 1 or 3 years A stable fleet you won't re-platform
Database Savings Plans Aurora, RDS, DynamoDB, ElastiCache, OpenSearch and more 35% off 1 year Steady database spend across engines
Reserved Instances Specific instance types, Standard or Convertible 72% off 1 or 3 years Services or shapes Savings Plans don't fit
Spot Spare EC2 capacity, interruptible 90% off None Stateless, retryable batch and CI work
Bedrock Reserved tier Guaranteed tokens per minute for a model Capacity, not a discount 1 or 3 months Predictable, high-volume inference

AWS's maximum discounts, from the Savings Plans FAQ, Reserved Instances and Spot pages, October 2026. Commit to your floor, not your peak.

How cost pulls against the other NFRs:

NFR Where cost work helps it Where it hurts it
Security Deleting unused resources shrinks attack surface Cutting WAF or logs to save money
Compliance Data minimization cuts storage and risk Residency can rule out the cheapest Region or global inference
Accessibility Lean pages suit cheap devices Generated captions and alt text cost model calls
Performance Fewer hops is faster too Caches, provisioned concurrency and Priority tier bill when idle
Availability Multi-AZ data can retire a buffer queue Every redundant copy is paid for
Scalability Scale-to-zero removes idle cost Commitments can lock in capacity you outgrow
Maintainability Fewer services to run Clever cost hacks are hard to hand over
Sustainability Less compute per request saves energy too A cheap Region isn't always a clean one

Hands-on: a budget, an anomaly monitor and a tagged model

This stack gives one workload, the line copilot at Harbor Works (the fictional plant in Luso, this series' companion app), an owner tag, a tagged Bedrock inference profile, a monthly budget with forecast alerts and an anomaly monitor. Every alert goes to one SNS topic.

Checked against the Terraform AWS provider docs for each resource and the Cost Anomaly Detection SNS policy page on Oct 29, 2026. terraform validate passes on Terraform 1.17.1 with AWS provider 6.71.0. Not deployed, so test it in a sandbox account first.

terraform {
  required_providers {
    aws = { source = "hashicorp/aws", version = "~> 6.71" }
  }
}
provider "aws" {
  region = "us-east-1"
  default_tags { tags = { app = "line-copilot", env = "prod" } } # tag everything
}
data "aws_caller_identity" "me" {}

# Activation fails until the key has appeared in billing data (up to 24 hours).
resource "aws_ce_cost_allocation_tag" "app" {
  tag_key = "app"
  status  = "Active"
}

# Use this profile's ARN as modelId so Bedrock token spend carries the tags.
resource "aws_bedrock_inference_profile" "copilot" {
  name = "line-copilot-sonnet"
  model_source {
    copy_from = "arn:aws:bedrock:us-east-1:${data.aws_caller_identity.me.account_id}:inference-profile/us.anthropic.claude-sonnet-4-6"
  }
  tags = { feature = "shift-summary" }
}

resource "aws_sns_topic" "cost" { name = "line-copilot-cost-alerts" }
data "aws_iam_policy_document" "cost" {
  statement {
    actions   = ["SNS:Publish"]
    resources = [aws_sns_topic.cost.arn]
    principals {
      type        = "Service"
      identifiers = ["budgets.amazonaws.com", "costalerts.amazonaws.com"]
    }
    condition {
      test     = "StringEquals"
      variable = "aws:SourceAccount"
      values   = [data.aws_caller_identity.me.account_id]
    }
  }
}
resource "aws_sns_topic_policy" "cost" {
  arn    = aws_sns_topic.cost.arn
  policy = data.aws_iam_policy_document.cost.json
}

resource "aws_budgets_budget" "copilot" {
  name         = "line-copilot-monthly"
  budget_type  = "COST"
  limit_amount = "1500"
  limit_unit   = "USD"
  time_unit    = "MONTHLY"
  cost_filter {
    name   = "TagKeyValue"
    values = ["user:app$line-copilot"] # format is user:<key>$<value>
  }
  dynamic "notification" { # warn on the forecast, then at 80% actual
    for_each = { FORECASTED = 100, ACTUAL = 80 }
    content {
      notification_type         = notification.key
      threshold                 = notification.value
      threshold_type            = "PERCENTAGE"
      comparison_operator       = "GREATER_THAN"
      subscriber_sns_topic_arns = [aws_sns_topic.cost.arn]
    }
  }
  depends_on = [aws_sns_topic_policy.cost]
}

resource "aws_ce_anomaly_monitor" "copilot" {
  name         = "line-copilot"
  monitor_type = "CUSTOM" # customer managed: up to 10 tag values, monitored together
  monitor_specification = jsonencode({
    And  = null, CostCategories = null, Dimensions = null, Not = null, Or = null
    Tags = { Key = "app", MatchOptions = null, Values = ["line-copilot"] }
  })
}
resource "aws_ce_anomaly_subscription" "copilot" {
  name             = "line-copilot-immediate"
  frequency        = "IMMEDIATE" # IMMEDIATE requires an SNS subscriber
  monitor_arn_list = [aws_ce_anomaly_monitor.copilot.arn]
  subscriber {
    type    = "SNS"
    address = aws_sns_topic.cost.arn
  }
  threshold_expression {
    dimension {
      key           = "ANOMALY_TOTAL_IMPACT_ABSOLUTE"
      match_options = ["GREATER_THAN_OR_EQUAL"]
      values        = ["50"]
    }
  }
  depends_on = [aws_sns_topic_policy.cost]
}
Enter fullscreen mode Exit fullscreen mode

Three things will catch you. Cost allocation tags are managed from the management account, so run the tag resource there. Tags aren't retroactive without a backfill. And a KMS-encrypted topic needs key policy grants for both services.

Cost in the age of AI

AI as a workload: the token is the unit

You pay for input and output tokens at different prices. In the us-east-1 price list dated October 12, 2026, Claude Sonnet 4.6 on the global cross-Region profile costs $3.00 per million input tokens and $15.00 per million output tokens (AWS Price List). The US geographic profile costs 10% more.

Take a Harbor Works shift summary: 6,000 tokens in, 500 out, $0.0255 per call. Output is 8% of the tokens and 29% of the cost. A million summaries a month is $25,500, so cap maxTokens and ask for short answers before anything else.

Attribute it before you optimize it. Application inference profiles, IAM principal tags (since April 2026), and projects and workspaces on the bedrock-mantle endpoint all deliver billed dollars to Cost Explorer and CUR 2.0, per usage type per day (Bedrock cost management). Profiles cover InvokeModel and Converse on bedrock-runtime, one per model and tag set. Request metadata adds per-call detail to invocation logs.

Alert where the bill lands. In May 2026, The Register reported a reader whose Claude Opus usage on Bedrock reached $30,141.33 in April with no anomaly alert (The Register, 2026). Claude bills through AWS Marketplace, which anomaly detection didn't monitor then, and $8,026.54 of credits hid the spend for weeks. AWS added third-party Bedrock models on August 19, 2026. Keep a budget alarm too. A second alarm costs almost nothing.

Pull the levers in order. Each is cheaper to try than the next.

flowchart TB
  L1["1. Right-size the model<br/>Haiku 4.5 is 3x cheaper than Sonnet 4.6 here,<br/>Nova 2 Lite about 8x"] --> L2["2. Intelligent Prompt Routing<br/>easy prompts go to the smaller model"]
  L2 --> L3["3. Prompt caching<br/>reuse the stable prefix"]
  L3 --> L4["4. Batch or Flex tier<br/>half price for work nobody waits on"]
  L4 --> L5["5. Distillation<br/>train a small model on the big one"]
  L5 --> L6["6. Reserved tier<br/>buy capacity once volume is steady"]
  E["Eval suite"] -.->|"gates every step"| L1
  E -.-> L2
  E -.-> L5

Start at the top and only move down when the step above is done and your evals still pass.

  1. Right-size. The same call costs $0.0085 on Claude Haiku 4.5 and $0.00305 on Amazon Nova 2 Lite, at global list prices. Run your evals on the smaller model first.
  2. Intelligent Prompt Routing sends each prompt to the cheaper model in a family unless the predicted quality gain clears your threshold. AWS claimed up to 30% savings at preview in 2024. It's optimized for English.
  3. Prompt caching. Care Access caches each medical record as the prompt prefix and changes only the question. It reported 86% lower Bedrock costs and 66% faster processing (AWS Machine Learning Blog, November 2025). On Sonnet 4.6 a cache read costs a tenth of fresh input, so a 4,000-token cached prefix cuts our call to $0.0147, once the first call has written it at a 25% premium. The prefix needs at least 1,024 tokens, and batch can't use the cache.
  4. Batch and Flex. Batch lists at half the on-demand rate for these models. The Flex tier, set with serviceTier, halves Nova 2 Lite's price but queues behind Standard under load. The 2 a.m. shift summary belongs here.
  5. Distillation. AWS claims distilled models run up to 500% faster and 75% cheaper with under 2% accuracy loss for RAG (AWS, May 2025). It's a vendor figure, so measure it on your own data.
  6. Reserved tier. You buy tokens per minute for 1 or 3 months, with a 100,000 input TPM minimum. In AWS's October 2026 price list, a fully used 1-month Sonnet 4.6 reservation costs the same per token as on-demand Standard, and the 3-month term is 10% less. The pricing page doesn't show Reserved rates and access goes through your account team, so confirm your quote. You're buying guaranteed capacity, not a discount.

Self-hosting is a seventh lever that pays only at volume. Part 7, Scalability, works through that break-even.

Runaway agents are a new failure mode. One request can become dozens of model calls, and a loop that never reaches end_turn burns tokens until something stops it. Billing alarms see it hours later. The stop belongs in the request path.

sequenceDiagram
  participant U as User
  participant A as Agent loop
  participant G as Budget guard
  participant K as Kill switch
  participant B as Bedrock
  U->>A: one request
  loop each step
    A->>G: next call
    G->>K: AI enabled? cached 30s
    G->>G: steps and dollars under cap?
    G->>B: Converse with maxTokens sized to what is left
    B-->>G: usage in tokens
    G->>G: add cost to session total
  end
  G-->>A: BudgetExceeded
  A-->>U: partial answer and a clear message

The guard checks the switch and the session's spend before every call, so a runaway loop stops within one step, not one billing cycle.

Checked against the Converse API reference and the us-east-1 Bedrock price list on Oct 29, 2026. Unit-tested with botocore's Stubber on boto3 1.43.121 for the budget-exceeded and kill-switch paths. Not deployed, so test it in a sandbox account first.

# budget_guard.py: per-session token budget and a kill switch around Converse
import time
import boto3

bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")
ssm = boto3.client("ssm", region_name="us-east-1")

# USD per 1M tokens: Claude Sonnet 4.6, global profile, us-east-1 price list, Oct 2026
PRICE = {"in": 3.00, "out": 15.00, "cache_read": 0.30, "cache_write": 3.75}
_switch = {"value": "on", "checked": 0.0}


class BudgetExceeded(Exception):
    pass


def ai_enabled(ttl=30):
    """One SSM parameter flips every agent off. Cached so each step isn't an SSM call."""
    if time.time() - _switch["checked"] > ttl:
        param = ssm.get_parameter(Name="/line-copilot/ai-enabled")["Parameter"]
        _switch.update(value=param["Value"], checked=time.time())
    return _switch["value"] == "on"


def call_cost(u):
    return (u.get("inputTokens", 0) * PRICE["in"]
            + u.get("outputTokens", 0) * PRICE["out"]
            + u.get("cacheReadInputTokens", 0) * PRICE["cache_read"]
            + u.get("cacheWriteInputTokens", 0) * PRICE["cache_write"]) / 1_000_000


class Session:
    def __init__(self, session_id, max_usd=0.50, max_steps=12):
        self.id, self.max_usd, self.max_steps = session_id, max_usd, max_steps
        self.spent, self.steps = 0.0, 0

    def converse(self, model_id, messages, **kwargs):
        if not ai_enabled():
            raise BudgetExceeded("kill switch is off")
        if self.steps >= self.max_steps or self.spent >= self.max_usd:
            raise BudgetExceeded(f"{self.id}: {self.steps} steps, ${self.spent:.4f}")
        # Cap output to what the remaining budget can pay for (floor of 64 tokens).
        left = self.max_usd - self.spent
        max_out = max(64, min(2048, int(left * 1_000_000 / PRICE["out"])))
        resp = bedrock.converse(
            modelId=model_id,
            messages=messages,
            inferenceConfig={"maxTokens": max_out},
            requestMetadata={"session": self.id},  # per-call detail in invocation logs
            **kwargs,
        )
        self.steps += 1
        self.spent += call_cost(resp["usage"])
        return resp
Enter fullscreen mode Exit fullscreen mode

Pass the profile ARN from the Terraform stack as model_id and the spend lands under the app tag too. The guard can overshoot by one call, so the output cap shrinks as the budget runs down.

Vector storage can quietly dominate RAG cost. S3 Vectors charges $0.06 per GB-month, so a million 1,024-dimension vectors, about 4 GB, cost roughly $0.25 a month to store, plus $2.50 per million queries (S3 pricing). A classic OpenSearch Serverless collection bills at least 2 OCUs, about $350 a month at $0.24 per OCU-hour. The catch is S3 Vectors' latency, around 100 ms for frequent queries, so put it behind a smaller, faster hot tier.

AI as an engineering aid

AI assistants are good at the reading. The AWS Billing and Cost Management MCP server lets an assistant query cost, budget, anomaly and Savings Plans data, with a SQL engine for the arithmetic (AWS, August 2025). The AWS FinOps Agent, in free preview in us-east-1 since June 9, 2026, investigates anomalies and can open Jira tickets and post to Slack (AWS, June 2026).

They're bad at judgment. An assistant will happily recommend a three-year commitment for a workload you're about to re-platform. The guardrails I'd set:

  • Read-only billing roles. No purchase or budget-action permissions.
  • Every number cites a query you can rerun. Spot-check it against CUR.
  • Count the assistant's own cost: Cost Explorer API pages are $0.01 each, and agent loops are inference too.
  • A human approves every commitment, deletion and budget action.

Who: owners and the shared responsibility split

Activity Product owner Architect Developers Platform / FinOps
Unit cost target and price decisions A C I R
Calls per event, model choice, cost in design docs C R/A R C
Tags, retention, caps, budget guards I C R/A C
Budgets, anomaly alerts, commitments, monthly review I C C R/A

R = responsible, A = accountable, C = consulted, I = informed.

AWS sets prices, meters usage and supplies recommendations. What you control depends on compute type:

  • EC2: instance size, purchase option, and shutting down what's idle.
  • Containers (ECS on Fargate, EKS): task and pod sizing, bin packing, the Spot mix.
  • Lambda: memory, duration, invocations per event, log volume. INIT time has been billed since August 1, 2025.
  • Managed AI (Bedrock): the provider sets token prices and caching rules. You own tokens per task, model choice, output caps and session budgets.

Monday checklist

  • [ ] Pick one unit cost metric for your busiest workload and write a target for it.
  • [ ] Find the endpoint with the most spend and count service calls per request on it.
  • [ ] Set retention on every CloudWatch log group that has none.
  • [ ] Activate app and team as cost allocation tags and check tag coverage.
  • [ ] Deploy the budget and anomaly monitor above for one workload.
  • [ ] Route Bedrock calls through a tagged application inference profile.
  • [ ] Cap maxTokens on every model call, and put a per-session budget on every agent.
  • [ ] Run your eval set on the next-smaller model.
  • [ ] Add a prompt cache checkpoint after your stable prefix and watch cacheReadInputTokens.

Conclusion

Fathom didn't negotiate a better rate. It read its ingest path one service at a time and removed work each request didn't need: a second invocation, a queue that had outlived its reason, traffic through NAT, logs nobody opened. That bought the room to raise prices by a dollar instead of more.

The method holds for AI. Measure the unit, tokens per successful task. Attribute it with tags, profiles and principals. Pull the levers in order and gate each with evals. Then put a budget in the request path, because the billing alarm arrives a day late.

Your bill is your architecture, itemized.


Series: Non-functional Application Requirements

  1. Non-functional Application Requirements: An Introduction
  2. Non-functional Application Requirements: Security
  3. Non-functional Application Requirements: Compliance
  4. Accessibility
  5. Performance
  6. Availability
  7. Scalability
  8. Maintainability
  9. Cost
  10. Sustainability (coming soon)

Cover image: AWS re:Invent 2023 – Keynote with Dr. Werner Vogels

Next up, Sustainability: the series closes with published expert voices on energy and carbon per unit of work, and why most cost levers are carbon levers too.

Sources

Top comments (0)