llmasajudge 0.1.12__py3-none-any.whl → 0.1.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llmasajudge/__init__.py +14 -6
- {llmasajudge-0.1.12.dist-info → llmasajudge-0.1.13.dist-info}/METADATA +1 -1
- llmasajudge-0.1.13.dist-info/RECORD +5 -0
- llmasajudge-0.1.12.dist-info/RECORD +0 -5
- {llmasajudge-0.1.12.dist-info → llmasajudge-0.1.13.dist-info}/WHEEL +0 -0
- {llmasajudge-0.1.12.dist-info → llmasajudge-0.1.13.dist-info}/top_level.txt +0 -0
llmasajudge/__init__.py
CHANGED
|
@@ -574,6 +574,7 @@ Output only the number. No explanation. No extra text.""",
|
|
|
574
574
|
backoff_max: float = 4.0,
|
|
575
575
|
custom_generation_fns: Optional[List[Callable[[str], str]]] = None,
|
|
576
576
|
mode: str = "majority",
|
|
577
|
+
use_cache: bool = False,
|
|
577
578
|
litellm_cache_dir: Optional[str] = None,
|
|
578
579
|
cache_size_gb: Optional[float] = None,
|
|
579
580
|
):
|
|
@@ -636,13 +637,20 @@ Output only the number. No explanation. No extra text.""",
|
|
|
636
637
|
)
|
|
637
638
|
|
|
638
639
|
# optional local cache setup
|
|
639
|
-
|
|
640
|
+
# Enable cache if use_cache=True OR if litellm_cache_dir is explicitly provided (backward compatible)
|
|
641
|
+
self.cache_enabled = use_cache or (litellm_cache_dir is not None)
|
|
640
642
|
if self.cache_enabled:
|
|
641
|
-
#
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
643
|
+
# Only set up cache if it hasn't been set up already
|
|
644
|
+
if litellm.cache is None:
|
|
645
|
+
# Set default cache directory if not specified
|
|
646
|
+
if litellm_cache_dir is None:
|
|
647
|
+
litellm_cache_dir = ".litellm_cache"
|
|
648
|
+
|
|
649
|
+
# Convert GB to bytes if specified, otherwise unlimited
|
|
650
|
+
size_limit_bytes = None if cache_size_gb is None else int(cache_size_gb * 1024 * 1024 * 1024)
|
|
651
|
+
cache_backend = UnlimitedDiskCache(litellm_cache_dir, size_limit=size_limit_bytes)
|
|
652
|
+
litellm.cache = Cache(disk_cache_dir=litellm_cache_dir)
|
|
653
|
+
litellm.cache.cache = cache_backend
|
|
646
654
|
|
|
647
655
|
|
|
648
656
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
llmasajudge/__init__.py,sha256=u_92YWEEMEPnAxb_uyUiOsn7tkD5x2Z4_ZlAihT9STY,32405
|
|
2
|
+
llmasajudge-0.1.13.dist-info/METADATA,sha256=uuYRR5rYdvvEF8Pcx3Qheo58l3CXgIWzOzC7om6uCbQ,515
|
|
3
|
+
llmasajudge-0.1.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
+
llmasajudge-0.1.13.dist-info/top_level.txt,sha256=rRaIpM1llpEqahR9flT3RjpZHi2o16iOgnGYJ8cO4_0,12
|
|
5
|
+
llmasajudge-0.1.13.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
llmasajudge/__init__.py,sha256=cXxvx3shu0h40u1jXb-MqB0-mzkX1FWZElXnzBOE070,31957
|
|
2
|
-
llmasajudge-0.1.12.dist-info/METADATA,sha256=efGYG1GCWizmcRoXS3zLEzdvQqqPB8JIRy_tlDOqpfM,515
|
|
3
|
-
llmasajudge-0.1.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
-
llmasajudge-0.1.12.dist-info/top_level.txt,sha256=rRaIpM1llpEqahR9flT3RjpZHi2o16iOgnGYJ8cO4_0,12
|
|
5
|
-
llmasajudge-0.1.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|