<!-- llms-explorer concept facts · https://llms-explorer.com/tree/dynamic-profiles-historytransform/ · pack 2026-10-05 · ~871 tokens -->

# Dynamic Profiles historyTransform

> Apple's DynamicProfile page says historyTransform performs stateless transcript transforms that change the transcript sent to the model but not the global transcript state.

Parent: [Mac local LLMs: Apple Foundation Models and Core AI](https://llms-explorer.com/tree/mac-local-llms-apple-foundation-models-and-core-ai/) · 1 facets · 12 facts · page: https://llms-explorer.com/tree/dynamic-profiles-historytransform/

## Facts

- Apple's DynamicProfile page says historyTransform performs stateless transcript transforms that change the transcript sent to the model but not the global transcript state. — [source](https://developer.apple.com/documentation/foundationmodels/languagemodelsession/dynamicprofile)
- Apple's documented example keeps only the last twenty entries: `.historyTransform { history in Array(history.suffix(20)) }`. — [source](https://developer.apple.com/documentation/foundationmodels/languagemodelsession/dynamicprofile)
- A DynamicProfile body must resolve to a single active Profile; the profile-level modifiers include model, temperature, samplingMode, reasoningLevel, maximumResponseTokens, historyTransform and onResponse. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- Modifier precedence runs: call-site GenerationOptions passed to respond(to:options:), then the modifier closest to the Profile declaration, then outer modifiers. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- Call-site GenerationOptions override only matching generation values and never replace the profile's model, historyTransform or lifecycle callbacks. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- Precedence resolves only conflicts: a historyTransform or maximumResponseTokens with no competing value in the chain applies regardless of modifier order. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- If a profile and an outer modifier both register onResponse, the framework runs both callbacks. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- Reaching maximumResponseTokens stops generation without throwing, which can leave an incomplete sentence or malformed structured output. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- Appending to a transcript usually preserves the KV cache, while removing entries, changing tools or swapping instructions can invalidate it. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- The on-device context window is smaller than Private Cloud Compute's and can be read at runtime from SystemLanguageModel.default.contextSize. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- Switching between a remote and the on-device model stops either model reusing the other's cache. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
- A sensible tool-heavy pattern is to drop completed tool interactions as whole units first, then apply a rolling window. — [source](https://artemnovichkov.com/blog/building-a-custom-dynamic-profile-modifier-in-foundation-models)
