keepAlive method
Sets how long to keep the model loaded in memory
Controls how long the model stays loaded after the last request. Keeping models loaded reduces startup time for subsequent requests.
- "5m": Keep loaded for 5 minutes
- "1h": Keep loaded for 1 hour
- "0": Unload immediately after use
- "-1": Keep loaded indefinitely
Examples: "30s", "5m", "1h", "24h"
Implementation
OllamaBuilder keepAlive(String duration) {
_baseBuilder.extension('keepAlive', duration);
return this;
}