Skip to content

Commit d403737

Browse files
authored
Merge pull request #1602 from stanfordnlp/faq-docs-update
Update faq docs with new cache info
2 parents 43a67f8 + 75c7344 commit d403737

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/docs/faqs.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,23 @@ Open source libraries such as [RAGautouille](https://github.com/bclavie/ragatoui
8585

8686
- **How do I turn off the cache? How do I export the cache?**
8787

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+
```
8993

9094
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:
9195
```python
9296
os.environ["DSP_NOTEBOOK_CACHEDIR"] = os.path.join(os.getcwd(), 'cache')
9397
```
9498

99+
:::warning Important
100+
`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_*.
104+
95105

96106
## Advanced Usage
97107

0 commit comments

Comments
 (0)