ModelCachePath

ModelCachePath is the folder where the engine stores downloaded model files. First-run downloads from Hugging Face (or the Aspose catalog) land here; subsequent runs load from this cache.

Quick reference

Type string?
Default <LocalAppData>/Aspose.LLM/models
Category Engine
Field on EngineParameters.ModelCachePath

What it does

  • On Windows: %LOCALAPPDATA%\Aspose.LLM\models.
  • On Linux / macOS: the equivalent Environment.SpecialFolder.LocalApplicationData path, joined with Aspose.LLM/models.
  • Overriding sets a custom directory.

At each AsposeLLMApi.Create, the engine checks this folder for the preset’s model file. If present, load. If absent, download from the resolved source (BaseModelSourceParameters), save into this folder, and load.

When to change it

Scenario Value
Default null or unset
Shared cache across multiple applications /srv/aspose-llm/models (or equivalent)
Faster storage (SSD when LocalAppData is on HDD) Path to SSD folder
Docker / container with mounted volume /models (volume mount)
Pre-populated offline deployment Path to the pre-populated cache

Example

var preset = new Qwen25Preset();
preset.EngineParameters.ModelCachePath = @"D:\models";
// Large models will land on drive D instead of C.

using var api = AsposeLLMApi.Create(preset);

Container pattern:

preset.EngineParameters.ModelCachePath = "/models";  // Docker volume mount

Interactions

What’s next