---
title: AIModelCache.Policy
framework: coreai
role: symbol
role_heading: Structure
path: coreai/aimodelcache/policy
---

# AIModelCache.Policy

A policy that controls when the system purges specialized assets from a cache.

## Declaration

```swift
struct Policy
```

## Mentioned in

Managing model specialization and caching

## Overview

Overview Defines the conditions under which the system may purge specialized assets in an AIModelCache. note: Regardless of policy, the system always purges assets when the OS updates, as specialized assets are OS-version specific.

## Topics

### Structures

- [AIModelCache.Policy.PurgeConditions](coreai/aimodelcache/policy/purgeconditions-swift.struct.md)

### Initializers

- [init(purgeConditions:)](coreai/aimodelcache/policy/init(purgeconditions:).md)

### Instance Properties

- [purgeConditions](coreai/aimodelcache/policy/purgeconditions-swift.property.md)

### Type Properties

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

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
