setSessionCacheDir static method

bool setSessionCacheDir(
  1. String dir
)

Where the runtime keeps its on-disk KV cache (the prefilled prompt prefix, restored at the next model load so the first turn after a cold start skips re-reading it). Process-wide; read at model load. An empty string turns the cache off. Returns false when the runtime lacks the feature.

Implementation

static bool setSessionCacheDir(String dir) {
  initialize();
  final f = _setSessionCacheDir;
  if (f == null) return false;
  final p = dir.toNativeUtf8();
  try {
    f(p);
  } finally {
    malloc.free(p);
  }
  return true;
}