<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/LanguageModelCapabilities",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels25LanguageModelCapabilitiesV"
  },
  "title" : "LanguageModelCapabilities"
}
-->

# LanguageModelCapabilities

A set of capabilities that a language model provides.

```
struct LanguageModelCapabilities
```

## Overview

Use this to declare what your model can do, like tool calling and guided
generation:

```swift
struct MyLanguageModel: LanguageModel {
    var capabilities: LanguageModelCapabilities {
        LanguageModelCapabilities([
            .toolCalling,
            .guidedGeneration,
            .reasoning
        ])
    }
}
```

Inspect [`capabilities`](/documentation/FoundationModels/LanguageModel/capabilities) ahead of time to detect what
the model supports before performing the request:

```swift
// Before prompting the model with a generable type, check whether it
// supports guided generation.
if selectedModel.capabilities.contains(.guidedGeneration) {
    let response = try await session.respond(to: "...", generating: MySchema.self)
}
```

When a model doesn’t support a capability, the framework can refuse to dispatch
incompatible requests to the executor and throw an
[`LanguageModelError.unsupportedCapability(_:)`](/documentation/FoundationModels/LanguageModelError/unsupportedCapability(_:)) error instead.

## Topics

### Creating an instance

[`init([LanguageModelCapabilities.Capability])`](/documentation/FoundationModels/LanguageModelCapabilities/init(_:))

Creates a capabilities instance from a list of supported capabilities.

[`struct Capability`](/documentation/FoundationModels/LanguageModelCapabilities/Capability)

A capability that a given language model may or may not have.

### Inspecting model capabilities

[`func contains(LanguageModelCapabilities.Capability) -> Bool`](/documentation/FoundationModels/LanguageModelCapabilities/contains(_:))

Returns a Boolean value that indicates whether the specified capability is supported.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)