litellm/basedpyright-code-budget.json
Mateo Wang 9076c33347
fix(batches): price anthropic passthrough message batches correctly in batch cost job (#32307)
* fix(batches): price anthropic passthrough message batches correctly in batch cost job

Anthropic message batches created via the /anthropic passthrough were never
cost tracked. The CheckBatchCost job fetched batch results from the Files API
(POST /v1/files/msgbatch_.../content), which Anthropic rejects with "File id
must have file_ prefix"; the error response was silently wrapped as file
content, parsed as zero successful rows, logged as a $0 aretrieve_batch spend
row, and the job was marked batch_processed=true so the $0 was permanent.

Route msgbatch_ file ids to GET /v1/messages/batches/{id}/results in the
anthropic files transformation, raise on HTTP error status in
retrieve_file_content instead of returning the error body as content, parse
Anthropic's results JSONL shape (result.type == "succeeded",
result.message.usage with cache creation/read tokens) in batch_utils, price
cache creation tokens at cache_creation_input_token_cost in the batch cost
fallback (50% batch discount preserved for base input, cache reads, cache
writes, and output), and leave the managed object row unprocessed when cost
tracking fails so a later poll retries instead of permanently recording $0.

* fix(batches): carry cache token details into aggregated anthropic batch usage
2026-07-06 20:33:57 -07:00

146 lines
2.5 KiB
JSON

{
"reportAny": {
"limit": 37484
},
"reportArgumentType": {
"limit": 2704
},
"reportAssignmentType": {
"limit": 330
},
"reportAttributeAccessIssue": {
"limit": 516
},
"reportCallIssue": {
"limit": 124
},
"reportConstantRedefinition": {
"limit": 59
},
"reportDeprecated": {
"limit": 326
},
"reportDuplicateImport": {
"limit": 42
},
"reportExplicitAny": {
"limit": 10397
},
"reportFunctionMemberAccess": {
"limit": 11
},
"reportGeneralTypeIssues": {
"limit": 227
},
"reportIncompatibleMethodOverride": {
"limit": 78
},
"reportIncompatibleVariableOverride": {
"limit": 12
},
"reportInconsistentOverload": {
"limit": 18
},
"reportIndexIssue": {
"limit": 37
},
"reportInvalidTypeForm": {
"limit": 35
},
"reportInvalidTypeVarUse": {
"limit": 5
},
"reportMatchNotExhaustive": {
"limit": 0
},
"reportMissingParameterType": {
"limit": 5900
},
"reportMissingTypeArgument": {
"limit": 15918
},
"reportMissingTypeStubs": {
"limit": 41
},
"reportOperatorIssue": {
"limit": 0
},
"reportOptionalCall": {
"limit": 0
},
"reportOptionalIterable": {
"limit": 0
},
"reportOptionalMemberAccess": {
"limit": 1085
},
"reportOptionalOperand": {
"limit": 0
},
"reportOptionalSubscript": {
"limit": 0
},
"reportPossiblyUnboundVariable": {
"limit": 77
},
"reportPrivateUsage": {
"limit": 2438
},
"reportRedeclaration": {
"limit": 12
},
"reportReturnType": {
"limit": 225
},
"reportTypedDictNotRequiredAccess": {
"limit": 27
},
"reportUndefinedVariable": {
"limit": 0
},
"reportUnknownArgumentType": {
"limit": 45894
},
"reportUnknownLambdaType": {
"limit": 113
},
"reportUnknownMemberType": {
"limit": 40541
},
"reportUnknownParameterType": {
"limit": 20418
},
"reportUnknownVariableType": {
"limit": 32151
},
"reportUnnecessaryCast": {
"limit": 177
},
"reportUnnecessaryComparison": {
"limit": 1025
},
"reportUnnecessaryContains": {
"limit": 7
},
"reportUnnecessaryIsInstance": {
"limit": 1212
},
"reportUntypedBaseClass": {
"limit": 165
},
"reportUntypedFunctionDecorator": {
"limit": 33
},
"reportUnusedClass": {
"limit": 33
},
"reportUnusedFunction": {
"limit": 206
},
"reportUnusedImport": {
"limit": 1005
},
"reportUnusedVariable": {
"limit": 1297
}
}