feat(pricing-sync): make the age cutoff and keep list configurable

Add the -max-age-months and -keep flags, with PRICING_MAX_AGE_MONTHS and
PRICING_KEEP make variables. A built-in list keeps ids that are still served.
This commit is contained in:
2026-09-29 13:58:20 +01:00
parent 4edf9be804
commit d4322e914c
3 changed files with 84 additions and 21 deletions
+5 -1
View File
@@ -40,8 +40,12 @@ yaegi-check:
# pruning rule and naming-bridge mechanism. Not run by CI (network
# fetch, and the generated table is committed); an operator re-runs this
# by hand when LiteLLM's own pricing drifts.
# PRICING_MAX_AGE_MONTHS drops entries older than N months (0 = keep all);
# PRICING_KEEP is a comma-separated list of bare ids exempt from that rule.
PRICING_MAX_AGE_MONTHS ?= 12
PRICING_KEEP ?=
pricing-sync:
cd tools/pricing-sync && GOWORK=off go run . $(CURDIR)
cd tools/pricing-sync && GOWORK=off go run . -max-age-months=$(PRICING_MAX_AGE_MONTHS) -keep=$(PRICING_KEEP) $(CURDIR)
gofmt -w pricing_data_gen.go
INTEGRATION_COMPOSE := integration/docker-compose.yml