mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-24 23:43:46 +08:00
The "[Billing] Using fallback pricing for model: X" warn was emitted on every request for any model not in LiteLLM but matched by getFallbackPricing (e.g. "glm-5.2" substring-matches the "glm-5" fallback price). Via the stdlib log bridge it is inferred as WARN and persisted to ops_system_logs, producing tens of thousands of rows/day. It fired even when channel pricing already overrides the price, and from several call sites (resolver, account-stats pricing, non-channel billing, admin lookup). Dedup the warn at the source (BillingService.GetModelPricing) via a sync.Map keyed by the already-lowercased model name, so each model logs at most once per process while keeping one audit line. Billing amounts are unchanged. Also clarify the model/mapping pattern conflict error to state that names are matched case-insensitively, so an existing entry (e.g. "GLM-5.2") already covers all case variants and the lowercase variant need not be added — the behavior the issue mistook for a case-sensitivity bug. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>