mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Fix blank ServiceName rejection and add token counts to Tags
- Fall back ServiceName to `model` when `model_group` is blank/null, fixing Vantage 422 errors on failed-request rows - Add `prompt_tokens` and `completion_tokens` to the Tags JSON so Vantage can use token-level granularity for cost allocation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
789cf45781
commit
178f3e02e7
1 changed files with 9 additions and 1 deletions
|
|
@ -19,6 +19,8 @@ _TAG_KEYS = (
|
|||
"model",
|
||||
"model_group",
|
||||
"custom_llm_provider",
|
||||
"prompt_tokens",
|
||||
"completion_tokens",
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -122,7 +124,13 @@ class FocusTransformer:
|
|||
pl.col("model").cast(pl.String).alias("ResourceType"),
|
||||
pl.lit("AI and Machine Learning").alias("ServiceCategory"),
|
||||
pl.lit("Generative AI").alias("ServiceSubcategory"),
|
||||
pl.col("model_group").cast(pl.String).alias("ServiceName"),
|
||||
pl.when(
|
||||
pl.col("model_group").cast(pl.String).is_not_null()
|
||||
& (pl.col("model_group").cast(pl.String) != "")
|
||||
)
|
||||
.then(pl.col("model_group").cast(pl.String))
|
||||
.otherwise(pl.col("model").cast(pl.String))
|
||||
.alias("ServiceName"),
|
||||
pl.col("team_id").cast(pl.String).alias("SubAccountId"),
|
||||
pl.col("team_alias").cast(pl.String).alias("SubAccountName"),
|
||||
none_str.alias("SubAccountType"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue