Foundry-Local icon indicating copy to clipboard operation
Foundry-Local copied to clipboard

Rust SDK example is clearing the model cache

Open thombles opened this issue 4 months ago • 1 comments

Potentially related to #152 . Installed via winget on Win11:

> foundry --version
0.6.87+e69a6c3d2b

If I start a chat like so:

> foundry model run qwen2.5-0.5b
Downloading qwen2.5-0.5b-instruct-generic-cpu...
[####################################] 100.00 % [Time remaining: about 0s]        19.8 MB/s
🕕 Loading model...
🟢 Model qwen2.5-0.5b-instruct-generic-cpu loaded successfully

Interactive Chat. Enter /? or /help for help.

Interactive mode, please enter your prompt
> 

...then exit, I can see the model cached:

> foundry cache list
Models cached on device:
   Alias                         Model ID
💾 qwen2.5-0.5b                  qwen2.5-0.5b-instruct-generic-cpu

If I then run the Rust inference example.

  1. The Rust program appears to download the model from scratch
  2. My cache shows as empty, even though the model has been downloaded twice
> foundry cache list
No models cached on device

Curiously, if I now run the Rust program again:

  • The model appears to be cached somewhere (though not visible in the CLI)
  • It is nonetheless doing non-trivial network work outside of downloading the model - I see a progress bar for a few seconds and a spike of network activity in Task Manager, though much shorter than downloading the model.

Expected behaviour

  • Rust SDK picks up the cached model
  • Model remains in foundry cache list
  • Ideally the Rust program doesn't trigger internet traffic if the model is already cached?

AB#74038

thombles avatar Aug 07 '25 02:08 thombles

Thanks for raising this @thombles. We have reproduced the issue. The model is still in the cache. You can check by running foundry cache location and checking there but foundry cache ls does not list the model. We will continue to investigate

natke avatar Aug 12 '25 22:08 natke