Capture optional provider reported costs
This commit is contained in:
@@ -170,6 +170,9 @@ come from `usage.prompt_tokens_details.cache_write_tokens`; vLLM uses
|
||||
its top-level `usage.cache_write_tokens` mapping. Missing, null, malformed,
|
||||
fractional, or unrepresentable new details remain unknown without invalidating
|
||||
otherwise usable content. Existing common count decoding remains strict.
|
||||
OpenRouter's `usage.cost` is an optional USD amount; malformed or non-finite
|
||||
amounts are ignored without invalidating content. The generic and vLLM
|
||||
providers do not interpret that field.
|
||||
|
||||
Each common token field retains whether the provider reported a
|
||||
non-null integer, including zero. Omitted and `null` fields are unknown for
|
||||
|
||||
@@ -304,6 +304,8 @@ Validation: pure accounting and public serialization tests; no pricing library.
|
||||
|
||||
## Stage 10 — Optional Cost At The Model-Client Boundary
|
||||
|
||||
**Completed.**
|
||||
|
||||
- Decode OpenRouter `usage.cost` independently using local tolerant finite-float
|
||||
handling. Missing/null/string/object/overflow values are unknown; invalid
|
||||
framing or common envelope fields retain existing failures. Generic/vLLM do
|
||||
|
||||
Reference in New Issue
Block a user