mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
LiteLLM_SpendLogs.request_id is the provider's response id and the flush inserts with skip_duplicates, so a self-hosted OpenAI-compatible server that answers every request with the same completion id had every request after the first served and charged but never logged. The flush now reads back, from the writer, the identity of the rows create_many skipped and re-inserts the ones that belong to a different request keyed on their own litellm_call_id, with the provider id kept in metadata.response_id. Rows the flush already stored (a replay after a transport retry, under either key) and rows keyed on a stored object's id (batch polls, file uploads, the zero-priced object reads) stay skipped, and a read-back the database rejects leaves the rows skipped instead of requeueing the flush. request_id keeps meaning the id the caller was shown, so GET /spend/logs?request_id= by response id, the Logs page search, and Responses API previous_response_id session lookups behave as before. |
||
|---|---|---|
| .. | ||
| helpers | ||
| prisma_and_spend | ||
| proxy_logging | ||
| __init__.py | ||