AI Calculator Pro

AWS Lambda + LLM Cost Calculator

Estimate combined AWS Lambda and LLM cost per invocation.

Quick answer

With the default inputs, $426.87/month — Lambda $6.87 + LLM $420.00. Enter your own numbers below to recompute instantly; the full step-by-step math is shown under the worked example.

Results update automatically as you type.

Result
$426.87/month
Lambda $6.87 + LLM $420.00
  • AWS prices are region-agnostic estimates; free tier not applied.
Lambda compute
$6.67
Lambda requests
$0.2000
Lambda subtotal
$6.87
LLM subtotal(GPT-4o mini)
$420.00
Total / month
$426.87

Estimate the combined cost of an AI feature running on AWS Lambda that calls an LLM. Enter your invocation volume, Lambda memory and duration, and per-call tokens to see Lambda compute, request, and LLM costs together.

How this is calculated

We add two monthly costs: Lambda (invocations × request price + invocations × GB-seconds × compute price, where GB-seconds = memory in GB × duration in seconds) and LLM (invocations × (input tokens × input price + output tokens × output price)). It's region-agnostic and excludes the free tier.

Is this a good result? What to do next

For most AI features the LLM dominates — Lambda compute is usually cents to a few dollars while token cost scales with volume. If Lambda is the bigger line, your function is probably over-provisioned on memory or duration.

Typical planning ranges

LLM
usually the dominant cost
Lambda compute
cents to low dollars
GB-seconds
memory (GB) × duration (s)

Ranges are typical planning figures to sanity-check your result, not authoritative benchmarks. Your numbers will vary with use case, volume, and vendor.

How to improve this number

  • Right-size Lambda memory to the minimum that meets latency.
  • Use a cheaper/smaller model for the LLM half.
  • Cache stable prompt context.

Common mistakes

  • Over-provisioning Lambda memory 'just in case'.
  • Optimizing Lambda while the LLM dominates.

When to use a different approach

For Lambda alone, use the AWS Lambda cost calculator. For the LLM alone, use the LLM API cost calculator.

Worked example (defaults)

With the default inputs above, here is the result:

Result
$426.87/month
Lambda $6.87 + LLM $420.00
  • AWS prices are region-agnostic estimates; free tier not applied.
Lambda compute
$6.67
Lambda requests
$0.2000
Lambda subtotal
$6.87
LLM subtotal(GPT-4o mini)
$420.00
Total / month
$426.87
  • GB-seconds = 512/1024 x 800/1000 x 1,000,000
  • LLM = per-invocation cost x 1,000,000

Sources & references

Frequently asked questions

Is Lambda or the LLM the bigger cost?+

For most AI features the LLM dominates. Lambda compute is usually cents to a few dollars, while LLM calls scale with tokens and volume.

Related calculators