---
title: AIModelCache
framework: coreai
role: symbol
role_heading: Class
path: coreai/aimodelcache
---

# AIModelCache

A cache that stores the specialized model artifacts for inference.

## Declaration

```swift
final class AIModelCache
```

## Overview

Overview The cache holds the optimized, device-specific artifacts that AIModel loads to execute its inference functions. Each cache entry contains a specialized asset formed from a specific .aimodel or .aimodelc and SpecializationOptions combination.

## Topics

### Structures

- [AIModelCache.Policy](coreai/aimodelcache/policy.md)

### Initializers

- [init(appGroup:)](coreai/aimodelcache/init(appgroup:).md)

### Instance Methods

- [deleteAll()](coreai/aimodelcache/deleteall().md)
- [deleteEntries(for:)](coreai/aimodelcache/deleteentries(for:).md)
- [deleteEntry(for:options:)](coreai/aimodelcache/deleteentry(for:options:).md)
- [model(for:options:)](coreai/aimodelcache/model(for:options:).md)

### Type Properties

- [default](coreai/aimodelcache/default.md)

### Type Methods

- [deleteEntry(referencedBy:)](coreai/aimodelcache/deleteentry(referencedby:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Configuration

- [Managing model specialization and caching](coreai/managing-model-specialization-and-caching.md)
- [Compiling Core AI models ahead of time](coreai/compiling-core-ai-models-ahead-of-time.md)
- [ComputeUnitKind](coreai/computeunitkind.md)
- [SpecializationOptions](coreai/specializationoptions.md)
