The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: use fastuuid helper (#14903)
Alexsander Hamireaa04cd8ce29
diff --git a/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py b/cookbook/litellm_router_load_test/memory_usage/router_endpoint.pyindex 689f105bc5f..1dc2d914857 100644--- a/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py+++ b/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py@@ -5,7 +5,7 @@ import osimport litellmfrom litellm import Routerfrom dotenv import load_dotenv-import uuid+from litellm._uuid import uuidload_dotenv()diff --git a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage copy.py b/cookbook/litellm_router_load_test/memory_usage/router_memory_usage copy.pyindex a8aa506e8a2..76d5d3913f5 100644--- a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage copy.py+++ b/cookbook/litellm_router_load_test/memory_usage/router_memory_usage copy.py@@ -12,7 +12,7 @@ sys.path.insert(import litellmfrom litellm import Routerfrom dotenv import load_dotenv-import uuid+from litellm._uuid import uuidload_dotenv()diff --git a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage.py b/cookbook/litellm_router_load_test/memory_usage/router_memory_usage.pyindex a8aa506e8a2..76d5d3913f5 100644--- a/cookbook/litellm_router_load_test/memory_usage/router_memory_usage.py+++ b/cookbook/litellm_router_load_test/memory_usage/router_memory_usage.py@@ -12,7 +12,7 @@ sys.path.insert(import litellmfrom litellm import Routerfrom dotenv import load_dotenv-import uuid+from litellm._uuid import uuidload_dotenv()diff --git a/enterprise/litellm_enterprise/enterprise_callbacks/generic_api_callback.py b/enterprise/litellm_enterprise/enterprise_callbacks/generic_api_callback.pyindex d239be41257..7e259d4e19d 100644--- a/enterprise/litellm_enterprise/enterprise_callbacks/generic_api_callback.py+++ b/enterprise/litellm_enterprise/enterprise_callbacks/generic_api_callback.py@@ -9,7 +9,7 @@ Callback to log events to a Generic API Endpointimport asyncioimport osimport traceback-import uuid+from litellm._uuid import uuidfrom typing import Dict, List, Optional, Unionimport litellmdiff --git a/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py b/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.pyindex 6edd198cd8e..4b1bb024ac6 100644--- a/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py+++ b/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py@@ -2,7 +2,7 @@Polls LiteLLM_ManagedObjectTable to check if the batch job is complete, and if the cost has been tracked."""-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom typing import TYPE_CHECKING, Optional, castdiff --git a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py b/enterprise/litellm_enterprise/proxy/hooks/managed_files.pyindex e069a89b9c5..e2963f8fb87 100644--- a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py+++ b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py@@ -4,7 +4,7 @@import asyncioimport base64import json-import uuid+from litellm._uuid import uuidfrom typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Union, castfrom fastapi import HTTPExceptiondiff --git a/litellm/caching/qdrant_semantic_cache.py b/litellm/caching/qdrant_semantic_cache.pyindex 32d4d8b0fdc..0e77b5a6c21 100644--- a/litellm/caching/qdrant_semantic_cache.py+++ b/litellm/caching/qdrant_semantic_cache.py@@ -168,7 +168,7 @@ class QdrantSemanticCache(BaseCache):def set_cache(self, key, value, **kwargs):print_verbose(f"qdrant semantic-cache set_cache, kwargs: {kwargs}")- import uuid+ from litellm._uuid import uuid# get the promptmessages = kwargs["messages"]@@ -279,7 +279,7 @@ class QdrantSemanticCache(BaseCache):passasync def async_set_cache(self, key, value, **kwargs):- import uuid+ from litellm._uuid import uuidfrom litellm.proxy.proxy_server import llm_model_list, llm_routerdiff --git a/litellm/integrations/azure_storage/azure_storage.py b/litellm/integrations/azure_storage/azure_storage.pyindex 6ffb1e542fc..b4362665a4c 100644--- a/litellm/integrations/azure_storage/azure_storage.py+++ b/litellm/integrations/azure_storage/azure_storage.py@@ -2,7 +2,7 @@ import asyncioimport jsonimport osimport time-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timedeltafrom typing import List, Optionaldiff --git a/litellm/integrations/datadog/datadog.py b/litellm/integrations/datadog/datadog.pyindex f5a0883bea4..0c62667f749 100644--- a/litellm/integrations/datadog/datadog.py+++ b/litellm/integrations/datadog/datadog.py@@ -17,7 +17,7 @@ import asyncioimport datetimeimport osimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetime as datetimeObjfrom typing import Any, Dict, List, Optional, Uniondiff --git a/litellm/integrations/datadog/datadog_llm_obs.py b/litellm/integrations/datadog/datadog_llm_obs.pyindex 2702192f637..fc3cf4b9ff2 100644--- a/litellm/integrations/datadog/datadog_llm_obs.py+++ b/litellm/integrations/datadog/datadog_llm_obs.py@@ -9,7 +9,7 @@ API Reference: https://docs.datadoghq.com/llm_observability/setup/api/?tab=exampimport asyncioimport jsonimport os-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom typing import Any, Dict, List, Literal, Optional, Uniondiff --git a/litellm/integrations/deepeval/deepeval.py b/litellm/integrations/deepeval/deepeval.pyindex f548ff50d73..972843e120a 100644--- a/litellm/integrations/deepeval/deepeval.py+++ b/litellm/integrations/deepeval/deepeval.py@@ -1,5 +1,5 @@import os-import uuid+from litellm._uuid import uuidfrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.integrations.deepeval.api import Api, Endpoints, HttpMethodsfrom litellm.integrations.deepeval.types import (diff --git a/litellm/integrations/dynamodb.py b/litellm/integrations/dynamodb.pyindex 2c527ea8aa9..dfc05ae1f32 100644--- a/litellm/integrations/dynamodb.py+++ b/litellm/integrations/dynamodb.py@@ -3,7 +3,7 @@import osimport traceback-import uuid+from litellm._uuid import uuidfrom typing import Anyimport litellmdiff --git a/litellm/integrations/gcs_bucket/gcs_bucket.py b/litellm/integrations/gcs_bucket/gcs_bucket.pyindex 972a0236666..9190f921d50 100644--- a/litellm/integrations/gcs_bucket/gcs_bucket.py+++ b/litellm/integrations/gcs_bucket/gcs_bucket.py@@ -1,7 +1,7 @@import asyncioimport jsonimport os-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timedelta, timezonefrom typing import TYPE_CHECKING, Any, Dict, List, Optionalfrom urllib.parse import quotediff --git a/litellm/integrations/lago.py b/litellm/integrations/lago.pyindex 5dfb1ce097d..b881193e869 100644--- a/litellm/integrations/lago.py+++ b/litellm/integrations/lago.py@@ -3,7 +3,7 @@import jsonimport os-import uuid+from litellm._uuid import uuidfrom typing import Literal, Optionalimport httpxdiff --git a/litellm/integrations/langsmith.py b/litellm/integrations/langsmith.pyindex 7783b704b46..cc9b361b69d 100644--- a/litellm/integrations/langsmith.py+++ b/litellm/integrations/langsmith.py@@ -5,7 +5,7 @@ import osimport randomimport tracebackimport types-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom typing import Any, Dict, List, Optionaldiff --git a/litellm/integrations/literal_ai.py b/litellm/integrations/literal_ai.pyindex 5bf9afd7eb4..042779ba844 100644--- a/litellm/integrations/literal_ai.py+++ b/litellm/integrations/literal_ai.py@@ -2,7 +2,7 @@# This file contains the LiteralAILogger class which is used to log steps to the LiteralAI observability platform.import asyncioimport os-import uuid+from litellm._uuid import uuidfrom typing import List, Optionalimport httpxdiff --git a/litellm/integrations/logfire_logger.py b/litellm/integrations/logfire_logger.pyindex 516bd4a8e28..2345dc869c6 100644--- a/litellm/integrations/logfire_logger.py+++ b/litellm/integrations/logfire_logger.py@@ -3,7 +3,7 @@import osimport traceback-import uuid+from litellm._uuid import uuidfrom enum import Enumfrom typing import Any, Dict, NamedTuplediff --git a/litellm/integrations/posthog.py b/litellm/integrations/posthog.pyindex d321135f289..5298e538a72 100644--- a/litellm/integrations/posthog.py+++ b/litellm/integrations/posthog.py@@ -11,7 +11,7 @@ For batching specific details see CustomBatchLogger classimport asyncioimport os-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, Optionaldiff --git a/litellm/litellm_core_utils/fallback_utils.py b/litellm/litellm_core_utils/fallback_utils.pyindex a5b0c85c816..7ce53862089 100644--- a/litellm/litellm_core_utils/fallback_utils.py+++ b/litellm/litellm_core_utils/fallback_utils.py@@ -1,4 +1,4 @@-import uuid+from litellm._uuid import uuidfrom typing import Optionalimport litellmdiff --git a/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py b/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.pyindex ce054b91cc9..2def52ed7e6 100644--- a/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py+++ b/litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py@@ -2,7 +2,7 @@ import asyncioimport jsonimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom typing import Dict, Iterable, List, Literal, Optional, Tuple, Unionimport litellmdiff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.pyindex b9cc5e50c3b..c1d8a1cd41b 100644--- a/litellm/litellm_core_utils/prompt_templates/factory.py+++ b/litellm/litellm_core_utils/prompt_templates/factory.py@@ -2,7 +2,7 @@ import copyimport jsonimport mimetypesimport re-import uuid+from litellm._uuid import uuidimport xml.etree.ElementTree as ETfrom enum import Enumfrom typing import Any, List, Optional, Tuple, cast, overloaddiff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.pyindex bc0fbdf5c11..b2f6c621407 100644--- a/litellm/litellm_core_utils/streaming_handler.py+++ b/litellm/litellm_core_utils/streaming_handler.py@@ -5,7 +5,7 @@ import jsonimport threadingimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom typing import Any, Callable, Dict, List, Optional, Union, castimport httpxdiff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py b/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.pyindex e4191a945f3..306bcd9bb2c 100644--- a/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py+++ b/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py@@ -2,7 +2,7 @@## Translates OpenAI call to Anthropic `/v1/messages` formatimport jsonimport traceback-import uuid+from litellm._uuid import uuidfrom collections import dequefrom typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, Literal, Optionaldiff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.pyindex d38e7adc231..7de2a1e1c66 100644--- a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py+++ b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py@@ -458,7 +458,7 @@ class LiteLLMAnthropicMessagesAdapter:Literal["text", "tool_use"],"ContentBlockContentBlockDict",]:- import uuid+ from litellm._uuid import uuidfrom litellm.types.llms.anthropic import TextBlock, ToolUseBlockdiff --git a/litellm/llms/azure/audio_transcriptions.py b/litellm/llms/azure/audio_transcriptions.pyindex 1f09ac7574a..8519b1c35a5 100644--- a/litellm/llms/azure/audio_transcriptions.py+++ b/litellm/llms/azure/audio_transcriptions.py@@ -1,4 +1,4 @@-import uuid+from litellm._uuid import uuidfrom typing import Any, Coroutine, Optional, Unionfrom openai import AsyncAzureOpenAI, AzureOpenAIdiff --git a/litellm/llms/bedrock/chat/invoke_agent/transformation.py b/litellm/llms/bedrock/chat/invoke_agent/transformation.pyindex e4ff6d398ea..4a7c33ed204 100644--- a/litellm/llms/bedrock/chat/invoke_agent/transformation.py+++ b/litellm/llms/bedrock/chat/invoke_agent/transformation.py@@ -5,7 +5,7 @@ https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Invoke"""import base64import json-import uuid+from litellm._uuid import uuidfrom typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Unionimport httpxdiff --git a/litellm/llms/bedrock/chat/invoke_handler.py b/litellm/llms/bedrock/chat/invoke_handler.pyindex 42cdb34fc1a..0d1b4102c94 100644--- a/litellm/llms/bedrock/chat/invoke_handler.py+++ b/litellm/llms/bedrock/chat/invoke_handler.py@@ -7,7 +7,7 @@ import jsonimport timeimport typesimport urllib.parse-import uuid+from litellm._uuid import uuidfrom functools import partialfrom typing import (Any,diff --git a/litellm/llms/bedrock/common_utils.py b/litellm/llms/bedrock/common_utils.pyindex 63c366c9480..2b111cde600 100644--- a/litellm/llms/bedrock/common_utils.py+++ b/litellm/llms/bedrock/common_utils.py@@ -802,7 +802,7 @@ class CommonBatchFilesUtils:Tuple of (bucket_name, object_key)"""import time- import uuid+ from litellm._uuid import uuid# Get bucket namebucket_name = (diff --git a/litellm/llms/bedrock/files/transformation.py b/litellm/llms/bedrock/files/transformation.pyindex d493deddb62..0a95cf9168f 100644--- a/litellm/llms/bedrock/files/transformation.py+++ b/litellm/llms/bedrock/files/transformation.py@@ -1,7 +1,7 @@import jsonimport osimport time-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, List, Optional, Tuple, Unionfrom httpx import Headers, Responsediff --git a/litellm/llms/bedrock/rerank/transformation.py b/litellm/llms/bedrock/rerank/transformation.pyindex be8250a9671..b5d33eda49f 100644--- a/litellm/llms/bedrock/rerank/transformation.py+++ b/litellm/llms/bedrock/rerank/transformation.py@@ -4,7 +4,7 @@ Translates from Cohere's `/v1/rerank` input format to Bedrock's `/rerank` inputWhy separate file? Make it easy to see how transformation works"""-import uuid+from litellm._uuid import uuidfrom typing import List, Optional, Unionfrom litellm.types.llms.bedrock import (diff --git a/litellm/llms/deepinfra/rerank/transformation.py b/litellm/llms/deepinfra/rerank/transformation.pyindex 8259c6075bb..6a3244a3c88 100644--- a/litellm/llms/deepinfra/rerank/transformation.py+++ b/litellm/llms/deepinfra/rerank/transformation.py@@ -2,7 +2,7 @@Translate between Cohere's `/rerank` format and Deepinfra's `/rerank` format."""-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, List, Optional, Unionimport httpxdiff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.pyindex 31d749032b4..524b1c97145 100644--- a/litellm/llms/fireworks_ai/chat/transformation.py+++ b/litellm/llms/fireworks_ai/chat/transformation.py@@ -1,5 +1,5 @@import json-import uuid+from litellm._uuid import uuidfrom typing import Any, List, Literal, Optional, Tuple, Union, castimport httpxdiff --git a/litellm/llms/gemini/realtime/transformation.py b/litellm/llms/gemini/realtime/transformation.pyindex f32a404c9e8..e1dd6f146f3 100644--- a/litellm/llms/gemini/realtime/transformation.py+++ b/litellm/llms/gemini/realtime/transformation.py@@ -3,7 +3,7 @@ This file contains the transformation logic for the Gemini realtime API."""import json-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, List, Optional, Union, castfrom litellm import verbose_loggerdiff --git a/litellm/llms/hosted_vllm/rerank/transformation.py b/litellm/llms/hosted_vllm/rerank/transformation.pyindex 419327d9d5c..c0a57c43534 100644--- a/litellm/llms/hosted_vllm/rerank/transformation.py+++ b/litellm/llms/hosted_vllm/rerank/transformation.py@@ -2,7 +2,7 @@Transformation logic for Hosted VLLM rerank"""-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, List, Optional, Unionfrom litellm.types.rerank import (diff --git a/litellm/llms/huggingface/rerank/transformation.py b/litellm/llms/huggingface/rerank/transformation.pyindex 9c3234c3512..aa0f37bc6ba 100644--- a/litellm/llms/huggingface/rerank/transformation.py+++ b/litellm/llms/huggingface/rerank/transformation.py@@ -1,5 +1,5 @@import os-import uuid+from litellm._uuid import uuidfrom typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Unionimport httpxdiff --git a/litellm/llms/infinity/rerank/transformation.py b/litellm/llms/infinity/rerank/transformation.pyindex 4b75fa121b2..6259d445aec 100644--- a/litellm/llms/infinity/rerank/transformation.py+++ b/litellm/llms/infinity/rerank/transformation.py@@ -4,7 +4,7 @@ Transformation logic from Cohere's /v1/rerank format to Infinity's `/v1/rerank`Why separate file? Make it easy to see how transformation works"""-import uuid+from litellm._uuid import uuidfrom typing import List, Optionalimport httpxdiff --git a/litellm/llms/jina_ai/rerank/transformation.py b/litellm/llms/jina_ai/rerank/transformation.pyindex 8d0a9b1431c..d8569b01b83 100644--- a/litellm/llms/jina_ai/rerank/transformation.py+++ b/litellm/llms/jina_ai/rerank/transformation.py@@ -6,7 +6,7 @@ Why separate file? Make it easy to see how transformation worksDocs - https://jina.ai/reranker"""-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, List, Optional, Tuple, Unionfrom httpx import URL, Responsediff --git a/litellm/llms/ollama/chat/transformation.py b/litellm/llms/ollama/chat/transformation.pyindex 3527a579218..3b755e79330 100644--- a/litellm/llms/ollama/chat/transformation.py+++ b/litellm/llms/ollama/chat/transformation.py@@ -1,6 +1,6 @@import jsonimport time-import uuid+from litellm._uuid import uuidfrom typing import (TYPE_CHECKING,Any,diff --git a/litellm/llms/ollama/completion/transformation.py b/litellm/llms/ollama/completion/transformation.pyindex bfb0b7f1877..981a987ec91 100644--- a/litellm/llms/ollama/completion/transformation.py+++ b/litellm/llms/ollama/completion/transformation.py@@ -1,6 +1,6 @@import jsonimport time-import uuid+from litellm._uuid import uuidfrom typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, List, Optional, Unionfrom httpx._models import Headers, Responsediff --git a/litellm/llms/ollama_chat.py b/litellm/llms/ollama_chat.pyindex d46e7145194..082312d28f2 100644--- a/litellm/llms/ollama_chat.py+++ b/litellm/llms/ollama_chat.py@@ -1,6 +1,6 @@import jsonimport time-import uuid+from litellm._uuid import uuidfrom typing import Any, List, Optional, Unionimport aiohttpdiff --git a/litellm/llms/together_ai/rerank/transformation.py b/litellm/llms/together_ai/rerank/transformation.pyindex 1fdb772adde..63b593dfe42 100644--- a/litellm/llms/together_ai/rerank/transformation.py+++ b/litellm/llms/together_ai/rerank/transformation.py@@ -4,7 +4,7 @@ Transformation logic from Cohere's /v1/rerank format to Together AI's `/v1/reraWhy separate file? Make it easy to see how transformation works"""-import uuid+from litellm._uuid import uuidfrom typing import List, Optionalfrom litellm.types.rerank import (diff --git a/litellm/llms/vertex_ai/batches/transformation.py b/litellm/llms/vertex_ai/batches/transformation.pyindex 5b6d21b5948..22cd0bd402a 100644--- a/litellm/llms/vertex_ai/batches/transformation.py+++ b/litellm/llms/vertex_ai/batches/transformation.py@@ -1,4 +1,4 @@-import uuid+from litellm._uuid import uuidfrom typing import Dictfrom litellm.llms.vertex_ai.common_utils import (diff --git a/litellm/llms/vertex_ai/files/transformation.py b/litellm/llms/vertex_ai/files/transformation.pyindex f2e5a5b5d25..01f6c86fd4d 100644--- a/litellm/llms/vertex_ai/files/transformation.py+++ b/litellm/llms/vertex_ai/files/transformation.py@@ -1,7 +1,7 @@import jsonimport osimport time-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, List, Optional, Tuple, Unionfrom httpx import Headers, Responsediff --git a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.pyindex 9376b28cbec..dc3a6cf15e5 100644--- a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py+++ b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py@@ -3,7 +3,7 @@## Initial implementation - covers gemini + image gen callsimport jsonimport time-import uuid+from litellm._uuid import uuidfrom copy import deepcopyfrom functools import partialfrom typing import (diff --git a/litellm/main.py b/litellm/main.pyindex 50de09c3dbf..f0b1820cbb5 100644--- a/litellm/main.py+++ b/litellm/main.py@@ -17,7 +17,7 @@ import randomimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom concurrent import futuresfrom concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, waitfrom copy import deepcopydiff --git a/litellm/proxy/_experimental/mcp_server/db.py b/litellm/proxy/_experimental/mcp_server/db.pyindex d5d9f978908..79e3b0f7623 100644--- a/litellm/proxy/_experimental/mcp_server/db.py+++ b/litellm/proxy/_experimental/mcp_server/db.py@@ -1,4 +1,4 @@-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, Iterable, List, Optional, Set, Unionfrom litellm._logging import verbose_proxy_loggerdiff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.pyindex a92b7d8ad2e..6f2732af371 100644--- a/litellm/proxy/_types.py+++ b/litellm/proxy/_types.py@@ -1,6 +1,6 @@import enumimport json-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom typing import (TYPE_CHECKING,diff --git a/litellm/proxy/client/cli/commands/auth.py b/litellm/proxy/client/cli/commands/auth.pyindex 78cbb5ecf82..ff9f05fd32a 100644--- a/litellm/proxy/client/cli/commands/auth.py+++ b/litellm/proxy/client/cli/commands/auth.py@@ -336,7 +336,7 @@ def _handle_team_assignment(base_url: str, api_key: str, user_id: str) -> None:@click.pass_contextdef login(ctx: click.Context):"""Login to LiteLLM proxy using SSO authentication"""- import uuid+ from litellm._uuid import uuidfrom litellm.constants import LITELLM_CLI_SOURCE_IDENTIFIERfrom litellm.proxy.client.cli.interface import show_commandsdiff --git a/litellm/proxy/db/db_transaction_queue/pod_lock_manager.py b/litellm/proxy/db/db_transaction_queue/pod_lock_manager.pyindex 2dab963b02a..bb5424b0e90 100644--- a/litellm/proxy/db/db_transaction_queue/pod_lock_manager.py+++ b/litellm/proxy/db/db_transaction_queue/pod_lock_manager.py@@ -1,5 +1,5 @@import asyncio-import uuid+from litellm._uuid import uuidfrom typing import TYPE_CHECKING, Any, Optionalfrom litellm._logging import verbose_proxy_loggerdiff --git a/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py b/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.pyindex db72a9e9d29..8ca29506771 100644--- a/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py+++ b/litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py@@ -5,7 +5,7 @@ PANW Prisma AIRS Built-in Guardrail for LiteLLM"""import os-import uuid+from litellm._uuid import uuidfrom typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Type, castfrom fastapi import HTTPExceptiondiff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.pyindex e3f114c746f..38a17595c46 100644--- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py+++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py@@ -10,7 +10,7 @@import asyncioimport json-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom typing import (Any,diff --git a/litellm/proxy/guardrails/guardrail_registry.py b/litellm/proxy/guardrails/guardrail_registry.pyindex 69c8fd8084e..b5ae8437d86 100644--- a/litellm/proxy/guardrails/guardrail_registry.py+++ b/litellm/proxy/guardrails/guardrail_registry.py@@ -2,7 +2,7 @@import importlibimport os-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom typing import Dict, List, Optional, Type, castdiff --git a/litellm/proxy/hooks/key_management_event_hooks.py b/litellm/proxy/hooks/key_management_event_hooks.pyindex 0289a929613..7ad1aaffc10 100644--- a/litellm/proxy/hooks/key_management_event_hooks.py+++ b/litellm/proxy/hooks/key_management_event_hooks.py@@ -1,6 +1,6 @@import asyncioimport json-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom typing import Any, List, Optionaldiff --git a/litellm/proxy/hooks/user_management_event_hooks.py b/litellm/proxy/hooks/user_management_event_hooks.pyindex cc33f63837c..9579298e5c7 100644--- a/litellm/proxy/hooks/user_management_event_hooks.py+++ b/litellm/proxy/hooks/user_management_event_hooks.py@@ -3,7 +3,7 @@ Hooks that are triggered when a litellm user event occurs"""import asyncio-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom typing import Optionaldiff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.pyindex 68e6342d6b6..66085b69b3d 100644--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py@@ -14,7 +14,7 @@ These are members of a Team on LiteLLMimport asyncioimport jsonimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom typing import Any, Dict, List, Optional, Union, castdiff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.pyindex eb389450f91..aa56cc68a8a 100644--- a/litellm/proxy/management_endpoints/key_management_endpoints.py+++ b/litellm/proxy/management_endpoints/key_management_endpoints.py@@ -14,7 +14,7 @@ import copyimport jsonimport secretsimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timedelta, timezonefrom typing import List, Literal, Optional, Tuple, castdiff --git a/litellm/proxy/management_endpoints/model_management_endpoints.py b/litellm/proxy/management_endpoints/model_management_endpoints.pyindex 9180e6100be..8f9c6edd2b7 100644--- a/litellm/proxy/management_endpoints/model_management_endpoints.py+++ b/litellm/proxy/management_endpoints/model_management_endpoints.py@@ -13,7 +13,7 @@ model/{model_id}/update - PATCH endpoint for model update.import asyncioimport datetimeimport json-import uuid+from litellm._uuid import uuidfrom typing import Dict, List, Literal, Optional, Tuple, Union, castfrom fastapi import APIRouter, Depends, HTTPException, Request, statusdiff --git a/litellm/proxy/management_endpoints/organization_endpoints.py b/litellm/proxy/management_endpoints/organization_endpoints.pyindex c3fca196d57..2b52b6fc51c 100644--- a/litellm/proxy/management_endpoints/organization_endpoints.py+++ b/litellm/proxy/management_endpoints/organization_endpoints.py@@ -11,7 +11,7 @@ Endpoints for /organization operations#### ORGANIZATION MANAGEMENT ####-import uuid+from litellm._uuid import uuidfrom typing import List, Optional, Tuplefrom fastapi import APIRouter, Depends, HTTPException, Request, statusdiff --git a/litellm/proxy/management_endpoints/scim/scim_v2.py b/litellm/proxy/management_endpoints/scim/scim_v2.pyindex 6720f0c3b71..fd7d150a7f4 100644--- a/litellm/proxy/management_endpoints/scim/scim_v2.py+++ b/litellm/proxy/management_endpoints/scim/scim_v2.py@@ -4,7 +4,7 @@This is an enterprise feature and requires a premium license."""-import uuid+from litellm._uuid import uuidfrom typing import Any, Dict, List, Optional, Set, Tuplefrom fastapi import (diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.pyindex 97663863446..cbea3da1744 100644--- a/litellm/proxy/management_endpoints/team_endpoints.py+++ b/litellm/proxy/management_endpoints/team_endpoints.py@@ -12,7 +12,7 @@ All /team management endpointsimport asyncioimport jsonimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom typing import Any, Dict, List, Optional, Tuple, Union, castdiff --git a/litellm/proxy/management_endpoints/ui_sso.py b/litellm/proxy/management_endpoints/ui_sso.pyindex 2af940ec654..dc8b96656c4 100644--- a/litellm/proxy/management_endpoints/ui_sso.py+++ b/litellm/proxy/management_endpoints/ui_sso.py@@ -10,7 +10,7 @@ Has all /sso/* routesimport asyncioimport os-import uuid+from litellm._uuid import uuidfrom copy import deepcopyfrom typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, castdiff --git a/litellm/proxy/management_helpers/audit_logs.py b/litellm/proxy/management_helpers/audit_logs.pyindex b1b2fdf1ca9..ea082f468ae 100644--- a/litellm/proxy/management_helpers/audit_logs.py+++ b/litellm/proxy/management_helpers/audit_logs.py@@ -3,7 +3,7 @@ Functions to create audit logs for LiteLLM Proxy"""import json-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezoneimport litellmdiff --git a/litellm/proxy/management_helpers/object_permission_utils.py b/litellm/proxy/management_helpers/object_permission_utils.pyindex 3b55974b7bf..5299bc9209d 100644--- a/litellm/proxy/management_helpers/object_permission_utils.py+++ b/litellm/proxy/management_helpers/object_permission_utils.py@@ -4,7 +4,7 @@ organizations, teams, and keys."""import json-import uuid+from litellm._uuid import uuidfrom typing import Dict, Optional, Unionfrom litellm._logging import verbose_proxy_loggerdiff --git a/litellm/proxy/management_helpers/utils.py b/litellm/proxy/management_helpers/utils.pyindex 246fa0b6390..e25208a216a 100644--- a/litellm/proxy/management_helpers/utils.py+++ b/litellm/proxy/management_helpers/utils.py@@ -1,6 +1,6 @@# What is this?## Helper utils for the management endpoints (keys/users/teams)-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom functools import wrapsfrom typing import Optional, Tuplediff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.pyindex a1f43d0ca50..628784f6f1f 100644--- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py+++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py@@ -3,7 +3,7 @@ import asyncioimport copyimport jsonimport traceback-import uuid+from litellm._uuid import uuidfrom base64 import b64encodefrom datetime import datetimefrom typing import Dict, List, Optional, Tuple, Union@@ -922,7 +922,7 @@ def create_pass_through_route(cost_per_request: Optional[float] = None,):# check if target is an adapter.py or a url- import uuid+ from litellm._uuid import uuidfrom litellm.proxy.types_utils.utils import get_instance_fn@@ -1123,7 +1123,7 @@ async def initialize_pass_through_endpoints(Returns:None"""- import uuid+ from litellm._uuid import uuidverbose_proxy_logger.debug("initializing pass through endpoints")from litellm.proxy._types import CommonProxyErrors, LiteLLMRoutes@@ -1366,7 +1366,7 @@ async def create_pass_through_endpoints("""Create new pass-through endpoint"""- import uuid+ from litellm._uuid import uuidfrom litellm.proxy.proxy_server import (get_config_general_settings,diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.pyindex 7255161b8bc..9fff2478804 100644--- a/litellm/proxy/proxy_server.py+++ b/litellm/proxy/proxy_server.py@@ -9,7 +9,7 @@ import subprocessimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidimport warningsfrom datetime import datetime, timedeltafrom typing import (diff --git a/litellm/proxy/spend_tracking/spend_tracking_utils.py b/litellm/proxy/spend_tracking/spend_tracking_utils.pyindex 8c59020bc24..7b78200b043 100644--- a/litellm/proxy/spend_tracking/spend_tracking_utils.py+++ b/litellm/proxy/spend_tracking/spend_tracking_utils.py@@ -370,7 +370,7 @@ def _get_session_id_for_spend_log(This ensures each spend log is associated with a unique session id."""- import uuid+ from litellm._uuid import uuidif (standard_logging_payload is not Nonediff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.pyindex e2ca3078384..8c11760904c 100644--- a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py+++ b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py@@ -671,7 +671,7 @@ async def upload_logo(file: UploadFile = File(...)):os.makedirs(upload_dir, exist_ok=True)# Generate unique filename- import uuid+ from litellm._uuid import uuidunique_filename = f"logo_{uuid.uuid4().hex}{file_extension}"file_path = os.path.join(upload_dir, unique_filename)diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.pyindex f3affa707ae..036b3174b63 100644--- a/litellm/proxy/utils.py+++ b/litellm/proxy/utils.py@@ -1308,7 +1308,7 @@ class ProxyLogging:"litellm_logging_obj", None)if litellm_logging_obj is None:- import uuid+ from litellm._uuid import uuidrequest_data["litellm_call_id"] = str(uuid.uuid4())user_api_key_logged_metadata = (diff --git a/litellm/responses/main.py b/litellm/responses/main.pyindex d3cb5a7de2a..c190d8e2d21 100644--- a/litellm/responses/main.py+++ b/litellm/responses/main.py@@ -211,7 +211,7 @@ async def aresponses_api_with_mcp(# Handle MCP streaming if requestedif stream and mcp_tools_with_litellm_proxy:# Generate MCP discovery events using the already processed tools- import uuid+ from litellm._uuid import uuidfrom litellm.responses.mcp.mcp_streaming_iterator import (create_mcp_list_tools_events,diff --git a/litellm/responses/mcp/litellm_proxy_mcp_handler.py b/litellm/responses/mcp/litellm_proxy_mcp_handler.pyindex 3e5ab38af2f..2600d53a171 100644--- a/litellm/responses/mcp/litellm_proxy_mcp_handler.py+++ b/litellm/responses/mcp/litellm_proxy_mcp_handler.py@@ -630,7 +630,7 @@ class LiteLLM_Proxy_MCP_Handler:Returns:List of MCP tool execution events for streaming"""- import uuid+ from litellm._uuid import uuidfrom litellm.responses.mcp.mcp_streaming_iterator import create_mcp_call_events@@ -714,7 +714,7 @@ class LiteLLM_Proxy_MCP_Handler:"""Add custom output elements to the final response for MCP tool execution."""# Import the required classes for creating output itemsimport json- import uuid+ from litellm._uuid import uuidfrom litellm.types.responses.main import GenericResponseOutputItem, OutputTextdiff --git a/litellm/responses/mcp/mcp_streaming_iterator.py b/litellm/responses/mcp/mcp_streaming_iterator.pyindex 8045d1c1dca..7d53452c1c0 100644--- a/litellm/responses/mcp/mcp_streaming_iterator.py+++ b/litellm/responses/mcp/mcp_streaming_iterator.py@@ -1,4 +1,4 @@-import uuid+from litellm._uuid import uuidfrom typing import (TYPE_CHECKING,Any,@@ -444,9 +444,6 @@ class MCPEnhancedStreamingIterator(BaseResponsesAPIStreamingIterator):"""Generate tool execution events and execute tools"""if not self.collected_response:return-- import uuid-from litellm.responses.mcp.litellm_proxy_mcp_handler import (LiteLLM_Proxy_MCP_Handler,)diff --git a/litellm/router.py b/litellm/router.pyindex 1d6b4f5dd9b..9c87f0bb029 100644--- a/litellm/router.py+++ b/litellm/router.py@@ -17,7 +17,7 @@ import loggingimport threadingimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom collections import defaultdictfrom functools import lru_cachefrom typing import (diff --git a/litellm/secret_managers/aws_secret_manager_v2.py b/litellm/secret_managers/aws_secret_manager_v2.pyindex 327dbf3d196..ff9921ebcb5 100644--- a/litellm/secret_managers/aws_secret_manager_v2.py+++ b/litellm/secret_managers/aws_secret_manager_v2.py@@ -215,7 +215,7 @@ class AWSSecretsManagerV2(BaseAWSLLM, BaseSecretManager):optional_params: Additional AWS parameterstimeout: Request timeout"""- import uuid+ from litellm._uuid import uuid# Prepare the request datadata = {"Name": secret_name, "SecretString": secret_value}diff --git a/litellm/types/router.py b/litellm/types/router.pyindex 8bed2bdccda..62f1c13eb4b 100644--- a/litellm/types/router.py+++ b/litellm/types/router.py@@ -4,7 +4,7 @@ litellm.Router Types - includes RouterConfig, UpdateRouterConfig, ModelInfo etcimport datetimeimport enum-import uuid+from litellm._uuid import uuidfrom dataclasses import dataclassfrom typing import Any, Dict, List, Literal, Optional, Tuple, Union, get_type_hintsdiff --git a/litellm/types/services.py b/litellm/types/services.pyindex e038100e279..78cb0cb3ceb 100644--- a/litellm/types/services.py+++ b/litellm/types/services.py@@ -1,5 +1,5 @@import enum-import uuid+from litellm._uuid import uuidfrom typing import List, Optionalfrom pydantic import BaseModel, Fielddiff --git a/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py b/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.pyindex a18af7a54d2..e2abf9c4c75 100644--- a/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py+++ b/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py@@ -6,7 +6,7 @@ sys.path.insert(0, os.path.abspath("../.."))import asyncioimport logging-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timedelta, timezonefrom unittest.mock import MagicMock, call, patchdiff --git a/tests/guardrails_tests/test_guardrails_config.py b/tests/guardrails_tests/test_guardrails_config.pyindex 110c0a30a9e..80b408a2dd1 100644--- a/tests/guardrails_tests/test_guardrails_config.py+++ b/tests/guardrails_tests/test_guardrails_config.py@@ -6,7 +6,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetimeimport pytestdiff --git a/tests/litellm_utils_tests/test_aws_secret_manager.py b/tests/litellm_utils_tests/test_aws_secret_manager.pyindex e64c42b26c6..5aa608acb86 100644--- a/tests/litellm_utils_tests/test_aws_secret_manager.py+++ b/tests/litellm_utils_tests/test_aws_secret_manager.py@@ -28,7 +28,7 @@ from typing import Optionalfrom unittest.mock import MagicMock, patchimport pytest-import uuid+from litellm._uuid import uuidimport jsonfrom litellm.secret_managers.aws_secret_manager_v2 import AWSSecretsManagerV2diff --git a/tests/litellm_utils_tests/test_hashicorp.py b/tests/litellm_utils_tests/test_hashicorp.pyindex c61168c99dd..055112d88c0 100644--- a/tests/litellm_utils_tests/test_hashicorp.py+++ b/tests/litellm_utils_tests/test_hashicorp.py@@ -13,7 +13,7 @@ sys.path.insert(from unittest.mock import patch, MagicMockimport loggingfrom litellm._logging import verbose_logger-import uuid+from litellm._uuid import uuidverbose_logger.setLevel(logging.DEBUG)diff --git a/tests/litellm_utils_tests/test_secret_manager.py b/tests/litellm_utils_tests/test_secret_manager.pyindex cc0977cc519..8c604fd2e68 100644--- a/tests/litellm_utils_tests/test_secret_manager.py+++ b/tests/litellm_utils_tests/test_secret_manager.py@@ -2,7 +2,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvimport jsondiff --git a/tests/llm_responses_api_testing/base_responses_api.py b/tests/llm_responses_api_testing/base_responses_api.pyindex 8436f130e1a..855aeff246c 100644--- a/tests/llm_responses_api_testing/base_responses_api.py+++ b/tests/llm_responses_api_testing/base_responses_api.py@@ -5,7 +5,7 @@ import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patchimport os-import uuid+from litellm._uuid import uuidimport timeimport base64diff --git a/tests/llm_translation/base_audio_transcription_unit_tests.py b/tests/llm_translation/base_audio_transcription_unit_tests.pyindex 958a02d9f46..4ee00fd4e9f 100644--- a/tests/llm_translation/base_audio_transcription_unit_tests.py+++ b/tests/llm_translation/base_audio_transcription_unit_tests.py@@ -5,7 +5,7 @@ import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patchimport os-import uuid+from litellm._uuid import uuidsys.path.insert(0, os.path.abspath("../..")diff --git a/tests/llm_translation/base_llm_unit_tests.py b/tests/llm_translation/base_llm_unit_tests.pyindex e7f60b3caae..1419edaea42 100644--- a/tests/llm_translation/base_llm_unit_tests.py+++ b/tests/llm_translation/base_llm_unit_tests.py@@ -5,7 +5,7 @@ import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patchimport os-import uuid+from litellm._uuid import uuidimport timeimport base64import inspectdiff --git a/tests/local_testing/cache_unit_tests.py b/tests/local_testing/cache_unit_tests.pyindex 8b82bbdfe66..d29eed33687 100644--- a/tests/local_testing/cache_unit_tests.py+++ b/tests/local_testing/cache_unit_tests.py@@ -4,7 +4,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_add_update_models.py b/tests/local_testing/test_add_update_models.pyindex 163687c1c21..6d7ae597b54 100644--- a/tests/local_testing/test_add_update_models.py+++ b/tests/local_testing/test_add_update_models.py@@ -1,7 +1,7 @@import sys, osimport tracebackimport json-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvfrom fastapi import Requestfrom datetime import datetime@@ -72,7 +72,7 @@ async def test_add_new_model(prisma_client):await litellm.proxy.proxy_server.prisma_client.connect()from litellm.proxy.proxy_server import user_api_key_cache- import uuid+ from litellm._uuid import uuid_new_model_id = f"local-test-{uuid.uuid4().hex}"@@ -121,7 +121,7 @@ async def test_add_update_model(prisma_client):await litellm.proxy.proxy_server.prisma_client.connect()from litellm.proxy.proxy_server import user_api_key_cache- import uuid+ from litellm._uuid import uuid_new_model_id = f"local-test-{uuid.uuid4().hex}"@@ -230,7 +230,7 @@ async def test_add_team_model_to_db(prisma_client):from litellm.proxy.management_endpoints.model_management_endpoints import (_add_team_model_to_db,)- import uuid+ from litellm._uuid import uuidnew_team = await _create_new_team(prisma_client)team_id = new_team.team_iddiff --git a/tests/local_testing/test_alangfuse.py b/tests/local_testing/test_alangfuse.pyindex 2eea4264786..75dc07f9d5c 100644--- a/tests/local_testing/test_alangfuse.py+++ b/tests/local_testing/test_alangfuse.py@@ -212,7 +212,7 @@ def create_async_task(**completion_kwargs):@pytest.mark.flaky(retries=12, delay=2)async def test_langfuse_logging_without_request_response(stream, langfuse_client):try:- import uuid+ from litellm._uuid import uuid_unique_trace_name = f"litellm-test-{str(uuid.uuid4())}"litellm.set_verbose = True@@ -276,7 +276,7 @@ async def test_langfuse_logging_audio_transcriptions(langfuse_client):"""Test that creates a trace with masked input and output"""- import uuid+ from litellm._uuid import uuid_unique_trace_name = f"litellm-test-{str(uuid.uuid4())}"litellm.set_verbose = True@@ -314,7 +314,7 @@ async def test_langfuse_masked_input_output(langfuse_client):"""Test that creates a trace with masked input and output"""- import uuid+ from litellm._uuid import uuidfor mask_value in [True, False]:_unique_trace_name = f"litellm-test-{str(uuid.uuid4())}"@@ -364,7 +364,7 @@ async def test_aaalangfuse_logging_metadata(langfuse_client):Release is just set for the traceTags is just set for the trace"""- import uuid+ from litellm._uuid import uuidlitellm.set_verbose = Truelitellm.success_callback = ["langfuse"]@@ -939,7 +939,7 @@ def test_aaalangfuse_dynamic_logging():Covers the team-logging scenario."""- import uuid+ from litellm._uuid import uuidimport langfusediff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.pyindex 2aae51110d3..ebaafcf43ba 100644--- a/tests/local_testing/test_amazing_vertex_completion.py+++ b/tests/local_testing/test_amazing_vertex_completion.py@@ -2489,7 +2489,7 @@ def mock_gemini_list_request(*args, **kwargs):return mock_response-import uuid+from litellm._uuid import uuid@pytest.mark.parametrize(diff --git a/tests/local_testing/test_audio_speech.py b/tests/local_testing/test_audio_speech.pyindex 9e8817d6e62..1d9247f9981 100644--- a/tests/local_testing/test_audio_speech.py+++ b/tests/local_testing/test_audio_speech.py@@ -7,7 +7,7 @@ import randomimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_caching.py b/tests/local_testing/test_caching.pyindex d1abec5ff70..39019ef35ac 100644--- a/tests/local_testing/test_caching.py+++ b/tests/local_testing/test_caching.py@@ -2,7 +2,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenv@@ -659,7 +659,7 @@ async def test_embedding_caching_base_64():host=os.environ["REDIS_HOST"],port=os.environ["REDIS_PORT"],)- import uuid+ from litellm._uuid import uuidinputs = [f"{uuid.uuid4()} hello this is ishaan",@@ -788,7 +788,7 @@ async def test_redis_batch_cache_write():- read from client"""litellm.set_verbose = True- import uuid+ from litellm._uuid import uuidmessages = [{"role": "user", "content": f"write a one sentence poem about: {uuid.uuid4()}"},@@ -1479,7 +1479,7 @@ async def test_cache_control_overrides():)print("Testing cache override")litellm.set_verbose = True- import uuid+ from litellm._uuid import uuidunique_num = str(uuid.uuid4())@@ -1527,7 +1527,7 @@ def test_sync_cache_control_overrides():)print("Testing cache override")litellm.set_verbose = True- import uuid+ from litellm._uuid import uuidunique_num = str(uuid.uuid4())@@ -2050,7 +2050,7 @@ async def test_redis_proxy_batch_redis_get_cache():user_api_key_cache = DualCache()- import uuid+ from litellm._uuid import uuidbatch_redis_get_obj.in_memory_cache = user_api_key_cache.in_memory_cache@@ -2493,7 +2493,7 @@ def test_redis_caching_multiple_namespaces():The same request with different namespaces should not be cached under the same key"""- import uuid+ from litellm._uuid import uuidfrom unittest.mock import patch, MagicMockimport litellmfrom litellm.caching import Cache@@ -2639,7 +2639,7 @@ def test_caching_with_reasoning_content():Test that reasoning content is cached"""- import uuid+ from litellm._uuid import uuidmessages = [{"role": "user", "content": f"what is litellm? {uuid.uuid4()}"}]litellm.cache = Cache()diff --git a/tests/local_testing/test_caching_handler.py b/tests/local_testing/test_caching_handler.pyindex 1006d23df32..70217257a75 100644--- a/tests/local_testing/test_caching_handler.py+++ b/tests/local_testing/test_caching_handler.py@@ -2,7 +2,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_custom_callback_input.py b/tests/local_testing/test_custom_callback_input.pyindex 90d1d15c5a9..fb7ca510404 100644--- a/tests/local_testing/test_custom_callback_input.py+++ b/tests/local_testing/test_custom_callback_input.py@@ -6,7 +6,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetimeimport pytestdiff --git a/tests/local_testing/test_dual_cache.py b/tests/local_testing/test_dual_cache.pyindex 657e00dae19..2da3df2783c 100644--- a/tests/local_testing/test_dual_cache.py+++ b/tests/local_testing/test_dual_cache.py@@ -2,7 +2,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_dynamic_rate_limit_handler.py b/tests/local_testing/test_dynamic_rate_limit_handler.pyindex 3f52e25389a..ff540e22e7a 100644--- a/tests/local_testing/test_dynamic_rate_limit_handler.py+++ b/tests/local_testing/test_dynamic_rate_limit_handler.py@@ -6,7 +6,7 @@ import randomimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom typing import Optional, Tuplediff --git a/tests/local_testing/test_gcs_bucket.py b/tests/local_testing/test_gcs_bucket.pyindex 0004fae7c48..5a9c99108c3 100644--- a/tests/local_testing/test_gcs_bucket.py+++ b/tests/local_testing/test_gcs_bucket.py@@ -8,7 +8,7 @@ import asyncioimport jsonimport loggingimport tempfile-import uuid+from litellm._uuid import uuidfrom datetime import datetimeimport pytestdiff --git a/tests/local_testing/test_helicone_integration.py b/tests/local_testing/test_helicone_integration.pyindex 3a6fa0309b1..4d77058598f 100644--- a/tests/local_testing/test_helicone_integration.py+++ b/tests/local_testing/test_helicone_integration.py@@ -97,7 +97,7 @@ def create_async_task(**completion_kwargs):reason="Authentication missing for openai",)async def test_helicone_logging_metadata():- import uuid+ from litellm._uuid import uuidlitellm.success_callback = ["helicone"]diff --git a/tests/local_testing/test_langsmith.py b/tests/local_testing/test_langsmith.pyindex ff4c677d164..af7ac46a1cf 100644--- a/tests/local_testing/test_langsmith.py+++ b/tests/local_testing/test_langsmith.py@@ -6,7 +6,7 @@ sys.path.insert(0, os.path.abspath("../.."))import asyncioimport logging-import uuid+from litellm._uuid import uuidimport pytestdiff --git a/tests/local_testing/test_mem_usage.py b/tests/local_testing/test_mem_usage.pyindex 9f18fb1e2d6..f91852899ad 100644--- a/tests/local_testing/test_mem_usage.py+++ b/tests/local_testing/test_mem_usage.py@@ -13,7 +13,7 @@# from concurrent.futures import ThreadPoolExecutor# from collections import defaultdict# from dotenv import load_dotenv-# import uuid+# from litellm._uuid import uuid# import tracemalloc# import objgraphdiff --git a/tests/local_testing/test_pass_through_endpoints.py b/tests/local_testing/test_pass_through_endpoints.pyindex 6cc6a66007f..9c5f5995218 100644--- a/tests/local_testing/test_pass_through_endpoints.py+++ b/tests/local_testing/test_pass_through_endpoints.py@@ -1,6 +1,6 @@import osimport sys-import uuid+from litellm._uuid import uuidfrom functools import partialfrom typing import Optionaldiff --git a/tests/local_testing/test_router_timeout.py b/tests/local_testing/test_router_timeout.pyindex 8ca58f84455..882c1684356 100644--- a/tests/local_testing/test_router_timeout.py+++ b/tests/local_testing/test_router_timeout.py@@ -96,7 +96,7 @@ def test_router_timeouts():@pytest.mark.asyncioasync def test_router_timeouts_bedrock():- import uuid+ from litellm._uuid import uuidimport openaidiff --git a/tests/local_testing/test_streaming.py b/tests/local_testing/test_streaming.pyindex 5ce437a49d4..630ae2b184f 100644--- a/tests/local_testing/test_streaming.py+++ b/tests/local_testing/test_streaming.py@@ -7,7 +7,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom typing import Tuplefrom unittest.mock import AsyncMock, MagicMock, patch@@ -2784,7 +2784,7 @@ def test_azure_streaming_and_function_calling():@pytest.mark.asyncioasync def test_azure_astreaming_and_function_calling():- import uuid+ from litellm._uuid import uuidtools = [{diff --git a/tests/local_testing/test_timeout.py b/tests/local_testing/test_timeout.pyindex 2f8050affed..007c32e4476 100644--- a/tests/local_testing/test_timeout.py+++ b/tests/local_testing/test_timeout.py@@ -9,7 +9,7 @@ sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system pathimport time-import uuid+from litellm._uuid import uuidimport httpximport openaidiff --git a/tests/local_testing/test_unit_test_caching.py b/tests/local_testing/test_unit_test_caching.pyindex 033fb774f0c..fa5cf802546 100644--- a/tests/local_testing/test_unit_test_caching.py+++ b/tests/local_testing/test_unit_test_caching.py@@ -2,7 +2,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvdiff --git a/tests/logging_callback_tests/test_alerting.py b/tests/logging_callback_tests/test_alerting.pyindex e431f99129f..b9ecfaeb3f0 100644--- a/tests/logging_callback_tests/test_alerting.py+++ b/tests/logging_callback_tests/test_alerting.py@@ -8,7 +8,7 @@ import osimport randomimport sysimport time-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timedeltafrom typing import Optionaldiff --git a/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py b/tests/logging_callback_tests/test_built_in_tools_cost_tracking.pyindex 4d0f1accaba..bd1465f1564 100644--- a/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py+++ b/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidimport pytestfrom dotenv import load_dotenvfrom fastapi import Request@@ -98,7 +98,7 @@ async def test_openai_web_search_logging_cost_tracking():"""Test web search cost tracking with different search context sizes"""test_custom_logger = await _setup_web_search_test()- import uuid+ from litellm._uuid import uuiddiff --git a/tests/logging_callback_tests/test_langfuse_e2e_test.py b/tests/logging_callback_tests/test_langfuse_e2e_test.pyindex 8d5e63fcdc0..3e76a685630 100644--- a/tests/logging_callback_tests/test_langfuse_e2e_test.py+++ b/tests/logging_callback_tests/test_langfuse_e2e_test.py@@ -119,7 +119,7 @@ class TestLangfuseLogging:@pytest.fixtureasync def mock_setup(self):"""Common setup for Langfuse logging tests"""- import uuid+ from litellm._uuid import uuidfrom unittest.mock import AsyncMock, patchimport httpxdiff --git a/tests/logging_callback_tests/test_moderations_api_logging.py b/tests/logging_callback_tests/test_moderations_api_logging.pyindex 1d3b5356b0f..5e2011afbba 100644--- a/tests/logging_callback_tests/test_moderations_api_logging.py+++ b/tests/logging_callback_tests/test_moderations_api_logging.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidimport pytestfrom dotenv import load_dotenvfrom fastapi import Requestdiff --git a/tests/logging_callback_tests/test_spend_logs.py b/tests/logging_callback_tests/test_spend_logs.pyindex 881e170f8aa..500419eb04d 100644--- a/tests/logging_callback_tests/test_spend_logs.py+++ b/tests/logging_callback_tests/test_spend_logs.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenvfrom fastapi import Requestdiff --git a/tests/logging_callback_tests/test_token_counting.py b/tests/logging_callback_tests/test_token_counting.pyindex 1a44229140a..6f84b7c18fe 100644--- a/tests/logging_callback_tests/test_token_counting.py+++ b/tests/logging_callback_tests/test_token_counting.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidimport pytestfrom dotenv import load_dotenvfrom fastapi import Requestdiff --git a/tests/logging_callback_tests/test_view_request_resp_logs.py b/tests/logging_callback_tests/test_view_request_resp_logs.pyindex a8018b62ee2..34e8d01303a 100644--- a/tests/logging_callback_tests/test_view_request_resp_logs.py+++ b/tests/logging_callback_tests/test_view_request_resp_logs.py@@ -8,7 +8,7 @@ import asyncioimport jsonimport loggingimport tempfile-import uuid+from litellm._uuid import uuidimport jsonfrom datetime import datetime, timedelta, timezonediff --git a/tests/multi_instance_e2e_tests/test_update_team_e2e.py b/tests/multi_instance_e2e_tests/test_update_team_e2e.pyindex c4769aa6a57..dfbfbd310ee 100644--- a/tests/multi_instance_e2e_tests/test_update_team_e2e.py+++ b/tests/multi_instance_e2e_tests/test_update_team_e2e.py@@ -52,7 +52,7 @@ async def chat_completion_on_port(Accepts an optional prompt string."""from openai import AsyncOpenAI- import uuid+ from litellm._uuid import uuidif prompt is None:prompt = f"Say hello! {uuid.uuid4()}" * 100diff --git a/tests/old_proxy_tests/tests/bursty_load_test_completion.py b/tests/old_proxy_tests/tests/bursty_load_test_completion.pyindex 529f2ce9f69..642bd9f14d4 100644--- a/tests/old_proxy_tests/tests/bursty_load_test_completion.py+++ b/tests/old_proxy_tests/tests/bursty_load_test_completion.py@@ -1,6 +1,6 @@import time, asynciofrom openai import AsyncOpenAI-import uuid+from litellm._uuid import uuidimport tracebackdiff --git a/tests/old_proxy_tests/tests/load_test_completion.py b/tests/old_proxy_tests/tests/load_test_completion.pyindex 29d8924ab5f..afbd74a7900 100644--- a/tests/old_proxy_tests/tests/load_test_completion.py+++ b/tests/old_proxy_tests/tests/load_test_completion.py@@ -2,7 +2,7 @@ import timeimport asyncioimport osfrom openai import AsyncOpenAI, AsyncAzureOpenAI-import uuid+from litellm._uuid import uuidimport tracebackfrom large_text import textfrom dotenv import load_dotenvdiff --git a/tests/old_proxy_tests/tests/load_test_embedding_100.py b/tests/old_proxy_tests/tests/load_test_embedding_100.pyindex 38ae8990aaa..8cd4d250249 100644--- a/tests/old_proxy_tests/tests/load_test_embedding_100.py+++ b/tests/old_proxy_tests/tests/load_test_embedding_100.py@@ -1,6 +1,6 @@import time, asynciofrom openai import AsyncOpenAI-import uuid+from litellm._uuid import uuidimport tracebackdiff --git a/tests/old_proxy_tests/tests/test_simple_traceparent_openai.py b/tests/old_proxy_tests/tests/test_simple_traceparent_openai.pyindex caa10051abf..d4c36029948 100644--- a/tests/old_proxy_tests/tests/test_simple_traceparent_openai.py+++ b/tests/old_proxy_tests/tests/test_simple_traceparent_openai.py@@ -1,5 +1,5 @@# mypy: ignore-errors-import uuid+from litellm._uuid import uuidimport openaidiff --git a/tests/otel_tests/test_e2e_budgeting.py b/tests/otel_tests/test_e2e_budgeting.pyindex 8af9fa9cbd4..e3b4c8b2b55 100644--- a/tests/otel_tests/test_e2e_budgeting.py+++ b/tests/otel_tests/test_e2e_budgeting.py@@ -61,7 +61,7 @@ async def generate_key(async def chat_completion(session, key: str, model: str):"""Make a chat completion request using OpenAI SDK"""from openai import AsyncOpenAI- import uuid+ from litellm._uuid import uuidclient = AsyncOpenAI(api_key=key, base_url="http://0.0.0.0:4000/v1" # Point to our local proxydiff --git a/tests/otel_tests/test_e2e_model_access.py b/tests/otel_tests/test_e2e_model_access.pyindex 4628dc7e9c8..ade319c2d43 100644--- a/tests/otel_tests/test_e2e_model_access.py+++ b/tests/otel_tests/test_e2e_model_access.py@@ -35,7 +35,7 @@ async def generate_team(session, models: Optional[List[str]] = None):async def mock_chat_completion(session, key: str, model: str):"""Make a chat completion request using OpenAI SDK"""from openai import AsyncOpenAI- import uuid+ from litellm._uuid import uuidclient = AsyncOpenAI(api_key=key, base_url="http://0.0.0.0:4000/v1")diff --git a/tests/otel_tests/test_guardrails.py b/tests/otel_tests/test_guardrails.pyindex cfad6985a0f..5345944bcb1 100644--- a/tests/otel_tests/test_guardrails.py+++ b/tests/otel_tests/test_guardrails.py@@ -4,7 +4,7 @@ import aiohttp, openaifrom openai import OpenAI, AsyncOpenAIfrom typing import Optional, List, Unionimport json-import uuid+from litellm._uuid import uuidasync def chat_completion(diff --git a/tests/otel_tests/test_moderations.py b/tests/otel_tests/test_moderations.pyindex 21abf748922..a0218b039fa 100644--- a/tests/otel_tests/test_moderations.py+++ b/tests/otel_tests/test_moderations.py@@ -3,7 +3,7 @@ import asyncioimport aiohttp, openaifrom openai import OpenAI, AsyncOpenAIfrom typing import Optional, List, Union-import uuid+from litellm._uuid import uuidasync def make_moderations_curl_request(diff --git a/tests/otel_tests/test_otel.py b/tests/otel_tests/test_otel.pyindex b252fcb5b57..e546b7d4a9d 100644--- a/tests/otel_tests/test_otel.py+++ b/tests/otel_tests/test_otel.py@@ -5,7 +5,7 @@ import asyncioimport aiohttp, openaifrom openai import OpenAI, AsyncOpenAIfrom typing import Optional, List, Union-import uuid+from litellm._uuid import uuidasync def generate_key(diff --git a/tests/otel_tests/test_prometheus.py b/tests/otel_tests/test_prometheus.pyindex 4e459508cc8..69c1f9413e3 100644--- a/tests/otel_tests/test_prometheus.py+++ b/tests/otel_tests/test_prometheus.py@@ -5,7 +5,7 @@ Unit tests for prometheus metricsimport pytestimport aiohttpimport asyncio-import uuid+from litellm._uuid import uuidimport osimport sysfrom openai import AsyncOpenAIdiff --git a/tests/otel_tests/test_rerank.py b/tests/otel_tests/test_rerank.pyindex 47fe109e7f6..f04d82442a3 100644--- a/tests/otel_tests/test_rerank.py+++ b/tests/otel_tests/test_rerank.py@@ -3,7 +3,7 @@ import asyncioimport aiohttp, openaifrom openai import OpenAI, AsyncOpenAIfrom typing import Optional, List, Union-import uuid+from litellm._uuid import uuidasync def make_rerank_curl_request(diff --git a/tests/otel_tests/test_team_member_permissions.py b/tests/otel_tests/test_team_member_permissions.pyindex 3b266a9e68d..d8187e2bc15 100644--- a/tests/otel_tests/test_team_member_permissions.py+++ b/tests/otel_tests/test_team_member_permissions.py@@ -45,7 +45,7 @@import pytestimport asyncioimport aiohttp, openai-import uuid+from litellm._uuid import uuidimport jsonfrom litellm.proxy._types import ProxyErrorTypesfrom typing import Optionaldiff --git a/tests/otel_tests/test_team_tag_routing.py b/tests/otel_tests/test_team_tag_routing.pyindex 842b76d946e..17570e7363c 100644--- a/tests/otel_tests/test_team_tag_routing.py+++ b/tests/otel_tests/test_team_tag_routing.py@@ -5,7 +5,7 @@ import asyncioimport aiohttp, openaifrom openai import OpenAI, AsyncOpenAIfrom typing import Optional, List, Union-import uuid+from litellm._uuid import uuidLITELLM_MASTER_KEY = "sk-1234"diff --git a/tests/proxy_admin_ui_tests/test_key_management.py b/tests/proxy_admin_ui_tests/test_key_management.pyindex b3522c88164..589a394cbbc 100644--- a/tests/proxy_admin_ui_tests/test_key_management.py+++ b/tests/proxy_admin_ui_tests/test_key_management.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidimport datetime as dtfrom datetime import datetime@@ -228,7 +228,7 @@ async def test_regenerate_api_key_with_new_alias_and_expiration(prisma_client):setattr(litellm.proxy.proxy_server, "prisma_client", prisma_client)setattr(litellm.proxy.proxy_server, "master_key", "sk-1234")await litellm.proxy.proxy_server.prisma_client.connect()- import uuid+ from litellm._uuid import uuid# generate new keykey_alias = f"test_alias_regenerate_key-{uuid.uuid4()}"@@ -279,7 +279,7 @@ async def test_regenerate_key_ui(prisma_client):setattr(litellm.proxy.proxy_server, "prisma_client", prisma_client)setattr(litellm.proxy.proxy_server, "master_key", "sk-1234")await litellm.proxy.proxy_server.prisma_client.connect()- import uuid+ from litellm._uuid import uuid# generate new keykey_alias = f"test_alias_regenerate_key-{uuid.uuid4()}"@@ -1076,7 +1076,7 @@ async def test_list_key_helper_team_filtering(prisma_client):from litellm.proxy.management_endpoints.key_management_endpoints import (_list_key_helper,)- import uuid+ from litellm._uuid import uuid# Setupsetattr(litellm.proxy.proxy_server, "prisma_client", prisma_client)diff --git a/tests/proxy_admin_ui_tests/test_role_based_access.py b/tests/proxy_admin_ui_tests/test_role_based_access.pyindex a1c4e9a399a..6d3fb357499 100644--- a/tests/proxy_admin_ui_tests/test_role_based_access.py+++ b/tests/proxy_admin_ui_tests/test_role_based_access.py@@ -5,7 +5,7 @@ RBAC testsimport osimport sysimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom dotenv import load_dotenvdiff --git a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.pyindex 8f758884683..dacda602c01 100644--- a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py+++ b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidimport datetime as dtfrom datetime import datetimediff --git a/tests/proxy_admin_ui_tests/test_sso_sign_in.py b/tests/proxy_admin_ui_tests/test_sso_sign_in.pyindex 28e0cbf8cc5..83bddf5b8b2 100644--- a/tests/proxy_admin_ui_tests/test_sso_sign_in.py+++ b/tests/proxy_admin_ui_tests/test_sso_sign_in.py@@ -60,7 +60,7 @@ async def test_auth_callback_new_user(mock_google_sso, mock_env_vars, prisma_cli"""Tests that a new SSO Sign In user is by default given an 'INTERNAL_USER_VIEW_ONLY' role"""- import uuid+ from litellm._uuid import uuidimport litellmlitellm._turn_on_debug()@@ -133,7 +133,7 @@ async def test_auth_callback_new_user_with_sso_default(Tests that a new SSO Sign In user is by default given an 'INTERNAL_USER' role"""- import uuid+ from litellm._uuid import uuid# Generate a unique user IDunique_user_id = str(uuid.uuid4())diff --git a/tests/proxy_admin_ui_tests/test_usage_endpoints.py b/tests/proxy_admin_ui_tests/test_usage_endpoints.pyindex 61d4e944936..3d3360b8ff6 100644--- a/tests/proxy_admin_ui_tests/test_usage_endpoints.py+++ b/tests/proxy_admin_ui_tests/test_usage_endpoints.py@@ -16,7 +16,7 @@ For all tests - test the following:import osimport sysimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom dotenv import load_dotenvdiff --git a/tests/proxy_unit_tests/test_audit_logs_proxy.py b/tests/proxy_unit_tests/test_audit_logs_proxy.pyindex a4506950dd1..ec7d42805d2 100644--- a/tests/proxy_unit_tests/test_audit_logs_proxy.py+++ b/tests/proxy_unit_tests/test_audit_logs_proxy.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom dotenv import load_dotenv@@ -24,7 +24,7 @@ import loggingload_dotenv()import pytest-import uuid+from litellm._uuid import uuidimport litellmfrom litellm._logging import verbose_proxy_loggerdiff --git a/tests/proxy_unit_tests/test_custom_callback_input.py b/tests/proxy_unit_tests/test_custom_callback_input.pyindex d98c7619e32..71a7e94b180 100644--- a/tests/proxy_unit_tests/test_custom_callback_input.py+++ b/tests/proxy_unit_tests/test_custom_callback_input.py@@ -6,7 +6,7 @@ import osimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetimeimport pytestdiff --git a/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py b/tests/proxy_unit_tests/test_e2e_pod_lock_manager.pyindex 5f4a16f4a0e..e52e8816a30 100644--- a/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py+++ b/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py@@ -1,7 +1,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidfrom typing import Listfrom datetime import datetime, timezone, timedelta@@ -379,7 +379,7 @@ async def test_e2e_size_of_redis_buffer():from litellm.proxy.db.db_spend_update_writer import DBSpendUpdateWriterfrom litellm.proxy.db.db_transaction_queue.base_update_queue import BaseUpdateQueuefrom litellm.caching import RedisCache- import uuid+ from litellm._uuid import uuidredis_cache = RedisCache(host=os.getenv("REDIS_HOST"), port=os.getenv("REDIS_PORT"), password=os.getenv("REDIS_PASSWORD"))diff --git a/tests/proxy_unit_tests/test_jwt.py b/tests/proxy_unit_tests/test_jwt.pyindex 57514817e88..2e54ade688f 100644--- a/tests/proxy_unit_tests/test_jwt.py+++ b/tests/proxy_unit_tests/test_jwt.py@@ -7,7 +7,7 @@ import randomimport sysimport timeimport traceback-import uuid+from litellm._uuid import uuidfrom dotenv import load_dotenv@@ -240,7 +240,7 @@ def prisma_client():@pytest.fixturedef team_token_tuple():import json- import uuid+ from litellm._uuid import uuidimport jwtfrom cryptography.hazmat.backends import default_backend@@ -305,7 +305,7 @@ def team_token_tuple():@pytest.mark.asyncioasync def test_team_token_output(prisma_client, audience, monkeypatch):import json- import uuid+ from litellm._uuid import uuidimport jwtfrom cryptography.hazmat.backends import default_backend@@ -478,7 +478,7 @@ async def test_team_token_output(prisma_client, audience, monkeypatch):async def aaaatest_user_token_output(prisma_client, audience, team_id_set, default_team_id, user_id_upsert, monkeypatch):- import uuid+ from litellm._uuid import uuidargs = locals()print(f"received args - {args}")@@ -491,7 +491,7 @@ async def aaaatest_user_token_output(- retry -> it should pass now"""import json- import uuid+ from litellm._uuid import uuidimport jwtfrom cryptography.hazmat.backends import default_backend@@ -726,7 +726,7 @@ async def test_allowed_routes_admin(- check if admin passes user_api_key_auth for them"""import json- import uuid+ from litellm._uuid import uuidimport jwtfrom cryptography.hazmat.backends import default_backenddiff --git a/tests/proxy_unit_tests/test_key_generate_prisma.py b/tests/proxy_unit_tests/test_key_generate_prisma.pyindex be29ce1e343..6eb4efa7d63 100644--- a/tests/proxy_unit_tests/test_key_generate_prisma.py+++ b/tests/proxy_unit_tests/test_key_generate_prisma.py@@ -22,7 +22,7 @@import osimport sysimport traceback-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom dotenv import load_dotenv@@ -1236,7 +1236,7 @@ def test_generate_and_update_key(prisma_client):# 11. Generate a Key, cal key/info, call key/update, call key/info# Check if data gets updated# Check if untouched data does not get updated- import uuid+ from litellm._uuid import uuidprint("prisma client=", prisma_client)@@ -1554,7 +1554,7 @@ def test_call_with_key_over_budget(prisma_client):litellm.cache = Cache()import time- import uuid+ from litellm._uuid import uuidrequest_id = f"chatcmpl-e41836bb-bb8b-4df2-8e70-8f3e160155ac{uuid.uuid4()}"@@ -1676,7 +1676,7 @@ def test_call_with_key_over_budget_no_cache(prisma_client):litellm.cache = Cache()import time- import uuid+ from litellm._uuid import uuidrequest_id = f"chatcmpl-e41836bb-bb8b-4df2-8e70-8f3e160155ac{uuid.uuid4()}"@@ -1900,7 +1900,7 @@ async def test_call_with_key_never_over_budget(prisma_client):# update spend using track_cost callback, make 2nd request, it should failimport time- import uuid+ from litellm._uuid import uuidfrom litellm import Choices, Message, ModelResponse, Usagefrom litellm.proxy.proxy_server import _ProxyDBLogger@@ -1991,7 +1991,7 @@ async def test_call_with_key_over_budget_stream(prisma_client):# update spend using track_cost callback, make 2nd request, it should failimport time- import uuid+ from litellm._uuid import uuidfrom litellm import Choices, Message, ModelResponse, Usagefrom litellm.proxy.proxy_server import _ProxyDBLogger@@ -2440,7 +2440,7 @@ async def test_key_with_no_permissions(prisma_client):async def track_cost_callback_helper_fn(generated_key: str, user_id: str):- import uuid+ from litellm._uuid import uuidfrom litellm import Choices, Message, ModelResponse, Usagefrom litellm.proxy.proxy_server import _ProxyDBLogger@@ -2549,7 +2549,7 @@ async def test_proxy_load_test_db(prisma_client):@pytest.mark.asyncio()async def test_master_key_hashing(prisma_client):try:- import uuid+ from litellm._uuid import uuidprint("prisma client=", prisma_client)diff --git a/tests/proxy_unit_tests/test_proxy_server.py b/tests/proxy_unit_tests/test_proxy_server.pyindex 139c90fd3cb..4e72580b8be 100644--- a/tests/proxy_unit_tests/test_proxy_server.py+++ b/tests/proxy_unit_tests/test_proxy_server.py@@ -928,7 +928,7 @@ async def test_get_team_redis(client_no_auth):import random-import uuid+from litellm._uuid import uuidfrom unittest.mock import AsyncMock, MagicMock, PropertyMock, patchfrom litellm.proxy._types import (diff --git a/tests/spend_tracking_tests/test_spend_accuracy_tests.py b/tests/spend_tracking_tests/test_spend_accuracy_tests.pyindex 93228c2d06a..821709250da 100644--- a/tests/spend_tracking_tests/test_spend_accuracy_tests.py+++ b/tests/spend_tracking_tests/test_spend_accuracy_tests.py@@ -4,7 +4,7 @@ import aiohttpimport jsonfrom httpx import AsyncClientfrom typing import Any, Optional-import uuid+from litellm._uuid import uuid"""Tests to run@@ -89,7 +89,7 @@ async def generate_key(session, user_id: str, team_id: str):async def chat_completion(session, key: str):"""Make a chat completion request"""from openai import AsyncOpenAI- import uuid+ from litellm._uuid import uuidclient = AsyncOpenAI(api_key=key, base_url="http://0.0.0.0:4000/v1")diff --git a/tests/store_model_in_db_tests/test_mcp_servers.py b/tests/store_model_in_db_tests/test_mcp_servers.pyindex 7a524c16d22..a396c37832a 100644--- a/tests/store_model_in_db_tests/test_mcp_servers.py+++ b/tests/store_model_in_db_tests/test_mcp_servers.py@@ -1,7 +1,7 @@from datetime import datetimefrom typing import List, Optionalimport pytest-import uuid+from litellm._uuid import uuidimport osimport asynciofrom unittest import mockdiff --git a/tests/store_model_in_db_tests/test_team_models.py b/tests/store_model_in_db_tests/test_team_models.pyindex 0faa01c8ee7..83822433a63 100644--- a/tests/store_model_in_db_tests/test_team_models.py+++ b/tests/store_model_in_db_tests/test_team_models.py@@ -3,9 +3,9 @@ import asyncioimport aiohttpimport jsonfrom openai import AsyncOpenAI-import uuid+from litellm._uuid import uuidfrom httpx import AsyncClient-import uuid+from litellm._uuid import uuidimport osTEST_MASTER_KEY = "sk-1234"diff --git a/tests/test_budget_management.py b/tests/test_budget_management.pyindex 8175a9b1df4..5863cea9d3b 100644--- a/tests/test_budget_management.py+++ b/tests/test_budget_management.py@@ -1,6 +1,6 @@# What is this?## Unit tests for the /budget/* endpoints-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timedeltaimport aiohttpdiff --git a/tests/test_callbacks_on_proxy.py b/tests/test_callbacks_on_proxy.pyindex 42665c35bce..831ca449f83 100644--- a/tests/test_callbacks_on_proxy.py+++ b/tests/test_callbacks_on_proxy.py@@ -108,7 +108,7 @@ async def test_check_num_callbacks():-> sleep for 30 seconds-> check current callbacks"""- import uuid+ from litellm._uuid import uuidasync with aiohttp.ClientSession() as session:await asyncio.sleep(30)@@ -158,7 +158,7 @@ async def test_check_num_callbacks_on_lowest_latency():-> check current callbacks-> update back to original routing-strategy"""- import uuid+ from litellm._uuid import uuidasync with aiohttp.ClientSession() as session:await asyncio.sleep(30)diff --git a/tests/test_config.py b/tests/test_config.pyindex 76316368f6c..8ec65341963 100644--- a/tests/test_config.py+++ b/tests/test_config.py@@ -83,7 +83,7 @@ async def test_team_logging():await config_update(session)# 2. Call /chat/completions with a specific trace id- import uuid+ from litellm._uuid import uuid_trace_id = f"trace-{uuid.uuid4()}"_request_metadata = {diff --git a/tests/test_end_users.py b/tests/test_end_users.pyindex 0ce1694147b..c175bb371e2 100644--- a/tests/test_end_users.py+++ b/tests/test_end_users.py@@ -4,7 +4,7 @@ import pytestimport asyncioimport aiohttpimport time-import uuid+from litellm._uuid import uuidfrom openai import AsyncOpenAIfrom typing import Optionaldiff --git a/tests/test_litellm/integrations/test_deepeval.py b/tests/test_litellm/integrations/test_deepeval.pyindex 26e79585c91..6dd3aef0a03 100644--- a/tests/test_litellm/integrations/test_deepeval.py+++ b/tests/test_litellm/integrations/test_deepeval.py@@ -1,6 +1,6 @@import osimport unittest-import uuid+from litellm._uuid import uuidfrom datetime import datetime, timezonefrom unittest.mock import MagicMock, patchdiff --git a/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.py b/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.pyindex ef2bb3757fc..ffd3526698a 100644--- a/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.py+++ b/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.py@@ -2,7 +2,7 @@ import base64import jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom unittest.mock import MagicMock, Mock, patchimport pytestdiff --git a/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py b/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.pyindex 452f5a94024..39386fe4fd2 100644--- a/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py+++ b/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py@@ -1,7 +1,7 @@import jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom unittest.mock import MagicMock, patchimport pytestdiff --git a/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py b/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.pyindex be24444afaf..bacdfb225fb 100644--- a/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py+++ b/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py@@ -2,7 +2,7 @@ import asyncioimport jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom typing import Optional, castfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.pyindex f1594c36e7e..215e0d050a3 100644--- a/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py@@ -1,7 +1,7 @@import jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom datetime import datetimefrom typing import Listfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.pyindex bd37e9cbe41..2f736e4e1d1 100644--- a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py@@ -1,7 +1,7 @@import jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom typing import Dict, Optionalfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.pyindex c05e528846d..981c26d6db9 100644--- a/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py@@ -2,7 +2,7 @@ import asyncioimport jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom typing import Optional, castfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.pyindex 84454160572..c895e016e3e 100644--- a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py@@ -2,7 +2,7 @@ import asyncioimport jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom typing import Optional, castfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py b/tests/test_litellm/proxy/management_endpoints/test_ui_sso.pyindex 639b4756533..86339c0d227 100644--- a/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py+++ b/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py@@ -2,7 +2,7 @@ import asyncioimport jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom typing import Optional, castfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py b/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.pyindex 14306197603..5f46d469ddb 100644--- a/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py+++ b/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py@@ -1,7 +1,7 @@import jsonimport osimport sys-import uuid+from litellm._uuid import uuidfrom unittest.mock import AsyncMock, MagicMockimport pytestdiff --git a/tests/test_litellm/proxy/test_common_request_processing.py b/tests/test_litellm/proxy/test_common_request_processing.pyindex 6a8d1ae1339..ef1aec2e764 100644--- a/tests/test_litellm/proxy/test_common_request_processing.py+++ b/tests/test_litellm/proxy/test_common_request_processing.py@@ -1,5 +1,5 @@import copy-import uuid+from litellm._uuid import uuidfrom unittest.mock import AsyncMock, MagicMockimport pytestdiff --git a/tests/test_models.py b/tests/test_models.pyindex 5a61d2eafd8..a0fa0525273 100644--- a/tests/test_models.py+++ b/tests/test_models.py@@ -280,7 +280,7 @@ async def test_add_and_delete_models():- Delete model- Call model -> expect to fail"""- import uuid+ from litellm._uuid import uuidasync with aiohttp.ClientSession() as session:key_gen = await generate_key(session=session)@@ -404,7 +404,7 @@ async def test_add_model_run_health():Call /health-> Ensure the health check for the endpoint is working as expected"""- import uuid+ from litellm._uuid import uuidasync with aiohttp.ClientSession() as session:key_gen = await generate_key(session=session)@@ -528,7 +528,7 @@ async def test_team_model_e2e():"""from tests.test_users import new_userfrom tests.test_team import new_team- import uuid+ from litellm._uuid import uuidasync with aiohttp.ClientSession() as session:# Creat a userdiff --git a/tests/test_openai_endpoints.py b/tests/test_openai_endpoints.pyindex c90fd91a5d7..fd997ebb71c 100644--- a/tests/test_openai_endpoints.py+++ b/tests/test_openai_endpoints.py@@ -5,7 +5,7 @@ import asyncioimport aiohttp, openaifrom openai import OpenAI, AsyncOpenAI, AzureOpenAI, AsyncAzureOpenAIfrom typing import Optional, List, Union-import uuid+from litellm._uuid import uuidLITELLM_MASTER_KEY = "sk-1234"diff --git a/tests/test_team_logging.py b/tests/test_team_logging.pyindex 516b6fa13b4..913b1e19496 100644--- a/tests/test_team_logging.py+++ b/tests/test_team_logging.py@@ -78,7 +78,7 @@ async def test_aaateam_logging():session, models=["fake-openai-endpoint"], team_id="team-1") # team-1 logs to project 1- import uuid+ from litellm._uuid import uuid_trace_id = f"trace-{uuid.uuid4()}"_request_metadata = {@@ -144,7 +144,7 @@ async def test_team_2logging():session, models=["fake-openai-endpoint"], team_id="team-2") # team-1 logs to project 1- import uuid+ from litellm._uuid import uuid_trace_id = f"trace-{uuid.uuid4()}"_request_metadata = {diff --git a/tests/test_team_members.py b/tests/test_team_members.pyindex d8981f84a62..a3d64eae803 100644--- a/tests/test_team_members.py+++ b/tests/test_team_members.py@@ -3,7 +3,7 @@ import requestsimport timefrom typing import Dict, Listimport logging-import uuid+from litellm._uuid import uuid# Configure logginglogging.basicConfig(level=logging.INFO)diff --git a/tests/test_users.py b/tests/test_users.pyindex 08cbf9f1035..9b8eca789b2 100644--- a/tests/test_users.py+++ b/tests/test_users.py@@ -318,7 +318,7 @@ async def test_user_model_access():import json-import uuid+from litellm._uuid import uuidimport pytestimport aiohttpfrom typing import Dict, Tuplediff --git a/tests/vector_store_tests/base_vector_store_test.py b/tests/vector_store_tests/base_vector_store_test.pyindex d3b58d8338d..414b5ee3334 100644--- a/tests/vector_store_tests/base_vector_store_test.py+++ b/tests/vector_store_tests/base_vector_store_test.py@@ -5,7 +5,7 @@ import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patchimport os-import uuid+from litellm._uuid import uuidimport timeimport base64