What a language model session is
Asked on 2026-06-18
1 search
A language model session in the Foundation Models framework is the object you use to interact with the model in a stateful way.
In practice, that means:
- You create a session to send prompts to the model.
- The session remembers the conversation history in a transcript.
- Each response is recorded, so the model can refer back to earlier turns.
- You can also provide instructions to shape how the session behaves.
- Sessions have context size limits, so they can’t grow indefinitely.
In newer WWDC sessions, this is described as the main interaction surface for developers, with the model behind the scenes handling generation while the session keeps track of the conversation.
If you want, I can also explain:
- how a session differs from a prompt,
- what a transcript is,
- or how sessions work with Dynamic Profile and multiple models.

Bring an LLM provider to the Foundation Models framework
Extend the Foundation Models framework by implementing a LanguageModelExecutor for new models. Explore how to interface with the LanguageModelSession’s transcript, manage session state effectively, and optimize KV cache utilization. Find out how to support custom segment types and unlock advanced capabilities for your generative AI features.

Deep dive into the Foundation Models framework
Level up with the Foundation Models framework. Learn how guided generation works under the hood, and use guides, regexes, and generation schemas to get custom structured responses. We’ll show you how to use tool calling to let the model autonomously access external information and perform actions, for a personalized experience. To get the most out of this video, we recommend first watching “Meet the Foundation Models framework”.

Create robust evaluations for agentic apps
Learn how to leverage advanced features of the Evaluations framework to build robust evaluations for your app. Explore evaluating flows with tool calling and dynamic conditions, and how to define what correct behavior means for your use case. Discover how to generate synthetic data, use judges effectively, and validate your datasets for reliable results.
