diff --git a/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py b/cookbook/litellm_router_load_test/memory_usage/router_endpoint.py index 689f105bc5..1dc2d91485 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 os import litellm from litellm import Router from dotenv import load_dotenv -import uuid +from litellm._uuid import uuid load_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.py index a8aa506e8a..76d5d3913f 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 litellm from litellm import Router from dotenv import load_dotenv -import uuid +from litellm._uuid import uuid load_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.py index a8aa506e8a..76d5d3913f 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 litellm from litellm import Router from dotenv import load_dotenv -import uuid +from litellm._uuid import uuid load_dotenv() diff --git a/enterprise/litellm_enterprise/enterprise_callbacks/generic_api_callback.py b/enterprise/litellm_enterprise/enterprise_callbacks/generic_api_callback.py index d239be4125..7e259d4e19 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 Endpoint import asyncio import os import traceback -import uuid +from litellm._uuid import uuid from typing import Dict, List, Optional, Union import litellm diff --git a/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py b/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py index 6edd198cd8..4b1bb024ac 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 uuid from datetime import datetime from typing import TYPE_CHECKING, Optional, cast diff --git a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py index e069a89b9c..e2963f8fb8 100644 --- a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py +++ b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py @@ -4,7 +4,7 @@ import asyncio import base64 import json -import uuid +from litellm._uuid import uuid from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Union, cast from fastapi import HTTPException diff --git a/litellm/caching/qdrant_semantic_cache.py b/litellm/caching/qdrant_semantic_cache.py index 32d4d8b0fd..0e77b5a6c2 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 prompt messages = kwargs["messages"] @@ -279,7 +279,7 @@ class QdrantSemanticCache(BaseCache): pass async def async_set_cache(self, key, value, **kwargs): - import uuid + from litellm._uuid import uuid from litellm.proxy.proxy_server import llm_model_list, llm_router diff --git a/litellm/integrations/azure_storage/azure_storage.py b/litellm/integrations/azure_storage/azure_storage.py index 6ffb1e542f..b4362665a4 100644 --- a/litellm/integrations/azure_storage/azure_storage.py +++ b/litellm/integrations/azure_storage/azure_storage.py @@ -2,7 +2,7 @@ import asyncio import json import os import time -import uuid +from litellm._uuid import uuid from datetime import datetime, timedelta from typing import List, Optional diff --git a/litellm/integrations/datadog/datadog.py b/litellm/integrations/datadog/datadog.py index f5a0883bea..0c62667f74 100644 --- a/litellm/integrations/datadog/datadog.py +++ b/litellm/integrations/datadog/datadog.py @@ -17,7 +17,7 @@ import asyncio import datetime import os import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime as datetimeObj from typing import Any, Dict, List, Optional, Union diff --git a/litellm/integrations/datadog/datadog_llm_obs.py b/litellm/integrations/datadog/datadog_llm_obs.py index 2702192f63..fc3cf4b9ff 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=examp import asyncio import json import os -import uuid +from litellm._uuid import uuid from datetime import datetime from typing import Any, Dict, List, Literal, Optional, Union diff --git a/litellm/integrations/deepeval/deepeval.py b/litellm/integrations/deepeval/deepeval.py index f548ff50d7..972843e120 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 uuid from litellm.integrations.custom_logger import CustomLogger from litellm.integrations.deepeval.api import Api, Endpoints, HttpMethods from litellm.integrations.deepeval.types import ( diff --git a/litellm/integrations/dynamodb.py b/litellm/integrations/dynamodb.py index 2c527ea8aa..dfc05ae1f3 100644 --- a/litellm/integrations/dynamodb.py +++ b/litellm/integrations/dynamodb.py @@ -3,7 +3,7 @@ import os import traceback -import uuid +from litellm._uuid import uuid from typing import Any import litellm diff --git a/litellm/integrations/gcs_bucket/gcs_bucket.py b/litellm/integrations/gcs_bucket/gcs_bucket.py index 972a023666..9190f921d5 100644 --- a/litellm/integrations/gcs_bucket/gcs_bucket.py +++ b/litellm/integrations/gcs_bucket/gcs_bucket.py @@ -1,7 +1,7 @@ import asyncio import json import os -import uuid +from litellm._uuid import uuid from datetime import datetime, timedelta, timezone from typing import TYPE_CHECKING, Any, Dict, List, Optional from urllib.parse import quote diff --git a/litellm/integrations/lago.py b/litellm/integrations/lago.py index 5dfb1ce097..b881193e86 100644 --- a/litellm/integrations/lago.py +++ b/litellm/integrations/lago.py @@ -3,7 +3,7 @@ import json import os -import uuid +from litellm._uuid import uuid from typing import Literal, Optional import httpx diff --git a/litellm/integrations/langsmith.py b/litellm/integrations/langsmith.py index 7783b704b4..cc9b361b69 100644 --- a/litellm/integrations/langsmith.py +++ b/litellm/integrations/langsmith.py @@ -5,7 +5,7 @@ import os import random import traceback import types -import uuid +from litellm._uuid import uuid from datetime import datetime, timezone from typing import Any, Dict, List, Optional diff --git a/litellm/integrations/literal_ai.py b/litellm/integrations/literal_ai.py index 5bf9afd7eb..042779ba84 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 asyncio import os -import uuid +from litellm._uuid import uuid from typing import List, Optional import httpx diff --git a/litellm/integrations/logfire_logger.py b/litellm/integrations/logfire_logger.py index 516bd4a8e2..2345dc869c 100644 --- a/litellm/integrations/logfire_logger.py +++ b/litellm/integrations/logfire_logger.py @@ -3,7 +3,7 @@ import os import traceback -import uuid +from litellm._uuid import uuid from enum import Enum from typing import Any, Dict, NamedTuple diff --git a/litellm/integrations/posthog.py b/litellm/integrations/posthog.py index d321135f28..5298e538a7 100644 --- a/litellm/integrations/posthog.py +++ b/litellm/integrations/posthog.py @@ -11,7 +11,7 @@ For batching specific details see CustomBatchLogger class import asyncio import os -import uuid +from litellm._uuid import uuid from typing import Any, Dict, Optional diff --git a/litellm/litellm_core_utils/fallback_utils.py b/litellm/litellm_core_utils/fallback_utils.py index a5b0c85c81..7ce5386208 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 uuid from typing import Optional import litellm diff --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.py index ce054b91cc..2def52ed7e 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 asyncio import json import time import traceback -import uuid +from litellm._uuid import uuid from typing import Dict, Iterable, List, Literal, Optional, Tuple, Union import litellm diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index b9cc5e50c3..c1d8a1cd41 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -2,7 +2,7 @@ import copy import json import mimetypes import re -import uuid +from litellm._uuid import uuid import xml.etree.ElementTree as ET from enum import Enum from typing import Any, List, Optional, Tuple, cast, overload diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index bc0fbdf5c1..b2f6c62140 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -5,7 +5,7 @@ import json import threading import time import traceback -import uuid +from litellm._uuid import uuid from typing import Any, Callable, Dict, List, Optional, Union, cast import httpx diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py b/litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py index e4191a945f..306bcd9bb2 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` format import json import traceback -import uuid +from litellm._uuid import uuid from collections import deque from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, Literal, Optional diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py index d38e7adc23..7de2a1e1c6 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 uuid from litellm.types.llms.anthropic import TextBlock, ToolUseBlock diff --git a/litellm/llms/azure/audio_transcriptions.py b/litellm/llms/azure/audio_transcriptions.py index 1f09ac7574..8519b1c35a 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 uuid from typing import Any, Coroutine, Optional, Union from openai import AsyncAzureOpenAI, AzureOpenAI diff --git a/litellm/llms/bedrock/chat/invoke_agent/transformation.py b/litellm/llms/bedrock/chat/invoke_agent/transformation.py index e4ff6d398e..4a7c33ed20 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 base64 import json -import uuid +from litellm._uuid import uuid from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union import httpx diff --git a/litellm/llms/bedrock/chat/invoke_handler.py b/litellm/llms/bedrock/chat/invoke_handler.py index 42cdb34fc1..0d1b4102c9 100644 --- a/litellm/llms/bedrock/chat/invoke_handler.py +++ b/litellm/llms/bedrock/chat/invoke_handler.py @@ -7,7 +7,7 @@ import json import time import types import urllib.parse -import uuid +from litellm._uuid import uuid from functools import partial from typing import ( Any, diff --git a/litellm/llms/bedrock/common_utils.py b/litellm/llms/bedrock/common_utils.py index 63c366c948..2b111cde60 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 name bucket_name = ( diff --git a/litellm/llms/bedrock/files/transformation.py b/litellm/llms/bedrock/files/transformation.py index d493deddb6..0a95cf9168 100644 --- a/litellm/llms/bedrock/files/transformation.py +++ b/litellm/llms/bedrock/files/transformation.py @@ -1,7 +1,7 @@ import json import os import time -import uuid +from litellm._uuid import uuid from typing import Any, Dict, List, Optional, Tuple, Union from httpx import Headers, Response diff --git a/litellm/llms/bedrock/rerank/transformation.py b/litellm/llms/bedrock/rerank/transformation.py index be8250a967..b5d33eda49 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` input Why separate file? Make it easy to see how transformation works """ -import uuid +from litellm._uuid import uuid from typing import List, Optional, Union from litellm.types.llms.bedrock import ( diff --git a/litellm/llms/deepinfra/rerank/transformation.py b/litellm/llms/deepinfra/rerank/transformation.py index 8259c6075b..6a3244a3c8 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 uuid from typing import Any, Dict, List, Optional, Union import httpx diff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.py index 31d749032b..524b1c9714 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 uuid from typing import Any, List, Literal, Optional, Tuple, Union, cast import httpx diff --git a/litellm/llms/gemini/realtime/transformation.py b/litellm/llms/gemini/realtime/transformation.py index f32a404c9e..e1dd6f146f 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 uuid from typing import Any, Dict, List, Optional, Union, cast from litellm import verbose_logger diff --git a/litellm/llms/hosted_vllm/rerank/transformation.py b/litellm/llms/hosted_vllm/rerank/transformation.py index 419327d9d5..c0a57c4353 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 uuid from typing import Any, Dict, List, Optional, Union from litellm.types.rerank import ( diff --git a/litellm/llms/huggingface/rerank/transformation.py b/litellm/llms/huggingface/rerank/transformation.py index 9c3234c351..aa0f37bc6b 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 uuid from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union import httpx diff --git a/litellm/llms/infinity/rerank/transformation.py b/litellm/llms/infinity/rerank/transformation.py index 4b75fa121b..6259d445ae 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 uuid from typing import List, Optional import httpx diff --git a/litellm/llms/jina_ai/rerank/transformation.py b/litellm/llms/jina_ai/rerank/transformation.py index 8d0a9b1431..d8569b01b8 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 works Docs - https://jina.ai/reranker """ -import uuid +from litellm._uuid import uuid from typing import Any, Dict, List, Optional, Tuple, Union from httpx import URL, Response diff --git a/litellm/llms/ollama/chat/transformation.py b/litellm/llms/ollama/chat/transformation.py index 3527a57921..3b755e7933 100644 --- a/litellm/llms/ollama/chat/transformation.py +++ b/litellm/llms/ollama/chat/transformation.py @@ -1,6 +1,6 @@ import json import time -import uuid +from litellm._uuid import uuid from typing import ( TYPE_CHECKING, Any, diff --git a/litellm/llms/ollama/completion/transformation.py b/litellm/llms/ollama/completion/transformation.py index bfb0b7f187..981a987ec9 100644 --- a/litellm/llms/ollama/completion/transformation.py +++ b/litellm/llms/ollama/completion/transformation.py @@ -1,6 +1,6 @@ import json import time -import uuid +from litellm._uuid import uuid from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator, List, Optional, Union from httpx._models import Headers, Response diff --git a/litellm/llms/ollama_chat.py b/litellm/llms/ollama_chat.py index d46e714519..082312d28f 100644 --- a/litellm/llms/ollama_chat.py +++ b/litellm/llms/ollama_chat.py @@ -1,6 +1,6 @@ import json import time -import uuid +from litellm._uuid import uuid from typing import Any, List, Optional, Union import aiohttp diff --git a/litellm/llms/together_ai/rerank/transformation.py b/litellm/llms/together_ai/rerank/transformation.py index 1fdb772add..63b593dfe4 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/rera Why separate file? Make it easy to see how transformation works """ -import uuid +from litellm._uuid import uuid from typing import List, Optional from litellm.types.rerank import ( diff --git a/litellm/llms/vertex_ai/batches/transformation.py b/litellm/llms/vertex_ai/batches/transformation.py index 5b6d21b594..22cd0bd402 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 uuid from typing import Dict from litellm.llms.vertex_ai.common_utils import ( diff --git a/litellm/llms/vertex_ai/files/transformation.py b/litellm/llms/vertex_ai/files/transformation.py index f2e5a5b5d2..01f6c86fd4 100644 --- a/litellm/llms/vertex_ai/files/transformation.py +++ b/litellm/llms/vertex_ai/files/transformation.py @@ -1,7 +1,7 @@ import json import os import time -import uuid +from litellm._uuid import uuid from typing import Any, Dict, List, Optional, Tuple, Union from httpx import Headers, Response diff --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.py index 9376b28cbe..dc3a6cf15e 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 calls import json import time -import uuid +from litellm._uuid import uuid from copy import deepcopy from functools import partial from typing import ( diff --git a/litellm/main.py b/litellm/main.py index 50de09c3db..f0b1820cbb 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -17,7 +17,7 @@ import random import sys import time import traceback -import uuid +from litellm._uuid import uuid from concurrent import futures from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait from copy import deepcopy diff --git a/litellm/proxy/_experimental/mcp_server/db.py b/litellm/proxy/_experimental/mcp_server/db.py index d5d9f97890..79e3b0f762 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 uuid from typing import Any, Dict, Iterable, List, Optional, Set, Union from litellm._logging import verbose_proxy_logger diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index a92b7d8ad2..6f2732af37 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -1,6 +1,6 @@ import enum import json -import uuid +from litellm._uuid import uuid from datetime import datetime from typing import ( TYPE_CHECKING, diff --git a/litellm/proxy/client/cli/commands/auth.py b/litellm/proxy/client/cli/commands/auth.py index 78cbb5ecf8..ff9f05fd32 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_context def login(ctx: click.Context): """Login to LiteLLM proxy using SSO authentication""" - import uuid + from litellm._uuid import uuid from litellm.constants import LITELLM_CLI_SOURCE_IDENTIFIER from litellm.proxy.client.cli.interface import show_commands diff --git a/litellm/proxy/db/db_transaction_queue/pod_lock_manager.py b/litellm/proxy/db/db_transaction_queue/pod_lock_manager.py index 2dab963b02..bb5424b0e9 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 uuid from typing import TYPE_CHECKING, Any, Optional from litellm._logging import verbose_proxy_logger diff --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.py index db72a9e9d2..8ca2950677 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 uuid from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Type, cast from fastapi import HTTPException diff --git a/litellm/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/proxy/guardrails/guardrail_hooks/presidio.py index e3f114c746..38a17595c4 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/presidio.py +++ b/litellm/proxy/guardrails/guardrail_hooks/presidio.py @@ -10,7 +10,7 @@ import asyncio import json -import uuid +from litellm._uuid import uuid from datetime import datetime from typing import ( Any, diff --git a/litellm/proxy/guardrails/guardrail_registry.py b/litellm/proxy/guardrails/guardrail_registry.py index 69c8fd8084..b5ae8437d8 100644 --- a/litellm/proxy/guardrails/guardrail_registry.py +++ b/litellm/proxy/guardrails/guardrail_registry.py @@ -2,7 +2,7 @@ import importlib import os -import uuid +from litellm._uuid import uuid from datetime import datetime, timezone from typing import Dict, List, Optional, Type, cast diff --git a/litellm/proxy/hooks/key_management_event_hooks.py b/litellm/proxy/hooks/key_management_event_hooks.py index 0289a92961..7ad1aaffc1 100644 --- a/litellm/proxy/hooks/key_management_event_hooks.py +++ b/litellm/proxy/hooks/key_management_event_hooks.py @@ -1,6 +1,6 @@ import asyncio import json -import uuid +from litellm._uuid import uuid from datetime import datetime, timezone from typing import Any, List, Optional diff --git a/litellm/proxy/hooks/user_management_event_hooks.py b/litellm/proxy/hooks/user_management_event_hooks.py index cc33f63837..9579298e5c 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 uuid from datetime import datetime, timezone from typing import Optional diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.py index 68e6342d6b..66085b69b3 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 LiteLLM import asyncio import json import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime, timezone from typing import Any, Dict, List, Optional, Union, cast diff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.py index eb389450f9..aa56cc68a8 100644 --- a/litellm/proxy/management_endpoints/key_management_endpoints.py +++ b/litellm/proxy/management_endpoints/key_management_endpoints.py @@ -14,7 +14,7 @@ import copy import json import secrets import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime, timedelta, timezone from typing import List, Literal, Optional, Tuple, cast diff --git a/litellm/proxy/management_endpoints/model_management_endpoints.py b/litellm/proxy/management_endpoints/model_management_endpoints.py index 9180e6100b..8f9c6edd2b 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 asyncio import datetime import json -import uuid +from litellm._uuid import uuid from typing import Dict, List, Literal, Optional, Tuple, Union, cast from fastapi import APIRouter, Depends, HTTPException, Request, status diff --git a/litellm/proxy/management_endpoints/organization_endpoints.py b/litellm/proxy/management_endpoints/organization_endpoints.py index c3fca196d5..2b52b6fc51 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 uuid from typing import List, Optional, Tuple from fastapi import APIRouter, Depends, HTTPException, Request, status diff --git a/litellm/proxy/management_endpoints/scim/scim_v2.py b/litellm/proxy/management_endpoints/scim/scim_v2.py index 6720f0c3b7..fd7d150a7f 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 uuid from typing import Any, Dict, List, Optional, Set, Tuple from fastapi import ( diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.py index 9766386344..cbea3da174 100644 --- a/litellm/proxy/management_endpoints/team_endpoints.py +++ b/litellm/proxy/management_endpoints/team_endpoints.py @@ -12,7 +12,7 @@ All /team management endpoints import asyncio import json import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime, timezone from typing import Any, Dict, List, Optional, Tuple, Union, cast diff --git a/litellm/proxy/management_endpoints/ui_sso.py b/litellm/proxy/management_endpoints/ui_sso.py index 2af940ec65..dc8b96656c 100644 --- a/litellm/proxy/management_endpoints/ui_sso.py +++ b/litellm/proxy/management_endpoints/ui_sso.py @@ -10,7 +10,7 @@ Has all /sso/* routes import asyncio import os -import uuid +from litellm._uuid import uuid from copy import deepcopy from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, cast diff --git a/litellm/proxy/management_helpers/audit_logs.py b/litellm/proxy/management_helpers/audit_logs.py index b1b2fdf1ca..ea082f468a 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 uuid from datetime import datetime, timezone import litellm diff --git a/litellm/proxy/management_helpers/object_permission_utils.py b/litellm/proxy/management_helpers/object_permission_utils.py index 3b55974b7b..5299bc9209 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 uuid from typing import Dict, Optional, Union from litellm._logging import verbose_proxy_logger diff --git a/litellm/proxy/management_helpers/utils.py b/litellm/proxy/management_helpers/utils.py index 246fa0b639..e25208a216 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 uuid from datetime import datetime from functools import wraps from typing import Optional, Tuple diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py index a1f43d0ca5..628784f6f1 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 asyncio import copy import json import traceback -import uuid +from litellm._uuid import uuid from base64 import b64encode from datetime import datetime from 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 uuid from 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 uuid verbose_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 uuid from litellm.proxy.proxy_server import ( get_config_general_settings, diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 7255161b8b..9fff247880 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -9,7 +9,7 @@ import subprocess import sys import time import traceback -import uuid +from litellm._uuid import uuid import warnings from datetime import datetime, timedelta from typing import ( diff --git a/litellm/proxy/spend_tracking/spend_tracking_utils.py b/litellm/proxy/spend_tracking/spend_tracking_utils.py index 8c59020bc2..7b78200b04 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 uuid if ( standard_logging_payload is not None diff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py index e2ca307838..8c11760904 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 uuid unique_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.py index f3affa707a..036b3174b6 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 uuid request_data["litellm_call_id"] = str(uuid.uuid4()) user_api_key_logged_metadata = ( diff --git a/litellm/responses/main.py b/litellm/responses/main.py index d3cb5a7de2..c190d8e2d2 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 requested if stream and mcp_tools_with_litellm_proxy: # Generate MCP discovery events using the already processed tools - import uuid + from litellm._uuid import uuid from 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.py index 3e5ab38af2..2600d53a17 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 uuid from 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 items import json - import uuid + from litellm._uuid import uuid from litellm.types.responses.main import GenericResponseOutputItem, OutputText diff --git a/litellm/responses/mcp/mcp_streaming_iterator.py b/litellm/responses/mcp/mcp_streaming_iterator.py index 8045d1c1dc..7d53452c1c 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 uuid from 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.py index 1d6b4f5dd9..9c87f0bb02 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -17,7 +17,7 @@ import logging import threading import time import traceback -import uuid +from litellm._uuid import uuid from collections import defaultdict from functools import lru_cache from typing import ( diff --git a/litellm/secret_managers/aws_secret_manager_v2.py b/litellm/secret_managers/aws_secret_manager_v2.py index 327dbf3d19..ff9921ebcb 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 parameters timeout: Request timeout """ - import uuid + from litellm._uuid import uuid # Prepare the request data data = {"Name": secret_name, "SecretString": secret_value} diff --git a/litellm/types/router.py b/litellm/types/router.py index 8bed2bdccd..62f1c13eb4 100644 --- a/litellm/types/router.py +++ b/litellm/types/router.py @@ -4,7 +4,7 @@ litellm.Router Types - includes RouterConfig, UpdateRouterConfig, ModelInfo etc import datetime import enum -import uuid +from litellm._uuid import uuid from dataclasses import dataclass from typing import Any, Dict, List, Literal, Optional, Tuple, Union, get_type_hints diff --git a/litellm/types/services.py b/litellm/types/services.py index e038100e27..78cb0cb3ce 100644 --- a/litellm/types/services.py +++ b/litellm/types/services.py @@ -1,5 +1,5 @@ import enum -import uuid +from litellm._uuid import uuid from typing import List, Optional from pydantic import BaseModel, Field diff --git a/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py b/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py index a18af7a54d..e2abf9c4c7 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 asyncio import logging -import uuid +from litellm._uuid import uuid from datetime import datetime, timedelta, timezone from unittest.mock import MagicMock, call, patch diff --git a/tests/guardrails_tests/test_guardrails_config.py b/tests/guardrails_tests/test_guardrails_config.py index 110c0a30a9..80b408a2dd 100644 --- a/tests/guardrails_tests/test_guardrails_config.py +++ b/tests/guardrails_tests/test_guardrails_config.py @@ -6,7 +6,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime import pytest diff --git a/tests/litellm_utils_tests/test_aws_secret_manager.py b/tests/litellm_utils_tests/test_aws_secret_manager.py index e64c42b26c..5aa608acb8 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 Optional from unittest.mock import MagicMock, patch import pytest -import uuid +from litellm._uuid import uuid import json from litellm.secret_managers.aws_secret_manager_v2 import AWSSecretsManagerV2 diff --git a/tests/litellm_utils_tests/test_hashicorp.py b/tests/litellm_utils_tests/test_hashicorp.py index c61168c99d..055112d88c 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, MagicMock import logging from litellm._logging import verbose_logger -import uuid +from litellm._uuid import uuid verbose_logger.setLevel(logging.DEBUG) diff --git a/tests/litellm_utils_tests/test_secret_manager.py b/tests/litellm_utils_tests/test_secret_manager.py index cc0977cc51..8c604fd2e6 100644 --- a/tests/litellm_utils_tests/test_secret_manager.py +++ b/tests/litellm_utils_tests/test_secret_manager.py @@ -2,7 +2,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv import json diff --git a/tests/llm_responses_api_testing/base_responses_api.py b/tests/llm_responses_api_testing/base_responses_api.py index 8436f130e1..855aeff246 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 sys from typing import Any, Dict, List from unittest.mock import MagicMock, Mock, patch import os -import uuid +from litellm._uuid import uuid import time import base64 diff --git a/tests/llm_translation/base_audio_transcription_unit_tests.py b/tests/llm_translation/base_audio_transcription_unit_tests.py index 958a02d9f4..4ee00fd4e9 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 sys from typing import Any, Dict, List from unittest.mock import MagicMock, Mock, patch import os -import uuid +from litellm._uuid import uuid sys.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.py index e7f60b3caa..1419edaea4 100644 --- a/tests/llm_translation/base_llm_unit_tests.py +++ b/tests/llm_translation/base_llm_unit_tests.py @@ -5,7 +5,7 @@ import sys from typing import Any, Dict, List from unittest.mock import MagicMock, Mock, patch import os -import uuid +from litellm._uuid import uuid import time import base64 import inspect diff --git a/tests/local_testing/cache_unit_tests.py b/tests/local_testing/cache_unit_tests.py index 8b82bbdfe6..d29eed3368 100644 --- a/tests/local_testing/cache_unit_tests.py +++ b/tests/local_testing/cache_unit_tests.py @@ -4,7 +4,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv diff --git a/tests/local_testing/test_add_update_models.py b/tests/local_testing/test_add_update_models.py index 163687c1c2..6d7ae597b5 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, os import traceback import json -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv from fastapi import Request from 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 uuid new_team = await _create_new_team(prisma_client) team_id = new_team.team_id diff --git a/tests/local_testing/test_alangfuse.py b/tests/local_testing/test_alangfuse.py index 2eea426478..75dc07f9d5 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 uuid for 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 trace Tags is just set for the trace """ - import uuid + from litellm._uuid import uuid litellm.set_verbose = True litellm.success_callback = ["langfuse"] @@ -939,7 +939,7 @@ def test_aaalangfuse_dynamic_logging(): Covers the team-logging scenario. """ - import uuid + from litellm._uuid import uuid import langfuse diff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.py index 2aae51110d..ebaafcf43b 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.py index 9e8817d6e6..1d9247f998 100644 --- a/tests/local_testing/test_audio_speech.py +++ b/tests/local_testing/test_audio_speech.py @@ -7,7 +7,7 @@ import random import sys import time import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv diff --git a/tests/local_testing/test_caching.py b/tests/local_testing/test_caching.py index d1abec5ff7..39019ef35a 100644 --- a/tests/local_testing/test_caching.py +++ b/tests/local_testing/test_caching.py @@ -2,7 +2,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from 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 uuid inputs = [ 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 uuid messages = [ {"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 uuid unique_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 uuid unique_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 uuid batch_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 uuid from unittest.mock import patch, MagicMock import litellm from 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 uuid messages = [{"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.py index 1006d23df3..70217257a7 100644 --- a/tests/local_testing/test_caching_handler.py +++ b/tests/local_testing/test_caching_handler.py @@ -2,7 +2,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv diff --git a/tests/local_testing/test_custom_callback_input.py b/tests/local_testing/test_custom_callback_input.py index 90d1d15c5a..fb7ca51040 100644 --- a/tests/local_testing/test_custom_callback_input.py +++ b/tests/local_testing/test_custom_callback_input.py @@ -6,7 +6,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime import pytest diff --git a/tests/local_testing/test_dual_cache.py b/tests/local_testing/test_dual_cache.py index 657e00dae1..2da3df2783 100644 --- a/tests/local_testing/test_dual_cache.py +++ b/tests/local_testing/test_dual_cache.py @@ -2,7 +2,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv diff --git a/tests/local_testing/test_dynamic_rate_limit_handler.py b/tests/local_testing/test_dynamic_rate_limit_handler.py index 3f52e25389..ff540e22e7 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 random import sys import time import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime from typing import Optional, Tuple diff --git a/tests/local_testing/test_gcs_bucket.py b/tests/local_testing/test_gcs_bucket.py index 0004fae7c4..5a9c99108c 100644 --- a/tests/local_testing/test_gcs_bucket.py +++ b/tests/local_testing/test_gcs_bucket.py @@ -8,7 +8,7 @@ import asyncio import json import logging import tempfile -import uuid +from litellm._uuid import uuid from datetime import datetime import pytest diff --git a/tests/local_testing/test_helicone_integration.py b/tests/local_testing/test_helicone_integration.py index 3a6fa0309b..4d77058598 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 uuid litellm.success_callback = ["helicone"] diff --git a/tests/local_testing/test_langsmith.py b/tests/local_testing/test_langsmith.py index ff4c677d16..af7ac46a1c 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 asyncio import logging -import uuid +from litellm._uuid import uuid import pytest diff --git a/tests/local_testing/test_mem_usage.py b/tests/local_testing/test_mem_usage.py index 9f18fb1e2d..f91852899a 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 objgraph diff --git a/tests/local_testing/test_pass_through_endpoints.py b/tests/local_testing/test_pass_through_endpoints.py index 6cc6a66007..9c5f599521 100644 --- a/tests/local_testing/test_pass_through_endpoints.py +++ b/tests/local_testing/test_pass_through_endpoints.py @@ -1,6 +1,6 @@ import os import sys -import uuid +from litellm._uuid import uuid from functools import partial from typing import Optional diff --git a/tests/local_testing/test_router_timeout.py b/tests/local_testing/test_router_timeout.py index 8ca58f8445..882c168435 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.asyncio async def test_router_timeouts_bedrock(): - import uuid + from litellm._uuid import uuid import openai diff --git a/tests/local_testing/test_streaming.py b/tests/local_testing/test_streaming.py index 5ce437a49d..630ae2b184 100644 --- a/tests/local_testing/test_streaming.py +++ b/tests/local_testing/test_streaming.py @@ -7,7 +7,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from typing import Tuple from unittest.mock import AsyncMock, MagicMock, patch @@ -2784,7 +2784,7 @@ def test_azure_streaming_and_function_calling(): @pytest.mark.asyncio async def test_azure_astreaming_and_function_calling(): - import uuid + from litellm._uuid import uuid tools = [ { diff --git a/tests/local_testing/test_timeout.py b/tests/local_testing/test_timeout.py index 2f8050affe..007c32e447 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 path import time -import uuid +from litellm._uuid import uuid import httpx import openai diff --git a/tests/local_testing/test_unit_test_caching.py b/tests/local_testing/test_unit_test_caching.py index 033fb774f0..fa5cf80254 100644 --- a/tests/local_testing/test_unit_test_caching.py +++ b/tests/local_testing/test_unit_test_caching.py @@ -2,7 +2,7 @@ import os import sys import time import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv diff --git a/tests/logging_callback_tests/test_alerting.py b/tests/logging_callback_tests/test_alerting.py index e431f99129..b9ecfaeb3f 100644 --- a/tests/logging_callback_tests/test_alerting.py +++ b/tests/logging_callback_tests/test_alerting.py @@ -8,7 +8,7 @@ import os import random import sys import time -import uuid +from litellm._uuid import uuid from datetime import datetime, timedelta from typing import Optional diff --git a/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py b/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py index 4d0f1accab..bd1465f156 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 os import sys import traceback -import uuid +from litellm._uuid import uuid import pytest from dotenv import load_dotenv from 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 uuid diff --git a/tests/logging_callback_tests/test_langfuse_e2e_test.py b/tests/logging_callback_tests/test_langfuse_e2e_test.py index 8d5e63fcdc..3e76a68563 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.fixture async def mock_setup(self): """Common setup for Langfuse logging tests""" - import uuid + from litellm._uuid import uuid from unittest.mock import AsyncMock, patch import httpx diff --git a/tests/logging_callback_tests/test_moderations_api_logging.py b/tests/logging_callback_tests/test_moderations_api_logging.py index 1d3b5356b0..5e2011afbb 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 os import sys import traceback -import uuid +from litellm._uuid import uuid import pytest from dotenv import load_dotenv from fastapi import Request diff --git a/tests/logging_callback_tests/test_spend_logs.py b/tests/logging_callback_tests/test_spend_logs.py index 881e170f8a..500419eb04 100644 --- a/tests/logging_callback_tests/test_spend_logs.py +++ b/tests/logging_callback_tests/test_spend_logs.py @@ -1,7 +1,7 @@ import os import sys import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv from fastapi import Request diff --git a/tests/logging_callback_tests/test_token_counting.py b/tests/logging_callback_tests/test_token_counting.py index 1a44229140..6f84b7c18f 100644 --- a/tests/logging_callback_tests/test_token_counting.py +++ b/tests/logging_callback_tests/test_token_counting.py @@ -1,7 +1,7 @@ import os import sys import traceback -import uuid +from litellm._uuid import uuid import pytest from dotenv import load_dotenv from fastapi import Request diff --git a/tests/logging_callback_tests/test_view_request_resp_logs.py b/tests/logging_callback_tests/test_view_request_resp_logs.py index a8018b62ee..34e8d01303 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 asyncio import json import logging import tempfile -import uuid +from litellm._uuid import uuid import json from datetime import datetime, timedelta, timezone diff --git a/tests/multi_instance_e2e_tests/test_update_team_e2e.py b/tests/multi_instance_e2e_tests/test_update_team_e2e.py index c4769aa6a5..dfbfbd310e 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 uuid if prompt is None: prompt = f"Say hello! {uuid.uuid4()}" * 100 diff --git a/tests/old_proxy_tests/tests/bursty_load_test_completion.py b/tests/old_proxy_tests/tests/bursty_load_test_completion.py index 529f2ce9f6..642bd9f14d 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, asyncio from openai import AsyncOpenAI -import uuid +from litellm._uuid import uuid import traceback diff --git a/tests/old_proxy_tests/tests/load_test_completion.py b/tests/old_proxy_tests/tests/load_test_completion.py index 29d8924ab5..afbd74a790 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 time import asyncio import os from openai import AsyncOpenAI, AsyncAzureOpenAI -import uuid +from litellm._uuid import uuid import traceback from large_text import text from dotenv import load_dotenv diff --git a/tests/old_proxy_tests/tests/load_test_embedding_100.py b/tests/old_proxy_tests/tests/load_test_embedding_100.py index 38ae8990aa..8cd4d25024 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, asyncio from openai import AsyncOpenAI -import uuid +from litellm._uuid import uuid import traceback diff --git a/tests/old_proxy_tests/tests/test_simple_traceparent_openai.py b/tests/old_proxy_tests/tests/test_simple_traceparent_openai.py index caa10051ab..d4c3602994 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 uuid import openai diff --git a/tests/otel_tests/test_e2e_budgeting.py b/tests/otel_tests/test_e2e_budgeting.py index 8af9fa9cbd..e3b4c8b2b5 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 uuid client = AsyncOpenAI( api_key=key, base_url="http://0.0.0.0:4000/v1" # Point to our local proxy diff --git a/tests/otel_tests/test_e2e_model_access.py b/tests/otel_tests/test_e2e_model_access.py index 4628dc7e9c..ade319c2d4 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 uuid client = 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.py index cfad6985a0..5345944bcb 100644 --- a/tests/otel_tests/test_guardrails.py +++ b/tests/otel_tests/test_guardrails.py @@ -4,7 +4,7 @@ import aiohttp, openai from openai import OpenAI, AsyncOpenAI from typing import Optional, List, Union import json -import uuid +from litellm._uuid import uuid async def chat_completion( diff --git a/tests/otel_tests/test_moderations.py b/tests/otel_tests/test_moderations.py index 21abf74892..a0218b039f 100644 --- a/tests/otel_tests/test_moderations.py +++ b/tests/otel_tests/test_moderations.py @@ -3,7 +3,7 @@ import asyncio import aiohttp, openai from openai import OpenAI, AsyncOpenAI from typing import Optional, List, Union -import uuid +from litellm._uuid import uuid async def make_moderations_curl_request( diff --git a/tests/otel_tests/test_otel.py b/tests/otel_tests/test_otel.py index b252fcb5b5..e546b7d4a9 100644 --- a/tests/otel_tests/test_otel.py +++ b/tests/otel_tests/test_otel.py @@ -5,7 +5,7 @@ import asyncio import aiohttp, openai from openai import OpenAI, AsyncOpenAI from typing import Optional, List, Union -import uuid +from litellm._uuid import uuid async def generate_key( diff --git a/tests/otel_tests/test_prometheus.py b/tests/otel_tests/test_prometheus.py index 4e459508cc..69c1f9413e 100644 --- a/tests/otel_tests/test_prometheus.py +++ b/tests/otel_tests/test_prometheus.py @@ -5,7 +5,7 @@ Unit tests for prometheus metrics import pytest import aiohttp import asyncio -import uuid +from litellm._uuid import uuid import os import sys from openai import AsyncOpenAI diff --git a/tests/otel_tests/test_rerank.py b/tests/otel_tests/test_rerank.py index 47fe109e7f..f04d82442a 100644 --- a/tests/otel_tests/test_rerank.py +++ b/tests/otel_tests/test_rerank.py @@ -3,7 +3,7 @@ import asyncio import aiohttp, openai from openai import OpenAI, AsyncOpenAI from typing import Optional, List, Union -import uuid +from litellm._uuid import uuid async def make_rerank_curl_request( diff --git a/tests/otel_tests/test_team_member_permissions.py b/tests/otel_tests/test_team_member_permissions.py index 3b266a9e68..d8187e2bc1 100644 --- a/tests/otel_tests/test_team_member_permissions.py +++ b/tests/otel_tests/test_team_member_permissions.py @@ -45,7 +45,7 @@ import pytest import asyncio import aiohttp, openai -import uuid +from litellm._uuid import uuid import json from litellm.proxy._types import ProxyErrorTypes from typing import Optional diff --git a/tests/otel_tests/test_team_tag_routing.py b/tests/otel_tests/test_team_tag_routing.py index 842b76d946..17570e7363 100644 --- a/tests/otel_tests/test_team_tag_routing.py +++ b/tests/otel_tests/test_team_tag_routing.py @@ -5,7 +5,7 @@ import asyncio import aiohttp, openai from openai import OpenAI, AsyncOpenAI from typing import Optional, List, Union -import uuid +from litellm._uuid import uuid LITELLM_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.py index b3522c8816..589a394cbb 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 os import sys import traceback -import uuid +from litellm._uuid import uuid import datetime as dt from 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 key key_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 key key_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 # Setup setattr(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.py index a1c4e9a399..6d3fb35749 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 tests import os import sys import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime from dotenv import load_dotenv diff --git a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py index 8f75888468..dacda602c0 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 os import sys import traceback -import uuid +from litellm._uuid import uuid import datetime as dt from datetime import datetime diff --git a/tests/proxy_admin_ui_tests/test_sso_sign_in.py b/tests/proxy_admin_ui_tests/test_sso_sign_in.py index 28e0cbf8cc..83bddf5b8b 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 uuid import litellm litellm._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 ID unique_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.py index 61d4e94493..3d3360b8ff 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 os import sys import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime from dotenv import load_dotenv diff --git a/tests/proxy_unit_tests/test_audit_logs_proxy.py b/tests/proxy_unit_tests/test_audit_logs_proxy.py index a4506950dd..ec7d42805d 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 os import sys import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime from dotenv import load_dotenv @@ -24,7 +24,7 @@ import logging load_dotenv() import pytest -import uuid +from litellm._uuid import uuid import litellm from litellm._logging import verbose_proxy_logger diff --git a/tests/proxy_unit_tests/test_custom_callback_input.py b/tests/proxy_unit_tests/test_custom_callback_input.py index d98c7619e3..71a7e94b18 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 os import sys import time import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime import pytest diff --git a/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py b/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py index 5f4a16f4a0..e52e8816a3 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 os import sys import traceback -import uuid +from litellm._uuid import uuid from typing import List from 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 DBSpendUpdateWriter from litellm.proxy.db.db_transaction_queue.base_update_queue import BaseUpdateQueue from litellm.caching import RedisCache - import uuid + from litellm._uuid import uuid redis_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.py index 57514817e8..2e54ade688 100644 --- a/tests/proxy_unit_tests/test_jwt.py +++ b/tests/proxy_unit_tests/test_jwt.py @@ -7,7 +7,7 @@ import random import sys import time import traceback -import uuid +from litellm._uuid import uuid from dotenv import load_dotenv @@ -240,7 +240,7 @@ def prisma_client(): @pytest.fixture def team_token_tuple(): import json - import uuid + from litellm._uuid import uuid import jwt from cryptography.hazmat.backends import default_backend @@ -305,7 +305,7 @@ def team_token_tuple(): @pytest.mark.asyncio async def test_team_token_output(prisma_client, audience, monkeypatch): import json - import uuid + from litellm._uuid import uuid import jwt from 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 uuid args = 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 uuid import jwt from 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 uuid import jwt from cryptography.hazmat.backends import default_backend diff --git a/tests/proxy_unit_tests/test_key_generate_prisma.py b/tests/proxy_unit_tests/test_key_generate_prisma.py index be29ce1e34..6eb4efa7d6 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 os import sys import traceback -import uuid +from litellm._uuid import uuid from datetime import datetime, timezone from 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 uuid print("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 uuid request_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 uuid request_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 fail import time - import uuid + from litellm._uuid import uuid from litellm import Choices, Message, ModelResponse, Usage from 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 fail import time - import uuid + from litellm._uuid import uuid from litellm import Choices, Message, ModelResponse, Usage from 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 uuid from litellm import Choices, Message, ModelResponse, Usage from 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 uuid print("prisma client=", prisma_client) diff --git a/tests/proxy_unit_tests/test_proxy_server.py b/tests/proxy_unit_tests/test_proxy_server.py index 139c90fd3c..4e72580b8b 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 uuid from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch from 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.py index 93228c2d06..821709250d 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 aiohttp import json from httpx import AsyncClient from 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 uuid client = 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.py index 7a524c16d2..a396c37832 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 datetime from typing import List, Optional import pytest -import uuid +from litellm._uuid import uuid import os import asyncio from unittest import mock diff --git a/tests/store_model_in_db_tests/test_team_models.py b/tests/store_model_in_db_tests/test_team_models.py index 0faa01c8ee..83822433a6 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 asyncio import aiohttp import json from openai import AsyncOpenAI -import uuid +from litellm._uuid import uuid from httpx import AsyncClient -import uuid +from litellm._uuid import uuid import os TEST_MASTER_KEY = "sk-1234" diff --git a/tests/test_budget_management.py b/tests/test_budget_management.py index 8175a9b1df..5863cea9d3 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 uuid from datetime import datetime, timedelta import aiohttp diff --git a/tests/test_callbacks_on_proxy.py b/tests/test_callbacks_on_proxy.py index 42665c35bc..831ca449f8 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 uuid async 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 uuid async with aiohttp.ClientSession() as session: await asyncio.sleep(30) diff --git a/tests/test_config.py b/tests/test_config.py index 76316368f6..8ec6534196 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.py index 0ce1694147..c175bb371e 100644 --- a/tests/test_end_users.py +++ b/tests/test_end_users.py @@ -4,7 +4,7 @@ import pytest import asyncio import aiohttp import time -import uuid +from litellm._uuid import uuid from openai import AsyncOpenAI from typing import Optional diff --git a/tests/test_litellm/integrations/test_deepeval.py b/tests/test_litellm/integrations/test_deepeval.py index 26e79585c9..6dd3aef0a0 100644 --- a/tests/test_litellm/integrations/test_deepeval.py +++ b/tests/test_litellm/integrations/test_deepeval.py @@ -1,6 +1,6 @@ import os import unittest -import uuid +from litellm._uuid import uuid from datetime import datetime, timezone from unittest.mock import MagicMock, patch diff --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.py index ef2bb3757f..ffd3526698 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 base64 import json import os import sys -import uuid +from litellm._uuid import uuid from unittest.mock import MagicMock, Mock, patch import pytest diff --git a/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py b/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py index 452f5a9402..39386fe4fd 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 json import os import sys -import uuid +from litellm._uuid import uuid from unittest.mock import MagicMock, patch import pytest diff --git a/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py b/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py index be24444afa..bacdfb225f 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 asyncio import json import os import sys -import uuid +from litellm._uuid import uuid from typing import Optional, cast from unittest.mock import AsyncMock, MagicMock, patch diff --git a/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py index f1594c36e7..215e0d050a 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 json import os import sys -import uuid +from litellm._uuid import uuid from datetime import datetime from typing import List from unittest.mock import AsyncMock, MagicMock, patch diff --git a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py index bd37e9cbe4..2f736e4e1d 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 json import os import sys -import uuid +from litellm._uuid import uuid from typing import Dict, Optional from unittest.mock import AsyncMock, MagicMock, patch diff --git a/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py index c05e528846..981c26d6db 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 asyncio import json import os import sys -import uuid +from litellm._uuid import uuid from typing import Optional, cast from unittest.mock import AsyncMock, MagicMock, patch diff --git a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py index 8445416057..c895e016e3 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 asyncio import json import os import sys -import uuid +from litellm._uuid import uuid from typing import Optional, cast from unittest.mock import AsyncMock, MagicMock, patch diff --git a/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py b/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py index 639b475653..86339c0d22 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 asyncio import json import os import sys -import uuid +from litellm._uuid import uuid from typing import Optional, cast from unittest.mock import AsyncMock, MagicMock, patch diff --git a/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py b/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py index 1430619760..5f46d469dd 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 json import os import sys -import uuid +from litellm._uuid import uuid from unittest.mock import AsyncMock, MagicMock import pytest diff --git a/tests/test_litellm/proxy/test_common_request_processing.py b/tests/test_litellm/proxy/test_common_request_processing.py index 6a8d1ae133..ef1aec2e76 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 uuid from unittest.mock import AsyncMock, MagicMock import pytest diff --git a/tests/test_models.py b/tests/test_models.py index 5a61d2eafd..a0fa052527 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 uuid async 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 uuid async 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_user from tests.test_team import new_team - import uuid + from litellm._uuid import uuid async with aiohttp.ClientSession() as session: # Creat a user diff --git a/tests/test_openai_endpoints.py b/tests/test_openai_endpoints.py index c90fd91a5d..fd997ebb71 100644 --- a/tests/test_openai_endpoints.py +++ b/tests/test_openai_endpoints.py @@ -5,7 +5,7 @@ import asyncio import aiohttp, openai from openai import OpenAI, AsyncOpenAI, AzureOpenAI, AsyncAzureOpenAI from typing import Optional, List, Union -import uuid +from litellm._uuid import uuid LITELLM_MASTER_KEY = "sk-1234" diff --git a/tests/test_team_logging.py b/tests/test_team_logging.py index 516b6fa13b..913b1e1949 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.py index d8981f84a6..a3d64eae80 100644 --- a/tests/test_team_members.py +++ b/tests/test_team_members.py @@ -3,7 +3,7 @@ import requests import time from typing import Dict, List import logging -import uuid +from litellm._uuid import uuid # Configure logging logging.basicConfig(level=logging.INFO) diff --git a/tests/test_users.py b/tests/test_users.py index 08cbf9f103..9b8eca789b 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 uuid import pytest import aiohttp from typing import Dict, Tuple diff --git a/tests/vector_store_tests/base_vector_store_test.py b/tests/vector_store_tests/base_vector_store_test.py index d3b58d8338..414b5ee333 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 sys from typing import Any, Dict, List from unittest.mock import MagicMock, Mock, patch import os -import uuid +from litellm._uuid import uuid import time import base64