From 0675dc109ebf93951a7374bb45e6ddfe42ff5efd Mon Sep 17 00:00:00 2001 From: Muhammad Husnain Date: Sat, 10 May 2025 02:14:39 +0500 Subject: [PATCH] =?UTF-8?q?[FIX]=20Update=20token=20fields=20in=20schema.p?= =?UTF-8?q?risma=20to=20use=20BigInt=20for=20improved=E2=80=A6=20(#10697)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FIX] Update token fields in schema.prisma to use BigInt for improved handling of large values across LiteLLM models. * [FIX] revert SpendLogs back to Int --- litellm/proxy/schema.prisma | 42 ++++++++++++++++++------------------- schema.prisma | 42 ++++++++++++++++++------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma index 3c20b9a3cd..b3016cc38b 100644 --- a/litellm/proxy/schema.prisma +++ b/litellm/proxy/schema.prisma @@ -361,14 +361,14 @@ model LiteLLM_DailyUserSpend { model String model_group String? custom_llm_provider String? - prompt_tokens Int @default(0) - completion_tokens Int @default(0) - cache_read_input_tokens Int @default(0) - cache_creation_input_tokens Int @default(0) + prompt_tokens BigInt @default(0) + completion_tokens BigInt @default(0) + cache_read_input_tokens BigInt @default(0) + cache_creation_input_tokens BigInt @default(0) spend Float @default(0.0) - api_requests Int @default(0) - successful_requests Int @default(0) - failed_requests Int @default(0) + api_requests BigInt @default(0) + successful_requests BigInt @default(0) + failed_requests BigInt @default(0) created_at DateTime @default(now()) updated_at DateTime @updatedAt @@ -388,14 +388,14 @@ model LiteLLM_DailyTeamSpend { model String model_group String? custom_llm_provider String? - prompt_tokens Int @default(0) - completion_tokens Int @default(0) - cache_read_input_tokens Int @default(0) - cache_creation_input_tokens Int @default(0) + prompt_tokens BigInt @default(0) + completion_tokens BigInt @default(0) + cache_read_input_tokens BigInt @default(0) + cache_creation_input_tokens BigInt @default(0) spend Float @default(0.0) - api_requests Int @default(0) - successful_requests Int @default(0) - failed_requests Int @default(0) + api_requests BigInt @default(0) + successful_requests BigInt @default(0) + failed_requests BigInt @default(0) created_at DateTime @default(now()) updated_at DateTime @updatedAt @@ -415,14 +415,14 @@ model LiteLLM_DailyTagSpend { model String model_group String? custom_llm_provider String? - prompt_tokens Int @default(0) - completion_tokens Int @default(0) - cache_read_input_tokens Int @default(0) - cache_creation_input_tokens Int @default(0) + prompt_tokens BigInt @default(0) + completion_tokens BigInt @default(0) + cache_read_input_tokens BigInt @default(0) + cache_creation_input_tokens BigInt @default(0) spend Float @default(0.0) - api_requests Int @default(0) - successful_requests Int @default(0) - failed_requests Int @default(0) + api_requests BigInt @default(0) + successful_requests BigInt @default(0) + failed_requests BigInt @default(0) created_at DateTime @default(now()) updated_at DateTime @updatedAt diff --git a/schema.prisma b/schema.prisma index 3c20b9a3cd..b3016cc38b 100644 --- a/schema.prisma +++ b/schema.prisma @@ -361,14 +361,14 @@ model LiteLLM_DailyUserSpend { model String model_group String? custom_llm_provider String? - prompt_tokens Int @default(0) - completion_tokens Int @default(0) - cache_read_input_tokens Int @default(0) - cache_creation_input_tokens Int @default(0) + prompt_tokens BigInt @default(0) + completion_tokens BigInt @default(0) + cache_read_input_tokens BigInt @default(0) + cache_creation_input_tokens BigInt @default(0) spend Float @default(0.0) - api_requests Int @default(0) - successful_requests Int @default(0) - failed_requests Int @default(0) + api_requests BigInt @default(0) + successful_requests BigInt @default(0) + failed_requests BigInt @default(0) created_at DateTime @default(now()) updated_at DateTime @updatedAt @@ -388,14 +388,14 @@ model LiteLLM_DailyTeamSpend { model String model_group String? custom_llm_provider String? - prompt_tokens Int @default(0) - completion_tokens Int @default(0) - cache_read_input_tokens Int @default(0) - cache_creation_input_tokens Int @default(0) + prompt_tokens BigInt @default(0) + completion_tokens BigInt @default(0) + cache_read_input_tokens BigInt @default(0) + cache_creation_input_tokens BigInt @default(0) spend Float @default(0.0) - api_requests Int @default(0) - successful_requests Int @default(0) - failed_requests Int @default(0) + api_requests BigInt @default(0) + successful_requests BigInt @default(0) + failed_requests BigInt @default(0) created_at DateTime @default(now()) updated_at DateTime @updatedAt @@ -415,14 +415,14 @@ model LiteLLM_DailyTagSpend { model String model_group String? custom_llm_provider String? - prompt_tokens Int @default(0) - completion_tokens Int @default(0) - cache_read_input_tokens Int @default(0) - cache_creation_input_tokens Int @default(0) + prompt_tokens BigInt @default(0) + completion_tokens BigInt @default(0) + cache_read_input_tokens BigInt @default(0) + cache_creation_input_tokens BigInt @default(0) spend Float @default(0.0) - api_requests Int @default(0) - successful_requests Int @default(0) - failed_requests Int @default(0) + api_requests BigInt @default(0) + successful_requests BigInt @default(0) + failed_requests BigInt @default(0) created_at DateTime @default(now()) updated_at DateTime @updatedAt