mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-26 17:41:30 +02:00
Give operators a self-auditable trail from wire bytes to stored cost, all at debug level so the hot path stays quiet on production log levels: - llm_response_parser logs the raw (decompressed) upstream response body, truncated to 4KB and %q-quoted so binary event-stream framing stays log-safe, plus the token counts extracted from it (input/output/ cache_read/cache_creation/total) for both buffered and streaming bodies. - pricing.Cost logs the full per-bucket breakdown with the applied rates: input a/1000×rate + cache_read b/1000×rate + cache_creation c/1000×rate + output d/1000×rate => total. - cost_meter logs the token counts it read from metadata and the final cost_usd it stamps, and why a request was skipped when no pricing entry matches.