"""Automated cost budget verification.""" from src.runtime.core.config import RuntimePricing def test_per_article_cost_within_budget(): # 2000 input prompt tokens, 500 completion tokens on llama-3.1-8b-instant ($0.05 / $0.08 per 1M) pricing = RuntimePricing( primary_input_1k=0.00005, primary_output_1k=0.00008, fallback_input_1k=0.00014, fallback_output_1k=0.00028, ) cost = (2000 / 1000.0) * pricing.primary_input_1k + (500 / 1000.0) * pricing.primary_output_1k # Assert cost per article is well within $0.0006 limit assert cost < 0.0006, f"Cost ${cost} exceeds budget $0.0006"