You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/faqs.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,13 +85,23 @@ Open source libraries such as [RAGautouille](https://github.com/bclavie/ragatoui
85
85
86
86
-**How do I turn off the cache? How do I export the cache?**
87
87
88
-
You can turn off the cache by setting the [`DSP_CACHEBOOL`](https://github.com/stanfordnlp/dspy/blob/main/dsp/modules/cache_utils.py#L9) environment variable to `False`, which disables the `cache_turn_on` flag.
88
+
From v2.5, you can turn off the cache by setting `cache` parameter in `dspy.LM` to `False`:
89
+
90
+
```python
91
+
dspy.LM('openai/gpt-4o-mini', cache=False)
92
+
```
89
93
90
94
Your local cache will be saved to the global env directory `os.environ["DSP_CACHEDIR"]` or for notebooks `os.environ["DSP_NOTEBOOK_CACHEDIR"]`. You can usually set the cachedir to `os.path.join(repo_path, 'cache')` and export this cache from here:
`DSP_CACHEDIR` is responsible for old clients (including dspy.OpenAI, dspy.ColBERTv2, etc.) and `DSPY_CACHEDIR` is responsible for the new dspy.LM client.
101
+
:::
102
+
103
+
In the AWS lambda deployment, you should disable both DSP_* and DSPY_*.
0 commit comments