isAnyModelInstalled method

  1. @override
Future<bool> isAnyModelInstalled(
  1. ModelManagementType type
)
override

Checks if any model is installed

Phase 5.5: Delegates to Modern API (ModelRepository) instead of checking _installedModels map.

Implementation

@override
Future<bool> isAnyModelInstalled(ModelManagementType type) async {
  await _ensureInitialized();

  // Phase 5: Delegate to Modern API
  final registry = ServiceRegistry.instance;
  final repository = registry.modelRepository;

  // Get all installed models from repository
  final allInstalled = await repository.listInstalled();

  if (type == ModelManagementType.inference) {
    return allInstalled.any((m) => m.type == repo.ModelType.inference);
  } else {
    return allInstalled.any((m) => m.type == repo.ModelType.embedding);
  }
}