Batch and Budget

batching, dedup, and cost

Part of: Resume Bullet Booster

Nobody rewrites one bullet. You paste in a whole job's worth of tasks, fifteen or twenty lines, usually with duplicates and blanks mixed in. This lesson turns your single-bullet tool into a batch tool that dedupes the input and estimates what the run will cost, so a big paste doesn't quietly become a big bill. Deduplicate before you spend Every rewrite is an API call, and every call costs tokens. If your input has "Managed staff" three times (people repeat themselves), rewriting it three times is wasted money. Dedupe first, keeping the first occurrence and matching case-insensitively so "Managed staff" and "managed staff" collapse into one: The seen set holds the lowercased keys; unique keeps the original text of the first time each appeared. Blank lines drop out for free because if key is False for an empty string. Estimate the cost before you run Before firing off twenty calls, estimate the tokens. The rule of thumb is about four characters per token, so a whole batch's input cost is a sum of len(task) // 4: This is deliberately rough (it ignores the system prompt and the output tokens), but it answers the one question that matters at this stage: is this a 200-token run or a 20,0

Challenge: Batch Cost Report