---
title: "LanguageModelError.contextSizeExceeded(_:)"
framework: foundationmodels
role: symbol
role_heading: Case
path: "foundationmodels/languagemodelerror/contextsizeexceeded(_:)"
---

# LanguageModelError.contextSizeExceeded(_:)

The session’s transcript exceeded the model’s context size.

## Declaration

```swift
case contextSizeExceeded(LanguageModelError.ContextSizeExceeded)
```

## Mentioned in

Managing the context window Analyzing the runtime performance of your Foundation Models app Generating content and performing tasks with Foundation Models Optimizing key-value caching in language model sessions

## Discussion

Discussion You can recover from this error by removing entries from the transcript and trying again. For more information on managing the context window size, see Managing the context window.

## See Also

### Exceeded context size error

- [LanguageModelError.ContextSizeExceeded](foundationmodels/languagemodelerror/contextsizeexceeded.md)
