mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-23 20:26:28 +00:00
[Bug Fix] No module named 'diskcache' (#11600)
* (build) show clear error when disk cache does not exist * docs disk cache * add caching to pyproject
This commit is contained in:
@@ -236,10 +236,10 @@ response2 = completion(
|
||||
|
||||
### Quick Start
|
||||
|
||||
Install diskcache:
|
||||
Install the disk caching extra:
|
||||
|
||||
```shell
|
||||
pip install diskcache
|
||||
pip install "litellm[caching]"
|
||||
```
|
||||
|
||||
Then you can use the disk cache as follows.
|
||||
|
||||
@@ -13,7 +13,12 @@ else:
|
||||
|
||||
class DiskCache(BaseCache):
|
||||
def __init__(self, disk_cache_dir: Optional[str] = None):
|
||||
import diskcache as dc
|
||||
try:
|
||||
import diskcache as dc
|
||||
except ModuleNotFoundError as e:
|
||||
raise ModuleNotFoundError(
|
||||
"Please install litellm with `litellm[caching]` to use disk caching."
|
||||
) from e
|
||||
|
||||
# if users don't provider one, use the default litellm cache
|
||||
if disk_cache_dir is None:
|
||||
|
||||
@@ -4153,6 +4153,32 @@
|
||||
"supports_assistant_prefill": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-medium-2506": {
|
||||
"max_tokens": 40000,
|
||||
"max_input_tokens": 40000,
|
||||
"max_output_tokens": 40000,
|
||||
"input_cost_per_token": 2e-06,
|
||||
"output_cost_per_token": 5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
"mode": "chat",
|
||||
"source": "https://mistral.ai/news/magistral",
|
||||
"supports_function_calling": true,
|
||||
"supports_assistant_prefill": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-small-2506": {
|
||||
"max_tokens": 40000,
|
||||
"max_input_tokens": 40000,
|
||||
"max_output_tokens": 40000,
|
||||
"input_cost_per_token": 0.0,
|
||||
"output_cost_per_token": 0.0,
|
||||
"litellm_provider": "mistral",
|
||||
"mode": "chat",
|
||||
"source": "https://mistral.ai/news/magistral",
|
||||
"supports_function_calling": true,
|
||||
"supports_assistant_prefill": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-embed": {
|
||||
"max_tokens": 8192,
|
||||
"max_input_tokens": 8192,
|
||||
|
||||
Generated
+335
-45
File diff suppressed because it is too large
Load Diff
@@ -59,6 +59,7 @@ mcp = {version = "1.5.0", optional = true, python = ">=3.10"}
|
||||
litellm-proxy-extras = {version = "0.2.3", optional = true}
|
||||
rich = {version = "13.7.1", optional = true}
|
||||
litellm-enterprise = {version = "0.1.7", optional = true}
|
||||
diskcache = {version = "^5.6.1", optional = true}
|
||||
|
||||
[tool.poetry.extras]
|
||||
proxy = [
|
||||
@@ -97,6 +98,8 @@ utils = [
|
||||
"numpydoc",
|
||||
]
|
||||
|
||||
caching = ["diskcache"]
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user