Bedrock Model Cost Optimizer

Optimises Amazon Bedrock inference cost across seven dimensions: model selection (Claude Haiku is ~60x cheaper per token than Opus; Nova Micro cheaper still; route simple queries to cheapest capable model), token usage analysis (output tokens cost 3-5x more than input), prompt caching (cache repeated system prompts to reduce input cost by up to 90%; TTL 5 min default, 1 hr max), batch inference (50% discount vs on-demand for non-latency-sensitive workloads), response length control (max_tokens, stop sequences, structured output), fine-tuning vs few-shot trade-off (fine-tune once then serve on cheaper base vs per-call in-context examples), and Guardrails / Knowledge Base overhead (Guardrails charges per processed token; KB adds vector store cost). Reads CloudWatch Bedrock metrics (InputTokenCount, OutputTokenCount, InvocationCount) and Cost Explorer. Emits OPTIMIZED or FURTHER_OPTIMIZATION_AVAILABLE. Use when reviewing Bedrock spend, planning model downgrades, evaluating prompt caching, or running a GenAI ...

jhkchan Updated

File contents

jhkchan/aws-agent-skills commit 930c427e68

Frequently asked questions

npx get-skill add jhkchan/bedrock-model-cost-optimizer