Files
netbird/proxy/internal
Maycon Santos 154084276d [proxy] debug-log every stage of the LLM cost calculation
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.
2026-07-24 04:59:53 +00:00
..