<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Speech",
  "identifier" : "/documentation/Speech/SFSpeechLanguageModel/prepareCustomLanguageModel(for:configuration:ignoresCache:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "c:objc(cs)SFSpeechLanguageModel(cm)prepareCustomLanguageModelForUrl:configuration:ignoresCache:completion:"
  },
  "title" : "prepareCustomLanguageModel(for:configuration:ignoresCache:completion:)"
}
-->

# prepareCustomLanguageModel(for:configuration:ignoresCache:completion:)

Creates a language model from custom training data.

```
class func prepareCustomLanguageModel(for asset: URL, configuration: SFSpeechLanguageModel.Configuration, ignoresCache: Bool, completion: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`asset`

The URL of a file containing custom training data. Create this file with [`export(to:)`](/documentation/Speech/SFCustomLanguageModelData/export(to:)).

`configuration`

An object listing the URLs at which this method should create the language model and compiled vocabulary from the training data.

`ignoresCache`

If `true`, the language model identified by the configuration will be recreated even if the `asset` file is unchanged.

`completion`

Called when the language model has been created.

---

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)