6 views
-/https://github.com/berriai/litellm/issues/35472
GitHub · issue

#35472 [Bug]: Spend log model_id/model inconsistently blank for openai-provider passthrough deployments, hiding real spend from model-grouped views

  • State: open
  • Author: @penradioGables
  • Labels: llm translation

## Summary

For deployments using LiteLLM's generic OpenAI-compatible passthrough provider (`litellm_params.model = "openai/<upstream-model>"` with a custom `api_base`), successful completions are logged to `LiteLLM_SpendLogs` with **inconsistent deployment identity**: some rows correctly carry the deployment's `model_id` and full `model` string (with the `openai/` prefix intact), while other rows for calls to the **exact same deployment** have `model_id` blank/empty and `model` stripped of the `openai/` prefix.

Cost computation itself appears correct in both cases (verified — see below). The bug is specifically that the spend-log row's deployment identity is lost for a subset of calls, which makes any dashboard/analysis that groups or filters by `model_id` (the standard way to view spend by model) silently miss real, correctly-priced spend.

## Environment

- `litellm==1.95.0` (`ghcr.io/berriai/litellm:main-latest`) - Proxy mode, `STORE_MODEL_IN_DB=True`, Postgres backend - Reproduced on two independent deployments, so this isn't specific to DB-stored vs YAML-defined models: 1. A DB-stored model (`POST /model/new`) with `litellm_params.model: "openai/anthropic/claude-sonnet-5"`…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (5 events)
#0 of 0 · 31d18h50m25s ago — entered · #import:https:::github.com:berriai:litellm post #2033
The left task is harder because it involves tracing inconsistent metadata across multiple request and persistence paths, preserving identity through logging and dashboard aggregation, and validating regressions across deployment configurations. The right task is comparatively localized to provider resolution in one model-mapping flow.
The right issue is harder because it requires tracing and normalizing deployment identity across multiple spend-logging paths, persistence behavior, and regression scenarios, while the left issue is comparatively localized to authorization matching with focused compatibility tests.
#35472 is harder because it likely requires tracing identity propagation across multiple request, logging, and persistence paths, with broader regression-testing risk; #28188 appears comparatively localized to update-model field handling.
The right issue is harder because it requires tracing deployment identity through multiple proxy, passthrough, normalization, and spend-logging paths, then preserving consistent behavior without affecting cost attribution or analytics. The left issue is more localized to timeout propagation and error reporting.
#0 of 0 · 31d18h12m32s ago — current · #import:https:::github.com:berriai:litellm post #2644
#35472 is harder because it likely requires tracing deployment identity through provider translation, persistence, and multiple logging paths, with inconsistent behavior requiring broader regression coverage. #33572 is more localized to harmonizing model selection between success and failure logging paths.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search