https://promptfoo.dev/ logo
Is there a way to clear cache from the web viewer?
# ❓|questions
c
I can run
npx promptfoo cache clear
via the CLI, however is there a way to do the equivalent from the web viewer? Also, is there a way to set a flag like
cache_results: false
in the config file? I'm having a hard time finding it in the docs if so. Thanks!
i
There isn't a way to clear cache via web viewer right now, unfortunately. To disable cache in the yaml:
Copy code
yaml
evaluateOptions:
  cache: false
c
I tried to disable the cache in the yaml file specified in the web viewer but that didn't seem to work. Should it have? i.e. see photo attached https://cdn.discordapp.com/attachments/1243279129533616290/1245175313164402789/Screenshot_2024-05-28_at_5.41.31_PM.png?ex=6657cb60&is=665679e0&hm=97fc33f62ac1e5a7b1390cd53ae3135ba2594d3286d457a4ca125f8dd5019ef5&
Even running promptfoo with a yaml file not in the webviewer, but specifying that
cache: false
value, it still caches the results
i
look like a yaml syntax issue.
- maxConcurrency
should just be
maxConcurrency
when you add
-
you make it a list item
c
Hmm it's still caching the results for me:
Copy code
description: 'Segmenter'

prompts:
- " "

providers:
- id: 'python:call_segmenter.py'
  label: 'Staging'
  config:
    env: 'staging'
- id: 'python:call_segmenter.py'
  label: 'Production'
  config:
    env: 'production'

tests: segmenter_tests.yaml

evaluateOptions:
  maxConcurrency: 2
  delay: 500
  showProgressBar: true
  cache: false
Both when running via CLI when specifying that config in the web viewer
i
hmm, try moving it to the top level:
Copy code
cache: false
c
same behaviour:
Copy code
description: 'Segmenter'

prompts:
- " "

providers:
- id: 'python:provider.py'
  label: 'Staging'
  config:
    env: 'staging'
- id: 'python:provider.py'
  label: 'Production'
  config:
    env: 'production'

tests: tests.yaml
cache: false
evaluateOptions:
  maxConcurrency: 2
  delay: 500
  showProgressBar: true
it caches the results when running with CLI. on the webviewer, it doesnt even persist that change in the yaml after saving
i
oh yeah. It's good that it works on the CLI, the web viewer may not support cache at this time
that can be fixed..
c
Oh I meant it does cache via the CLI, even when specifying
cache: false
in the config. I don't know if that's intended though, basically should yaml config supercede CLI args. I would vote yes