<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAI",
  "identifier" : "/documentation/CoreAI/AIModelCache/deleteAll()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core AI",
      "CoreAI"
    ],
    "preciseIdentifier" : "s:15CoreAIDelegates12AIModelCacheC9deleteAllyyKF"
  },
  "title" : "deleteAll()"
}
-->

# deleteAll()

Deletes all entries in the cache.

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

## 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 ``doc://com.apple.coreai/documentation/CoreAI/AIModel`` instance currently references it, deletion happens
> immediately. Otherwise, an error is thrown. Deletion can only occur for an entry when the last ``doc://com.apple.coreai/documentation/CoreAI/AIModel`` releases it.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)