isModelOnDisk method

Future<bool> isModelOnDisk(
  1. SyniModelSpec spec
)

Whether the GGUF model + its sibling tokenizer.json are already on disk for the given spec. Used by the cold-start restore path so the screen can skip the download UX when nothing actually needs downloading.

Implementation

Future<bool> isModelOnDisk(SyniModelSpec spec) async {
  final dir = await _modelsDir();
  final modelFile = File('${dir.path}/${spec.filename}');
  final tokenizerFile = File('${dir.path}/tokenizer.json');
  return modelFile.existsSync() && tokenizerFile.existsSync();
}