Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

LLM Cost Engineering

Free · sign in to start and track progress

1 · Spending less on the same work

  • 1Token economics of an agent fleet
  • 2Prompt caching as system design
  • 3Trimming and compacting context
  • 4Batch, flex and fast tiers

    Exercise answers

    • Answer: Build a resumable batch extraction job

2 · Changing the model, and governing the spend

  • 5Cost-quality curves, routing and cascades
  • 6Distilling into small models
  • 7Self-hosting break-even
  • 8Attribution, budgets and alerts
CapstoneCost-engineer an agent pipelineReference implementation

Module 1 · Spending less on the same work · Lesson 4

Batch, flex and fast tiers

Paying half price for work nobody is waiting for and a premium for work someone is, which workflow steps belong in which tier, and how to run batch jobs durably without breaking caching or data-handling commitments.

65 min 1 video 2 exercises 6-question quiz Answers
Setup for the exercises:Install Claude CodePython with uvGet an OpenRouter key

By the end of this lesson you can

  • Compare batch, flex, standard and fast or priority tiers across providers on price, latency, failure mode and data handling
  • Classify each step of an agent pipeline by latency tolerance and explain why agent loops rarely fit batch
  • Compute the saving from batching a bulk job, including the hit rate below which adding a 1-hour cache makes it dearer
  • Implement an idempotent, resumable batch job and handle every result type

On this page

  • Intuition: second class, first class, special delivery
  • Why tiers exist
  • The tiers on offer
  • Which work belongs where
  • A worked example: re-ingesting the archive
  • The matter itself barely moves
  • Paying for speed
  • Running batch jobs durably
  • Misconceptions and limits
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Intuition: second class, first class, special delivery
  2. 02Why tiers exist
  3. 03The tiers on offer
  4. 04Which work belongs where
  5. 05A worked example: re-ingesting the archive
  6. 06Running batch jobs durably
  7. 07Misconceptions and limits
  8. 08Connections
  9. 09Summary

Sources & further reading

  • Efficient Memory Management for Large Language Model Serving with PagedAttentionPaper · Kwon et al. · 2023Why batch discounts exist. Sections 2 and 6 show that serving throughput depends on how many requests can be batched together; work that can wait lets a provider fill its GPUs, and it shares the saving.
  • Batch processing (Claude API docs)Docs · AnthropicLimits (100,000 requests or 256 MB), timing (most under an hour, expiry at 24 hours, results kept 29 days), result types, prompt caching inside batches with typical 30–98% hit rates, and the data-retention note that batches are not ZDR-eligible.
  • Service tiers (Claude API docs)Docs · AnthropicStandard, Batch and the legacy Priority Tier (no longer sold), with how requests are assigned to tiers and how cache tokens count against priority capacity.
  • Flex processing (OpenAI API docs)Docs · OpenAISynchronous requests at Batch API prices with slower responses and occasional 429 Resource Unavailable errors (not charged), and the advice to raise client timeouts. The clearest example of a synchronous discount tier.
  • Serverless pricing (Fireworks docs)Docs · Fireworks AIOpen-weight model prices across Standard and Priority modes, and batch inference at 50% of serverless prices. Useful for comparing tier structures outside the frontier labs.
  • Optimizing for cost and intelligence (Claude docs)Docs · AnthropicThe recommendation to route every request no one is waiting on through the Batch API, which it calls the second-largest free lever after caching.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 9 more sections
  • 2 hands-on exercises
  • A 6-question quiz
  • Progress, quiz scores and bookmarks