diff --git a/src/PowderCoating.Infrastructure/Services/AiCatalogPriceCheckService.cs b/src/PowderCoating.Infrastructure/Services/AiCatalogPriceCheckService.cs index dd689e1..423a211 100644 --- a/src/PowderCoating.Infrastructure/Services/AiCatalogPriceCheckService.cs +++ b/src/PowderCoating.Infrastructure/Services/AiCatalogPriceCheckService.cs @@ -22,7 +22,7 @@ public class AiCatalogPriceCheckService : IAiCatalogPriceCheckService private const string Model = "claude-haiku-4-5-20251001"; private const int BatchSize = 25; - private const int MaxConcurrentBatches = 1; // Tier 1 output limit is 8,000 TPM — sequential avoids bursting past it + private const int MaxConcurrentBatches = 3; // Haiku has generous rate limits; retry logic handles any 429s private const int RateLimitRetrySeconds = 65; // wait just past the 60s window before retrying a 429 private static readonly JsonSerializerOptions JsonOpts = new() { PropertyNameCaseInsensitive = true }; diff --git a/src/PowderCoating.Web/wwwroot/js/catalog-price-check.js b/src/PowderCoating.Web/wwwroot/js/catalog-price-check.js index 89e8e25..dedb789 100644 --- a/src/PowderCoating.Web/wwwroot/js/catalog-price-check.js +++ b/src/PowderCoating.Web/wwwroot/js/catalog-price-check.js @@ -11,10 +11,11 @@ if (!form || !btn || !overlay) return; // Estimate total seconds based on item count. - // Batches run sequentially (1 at a time) at roughly 18s each. + // Haiku: 3 concurrent batches, ~8s per wave. function estimateDuration(itemCount) { var batches = Math.max(1, Math.ceil(itemCount / 25)); - return Math.max(30, batches * 18); + var waves = Math.ceil(batches / 3); + return Math.max(15, waves * 8); } // Messages keyed to approximate progress milestones (0–100).