ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept · Builds on AIF-C01

FM performance, latency and cost trade-offs

Pull the levers that cut delay or cost: smaller models, caching, routing, streaming, short outputs, batch and capacity.

You know from AI Practitioner

  • On demand: pay per token. Provisioned throughput: an hourly price for reserved capacity. Batch: about half price for jobs that can wait.
  • Larger models, lower latency and more Regions cost more.
  • Prompt caching reads a repeated prompt start at a lower price.
Read the AI Practitioner lesson
  • Smaller model

    Helps
    Cost and latency
    Catch
    May lose quality
  • Streaming

    Helps
    Perceived latency
    Catch
    Same total time
  • Latency-optimized

    Helps
    Latency
    Catch
    Few models and Regions
  • Prompt caching

    Helps
    Cost and latency
    Catch
    Needs a repeated prefix
  • Prompt routing

    Helps
    Cost
    Catch
    One family, English tuned
  • Short outputs

    Helps
    Cost and latency
    Catch
    Less detail
  • Batch inference

    Helps
    Cost
    Catch
    Results come later
Levers for lower latency or lower cost.

1 / 3

  • Smaller model

    Helps
    Cost and latency
    Catch
    May lose quality
  • Streaming

    Helps
    Perceived latency
    Catch
    Same total time
  • Latency-optimized

    Helps
    Latency
    Catch
    Few models and Regions

2 / 3

  • Prompt caching

    Helps
    Cost and latency
    Catch
    Needs a repeated prefix
  • Prompt routing

    Helps
    Cost
    Catch
    One family, English tuned
  • Short outputs

    Helps
    Cost and latency
    Catch
    Less detail

3 / 3

  • Batch inference

    Helps
    Cost
    Catch
    Results come later
Levers for lower latency or lower cost.
Must answer now?
Batch inference
Steady, high traffic?
Provisioned throughput
On-demand
noyesyesno
Pick how to buy capacity.

What it is

Model size is the first lever. A small model is faster and cheaper per token. A large one is more accurate on hard tasks. Test the small one first, and send only hard requests to the large one.

Streaming returns tokens as they are made, so users see text sooner, though total time is the same. Latency-optimized inference (performanceConfig latency set to optimized) serves requests faster on a short list of models and Regions; the documentation calls it a preview feature. Shorter outputs finish sooner and cost less, because output tokens are billed and usually cost more than input tokens. Set a maximum output length and ask for concise answers.

What it is

Prompt caching stores the repeated start of a prompt, such as long instructions or a document, so later calls read it at a lower price and answer sooner. The cache lasts 5 minutes after the last hit. Some models also let you choose 1 hour, which suits prompts reused less often than every 5 minutes. Each hit resets the timer, and each model has a minimum prompt length. Caching works with on-demand calls, not batch.

Intelligent prompt routing gives one endpoint that sends each request to a smaller or larger model of the same family, based on predicted quality; default routers use selected Amazon Nova and Meta Llama models, tuned for English prompts.

What it is

Batch inference runs offline work at a lower price. On-demand fits uneven traffic. Provisioned throughput fits steady, high traffic and gives dependable speed.

Remember

  • Streaming shows text sooner. It does not cut total cost.
  • Prompt caching cuts input cost and delay for a repeated prompt start; it needs a minimum prefix length.
  • Batch for work that can wait. Provisioned throughput for steady, high traffic.

On the exam

  • “The same 20-page document is sent with every question” points to prompt caching.
  • “Show the answer as it is written to shorten the perceived wait” points to streaming.
  • “Send easy questions to a cheap model and hard ones to a strong model automatically” points to intelligent prompt routing.
  • “Nightly summaries of a million records, no one waiting” points to batch inference.