LanguageModel
protocol · iOS 27.0+ · SDK 27.1
protocol LanguageModel : SendableA protocol that you use to interface with a model. Implement this protocol to create a bridge between a model and the framework. The protocol describes the capabilities and the configuration for your model. An ``Executor`` does the work of translating framework types into the types your platform expects, and streams results back through ``LanguageModelExecutorGenerationChannel``. Because most of the work is done in the executor, keep the type that adopts this protocol intentionally light. When your implementation is ready to adopt, distribute your solution with Swift Package Manager so developers can easily integrate it into their project. After they add your package, they simply initialize a ``LanguageModelSession`` with your model: ```swift // Initialize a session with a custom server model. let session = LanguageModelSession(model: MyCustomServerLanguageModel()) // Use the same API surface to prompt the model. let response = try await session.respond(to: "Tell me a joke!") ```
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
No declarations were skipped in this snapshot.