---
title: deleteAll()
framework: coreai
role: symbol
role_heading: Instance Method
path: coreai/aimodelcache/deleteall()
---

# deleteAll()

Deletes all entries in the cache for the current build version.

## Declaration

```swift
final func deleteAll() throws
```

## Mentioned in

Managing model specialization and caching

## Discussion

Discussion Use this method to reclaim storage when the app no longer needs any of its specialized models, or to reset the cache during testing. note: For each entry, if no AIModel instance currently references it, deletion happens immediately. Otherwise, the system deletes the entry when the last AIModel releases it.
