diff --git a/litellm/caching.py b/litellm/caching.py index 63e2cd39a..6906a1a98 100644 --- a/litellm/caching.py +++ b/litellm/caching.py @@ -15,7 +15,6 @@ from openai._models import BaseModel as OpenAIObject from litellm._logging import verbose_logger from litellm.types.services import ServiceLoggerPayload, ServiceTypes import traceback -import diskcache as dc def print_verbose(print_statement): @@ -1919,6 +1918,7 @@ class Cache: class DiskCache(BaseCache): def __init__(self, cache_dir: str = ".litellm_cache"): + import diskcache as dc # if users don't provider one, use the default litellm cache self.disk_cache = dc.Cache(cache_dir) diff --git a/poetry.lock b/poetry.lock index 0c1b26a9a..2911806cb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2679,11 +2679,11 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.link testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [extras] -extra-cache = ["diskcache"] +disk-caching = ["diskcache"] extra-proxy = ["azure-identity", "azure-keyvault-secrets", "google-cloud-kms", "prisma", "resend"] proxy = ["PyJWT", "apscheduler", "backoff", "cryptography", "fastapi", "fastapi-sso", "gunicorn", "orjson", "python-multipart", "pyyaml", "rq", "uvicorn"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0, !=3.9.7" -content-hash = "a21a41c1f683d7cb9a07fa76ee396b7da95cebf8c82d44de92e318916436a506" +content-hash = "aa6283846b24f5703626c2de10459254166551f469c34e75b229adafb6985eba" diff --git a/pyproject.toml b/pyproject.toml index 486a04f3c..ca01141d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ extra_proxy = [ "resend" ] -extra_cache = [ +disk_caching = [ "diskcache" ]