Build Information
Successful build of mlx-libraries, reference main (dddb0b
), with Swift 6.1 for macOS (SPM) on 2 Sep 2025 19:54:13 UTC.
Swift 6 data race errors: 23
Build Command
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures
Build Log
692 | .compactMap {
693 | context.tokenizer.convertTokenToId($0)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:790:25: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
788 |
789 | // Launch a Task to perform iteration asynchronously.
790 | let task = Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
791 | var start = Date.timeIntervalSinceReferenceDate
792 | var promptTime: TimeInterval = 0
:
840 |
841 | let info = GenerateCompletionInfo(
842 | promptTokenCount: input.text.tokens.size,
| `- note: closure captures 'input' which is accessible to code in the current task
843 | generationTokenCount: tokenCount,
844 | promptTime: promptTime,
[233/238] Compiling MLXLMCommon ModelFactory.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelFactory.swift:125:12: warning: var 'defaultHubApi' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
123 |
124 | /// Default instance of HubApi to use. This is configured to save downloads into the caches directory.
125 | public var defaultHubApi: HubApi = {
| |- warning: var 'defaultHubApi' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultHubApi' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make var 'defaultHubApi' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
126 | HubApi(downloadBase: FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first)
127 | }()
[234/238] Compiling MLXLMCommon Gemma.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelFactory.swift:125:12: warning: var 'defaultHubApi' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
123 |
124 | /// Default instance of HubApi to use. This is configured to save downloads into the caches directory.
125 | public var defaultHubApi: HubApi = {
| |- warning: var 'defaultHubApi' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultHubApi' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make var 'defaultHubApi' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
126 | HubApi(downloadBase: FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first)
127 | }()
[235/238] Compiling MLXLMCommon Module+Extensions.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelFactory.swift:125:12: warning: var 'defaultHubApi' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
123 |
124 | /// Default instance of HubApi to use. This is configured to save downloads into the caches directory.
125 | public var defaultHubApi: HubApi = {
| |- warning: var 'defaultHubApi' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultHubApi' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make var 'defaultHubApi' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
126 | HubApi(downloadBase: FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first)
127 | }()
[236/238] Compiling MLXLMCommon Encodable+toolResult.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:767:17: warning: initialization of immutable value 'expectedStep' was never used; consider replacing with assignment to '_' or removing it
765 |
766 | // Validate that step, groupSize, and bits match current instance
767 | let expectedStep = Int(newValue[0]) ?? 256
| `- warning: initialization of immutable value 'expectedStep' was never used; consider replacing with assignment to '_' or removing it
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
769 | let expectedBits = Int(newValue[3]) ?? 8
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:768:17: warning: initialization of immutable value 'expectedGroupSize' was never used; consider replacing with assignment to '_' or removing it
766 | // Validate that step, groupSize, and bits match current instance
767 | let expectedStep = Int(newValue[0]) ?? 256
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
| `- warning: initialization of immutable value 'expectedGroupSize' was never used; consider replacing with assignment to '_' or removing it
769 | let expectedBits = Int(newValue[3]) ?? 8
770 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:769:17: warning: initialization of immutable value 'expectedBits' was never used; consider replacing with assignment to '_' or removing it
767 | let expectedStep = Int(newValue[0]) ?? 256
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
769 | let expectedBits = Int(newValue[3]) ?? 8
| `- warning: initialization of immutable value 'expectedBits' was never used; consider replacing with assignment to '_' or removing it
770 | }
771 | }
[237/238] Compiling MLXLMCommon KVCache.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:767:17: warning: initialization of immutable value 'expectedStep' was never used; consider replacing with assignment to '_' or removing it
765 |
766 | // Validate that step, groupSize, and bits match current instance
767 | let expectedStep = Int(newValue[0]) ?? 256
| `- warning: initialization of immutable value 'expectedStep' was never used; consider replacing with assignment to '_' or removing it
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
769 | let expectedBits = Int(newValue[3]) ?? 8
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:768:17: warning: initialization of immutable value 'expectedGroupSize' was never used; consider replacing with assignment to '_' or removing it
766 | // Validate that step, groupSize, and bits match current instance
767 | let expectedStep = Int(newValue[0]) ?? 256
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
| `- warning: initialization of immutable value 'expectedGroupSize' was never used; consider replacing with assignment to '_' or removing it
769 | let expectedBits = Int(newValue[3]) ?? 8
770 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:769:17: warning: initialization of immutable value 'expectedBits' was never used; consider replacing with assignment to '_' or removing it
767 | let expectedStep = Int(newValue[0]) ?? 256
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
769 | let expectedBits = Int(newValue[3]) ?? 8
| `- warning: initialization of immutable value 'expectedBits' was never used; consider replacing with assignment to '_' or removing it
770 | }
771 | }
[238/238] Compiling MLXLMCommon LanguageModel.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:767:17: warning: initialization of immutable value 'expectedStep' was never used; consider replacing with assignment to '_' or removing it
765 |
766 | // Validate that step, groupSize, and bits match current instance
767 | let expectedStep = Int(newValue[0]) ?? 256
| `- warning: initialization of immutable value 'expectedStep' was never used; consider replacing with assignment to '_' or removing it
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
769 | let expectedBits = Int(newValue[3]) ?? 8
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:768:17: warning: initialization of immutable value 'expectedGroupSize' was never used; consider replacing with assignment to '_' or removing it
766 | // Validate that step, groupSize, and bits match current instance
767 | let expectedStep = Int(newValue[0]) ?? 256
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
| `- warning: initialization of immutable value 'expectedGroupSize' was never used; consider replacing with assignment to '_' or removing it
769 | let expectedBits = Int(newValue[3]) ?? 8
770 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/KVCache.swift:769:17: warning: initialization of immutable value 'expectedBits' was never used; consider replacing with assignment to '_' or removing it
767 | let expectedStep = Int(newValue[0]) ?? 256
768 | let expectedGroupSize = Int(newValue[2]) ?? 64
769 | let expectedBits = Int(newValue[3]) ?? 8
| `- warning: initialization of immutable value 'expectedBits' was never used; consider replacing with assignment to '_' or removing it
770 | }
771 | }
[239/269] Compiling MLXLLM Gemma.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Gemma3Text.swift:13:8: warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
11 | import MLX
12 | import MLXFast
13 | import MLXLLM
| `- warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
14 | import MLXLMCommon
15 | import MLXNN
[240/269] Compiling MLXLLM Gemma2.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Gemma3Text.swift:13:8: warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
11 | import MLX
12 | import MLXFast
13 | import MLXLLM
| `- warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
14 | import MLXLMCommon
15 | import MLXNN
[241/269] Compiling MLXLLM Gemma3Text.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Gemma3Text.swift:13:8: warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
11 | import MLX
12 | import MLXFast
13 | import MLXLLM
| `- warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
14 | import MLXLMCommon
15 | import MLXNN
[242/272] Compiling MLXLLM LLMModel.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:27:13: warning: variable 'state' was never mutated; consider changing to 'let' constant
25 | let prefillStepSize = windowSize ?? 512
26 | var y = input.text
27 | var state: LMOutput.State? = nil
| `- warning: variable 'state' was never mutated; consider changing to 'let' constant
28 |
29 | // prepare the prompt in chunks if larger than the prefill size
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:32:17: warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
30 | while y.tokens.size > prefillStepSize {
31 | let input = y[.newAxis, ..<prefillStepSize]
32 | let result = self(input, cache: cache.isEmpty ? nil : cache, state: state)
| `- warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
33 | eval(cache)
34 | y = y[prefillStepSize...]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:394:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
392 | /// configuration: LLMRegistry.llama3_8B_4bit)
393 | /// ```
394 | public class LLMModelFactory: ModelFactory {
| `- warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
395 |
396 | public init(typeRegistry: ModelTypeRegistry, modelRegistry: AbstractModelRegistry) {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:31:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
29 | private static func all() -> [String: @Sendable (URL) throws -> any LanguageModel] {
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:32:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:33:20: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:34:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:35:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:36:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:37:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:38:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:39:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:40:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:41:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:42:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:43:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:44:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:45:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:46:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:47:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:48:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:49:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:50:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:51:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:52:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:53:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:54:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:55:25: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:56:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:57:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:58:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
60 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:59:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
60 | ]
61 | }
[243/272] Compiling MLXLLM LLMModelFactory.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:27:13: warning: variable 'state' was never mutated; consider changing to 'let' constant
25 | let prefillStepSize = windowSize ?? 512
26 | var y = input.text
27 | var state: LMOutput.State? = nil
| `- warning: variable 'state' was never mutated; consider changing to 'let' constant
28 |
29 | // prepare the prompt in chunks if larger than the prefill size
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:32:17: warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
30 | while y.tokens.size > prefillStepSize {
31 | let input = y[.newAxis, ..<prefillStepSize]
32 | let result = self(input, cache: cache.isEmpty ? nil : cache, state: state)
| `- warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
33 | eval(cache)
34 | y = y[prefillStepSize...]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:394:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
392 | /// configuration: LLMRegistry.llama3_8B_4bit)
393 | /// ```
394 | public class LLMModelFactory: ModelFactory {
| `- warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
395 |
396 | public init(typeRegistry: ModelTypeRegistry, modelRegistry: AbstractModelRegistry) {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:31:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
29 | private static func all() -> [String: @Sendable (URL) throws -> any LanguageModel] {
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:32:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:33:20: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:34:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:35:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:36:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:37:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:38:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:39:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:40:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:41:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:42:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:43:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:44:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:45:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:46:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:47:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:48:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:49:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:50:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:51:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:52:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:53:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:54:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:55:25: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:56:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:57:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:58:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
60 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:59:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
60 | ]
61 | }
[244/272] Compiling MLXLLM Lora+Data.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:27:13: warning: variable 'state' was never mutated; consider changing to 'let' constant
25 | let prefillStepSize = windowSize ?? 512
26 | var y = input.text
27 | var state: LMOutput.State? = nil
| `- warning: variable 'state' was never mutated; consider changing to 'let' constant
28 |
29 | // prepare the prompt in chunks if larger than the prefill size
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:32:17: warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
30 | while y.tokens.size > prefillStepSize {
31 | let input = y[.newAxis, ..<prefillStepSize]
32 | let result = self(input, cache: cache.isEmpty ? nil : cache, state: state)
| `- warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
33 | eval(cache)
34 | y = y[prefillStepSize...]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:394:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
392 | /// configuration: LLMRegistry.llama3_8B_4bit)
393 | /// ```
394 | public class LLMModelFactory: ModelFactory {
| `- warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
395 |
396 | public init(typeRegistry: ModelTypeRegistry, modelRegistry: AbstractModelRegistry) {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:31:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
29 | private static func all() -> [String: @Sendable (URL) throws -> any LanguageModel] {
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:32:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:33:20: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:34:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:35:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:36:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:37:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:38:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:39:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:40:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:41:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:42:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:43:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:44:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:45:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:46:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:47:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:48:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:49:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:50:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:51:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:52:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:53:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:54:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:55:25: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:56:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:57:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:58:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
60 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:59:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
60 | ]
61 | }
[245/272] Compiling MLXLLM LoraTrain.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:27:13: warning: variable 'state' was never mutated; consider changing to 'let' constant
25 | let prefillStepSize = windowSize ?? 512
26 | var y = input.text
27 | var state: LMOutput.State? = nil
| `- warning: variable 'state' was never mutated; consider changing to 'let' constant
28 |
29 | // prepare the prompt in chunks if larger than the prefill size
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModel.swift:32:17: warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
30 | while y.tokens.size > prefillStepSize {
31 | let input = y[.newAxis, ..<prefillStepSize]
32 | let result = self(input, cache: cache.isEmpty ? nil : cache, state: state)
| `- warning: initialization of immutable value 'result' was never used; consider replacing with assignment to '_' or removing it
33 | eval(cache)
34 | y = y[prefillStepSize...]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:394:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
392 | /// configuration: LLMRegistry.llama3_8B_4bit)
393 | /// ```
394 | public class LLMModelFactory: ModelFactory {
| `- warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
395 |
396 | public init(typeRegistry: ModelTypeRegistry, modelRegistry: AbstractModelRegistry) {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:31:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
29 | private static func all() -> [String: @Sendable (URL) throws -> any LanguageModel] {
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:32:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
30 | [
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:33:20: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
31 | "mistral": create(LlamaConfiguration.self, LlamaModel.init),
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:34:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
32 | "llama": create(LlamaConfiguration.self, LlamaModel.init),
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:35:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
33 | "phi": create(PhiConfiguration.self, PhiModel.init),
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:36:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
34 | "phi3": create(Phi3Configuration.self, Phi3Model.init),
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:37:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
35 | "phimoe": create(PhiMoEConfiguration.self, PhiMoEModel.init),
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:38:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
36 | "gemma": create(GemmaConfiguration.self, GemmaModel.init),
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:39:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:40:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "gemma3": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:41:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "gemma3_text": create(Gemma3TextConfiguration.self, Gemma3TextModel.init),
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:42:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "gemma3n": create(Gemma3nTextConfiguration.self, Gemma3nTextModel.init),
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:43:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:44:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:45:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:46:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:47:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "cohere": create(CohereConfiguration.self, CohereModel.init),
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:48:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:49:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:50:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | "deepseek_v3": create(DeepseekV3Configuration.self, DeepseekV3Model.init),
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:51:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
49 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:52:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
50 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:53:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
51 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:54:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
52 | "acereason": create(Qwen2Configuration.self, Qwen2Model.init),
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:55:25: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
53 | "bitnet": create(BitnetConfiguration.self, BitnetModel.init),
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:56:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
54 | "smollm3": create(SmolLM3Configuration.self, SmolLM3Model.init),
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:57:28: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
55 | "ernie4_5": create(Ernie45Configuration.self, Ernie45Model.init),
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:58:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
56 | "lfm2": create(LFM2Configuration.self, LFM2Model.init),
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
60 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:59:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
57 | "baichuan_m1": create(BaichuanM1Configuration.self, BaichuanM1Model.init),
58 | "exaone4": create(Exaone4Configuration.self, Exaone4Model.init),
59 | "gpt_oss": create(GPTOSSConfiguration.self, GPTOSSModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
60 | ]
61 | }
[246/272] Compiling MLXLLM OpenELM.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/OpenELM.swift:72:13: warning: variable 'values' was never mutated; consider changing to 'let' constant
70 | var queries = qkvSplit[0]
71 | var keys = qkvSplit[1]
72 | var values = qkvSplit[2]
| `- warning: variable 'values' was never mutated; consider changing to 'let' constant
73 |
74 | if let qNorm, let kNorm {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Phi3.swift:63:17: warning: immutable value 'shortFactor' was never used; consider replacing with '_' or removing it
61 | if let ropeScaling = args.ropeScaling,
62 | ropeScaling.type == "su" || ropeScaling.type == "longrope",
63 | let shortFactor = ropeScaling.shortFactor, let longFactor = ropeScaling.longFactor
| `- warning: immutable value 'shortFactor' was never used; consider replacing with '_' or removing it
64 | {
65 | self.rope = .suScaledRotaryEmbedding(
[247/272] Compiling MLXLLM Phi.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/OpenELM.swift:72:13: warning: variable 'values' was never mutated; consider changing to 'let' constant
70 | var queries = qkvSplit[0]
71 | var keys = qkvSplit[1]
72 | var values = qkvSplit[2]
| `- warning: variable 'values' was never mutated; consider changing to 'let' constant
73 |
74 | if let qNorm, let kNorm {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Phi3.swift:63:17: warning: immutable value 'shortFactor' was never used; consider replacing with '_' or removing it
61 | if let ropeScaling = args.ropeScaling,
62 | ropeScaling.type == "su" || ropeScaling.type == "longrope",
63 | let shortFactor = ropeScaling.shortFactor, let longFactor = ropeScaling.longFactor
| `- warning: immutable value 'shortFactor' was never used; consider replacing with '_' or removing it
64 | {
65 | self.rope = .suScaledRotaryEmbedding(
[248/272] Compiling MLXLLM Phi3.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/OpenELM.swift:72:13: warning: variable 'values' was never mutated; consider changing to 'let' constant
70 | var queries = qkvSplit[0]
71 | var keys = qkvSplit[1]
72 | var values = qkvSplit[2]
| `- warning: variable 'values' was never mutated; consider changing to 'let' constant
73 |
74 | if let qNorm, let kNorm {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Phi3.swift:63:17: warning: immutable value 'shortFactor' was never used; consider replacing with '_' or removing it
61 | if let ropeScaling = args.ropeScaling,
62 | ropeScaling.type == "su" || ropeScaling.type == "longrope",
63 | let shortFactor = ropeScaling.shortFactor, let longFactor = ropeScaling.longFactor
| `- warning: immutable value 'shortFactor' was never used; consider replacing with '_' or removing it
64 | {
65 | self.rope = .suScaledRotaryEmbedding(
[249/272] Emitting module MLXLLM
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:6:8: warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
4 | import MLX
5 | import MLXFast
6 | import MLXLLM
| `- warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
7 | import MLXLMCommon
8 | import MLXNN
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Gemma3Text.swift:13:8: warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
11 | import MLX
12 | import MLXFast
13 | import MLXLLM
| `- warning: file 'Gemma3Text.swift' is part of module 'MLXLLM'; ignoring import
14 | import MLXLMCommon
15 | import MLXNN
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:394:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
392 | /// configuration: LLMRegistry.llama3_8B_4bit)
393 | /// ```
394 | public class LLMModelFactory: ModelFactory {
| `- warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
395 |
396 | public init(typeRegistry: ModelTypeRegistry, modelRegistry: AbstractModelRegistry) {
[250/272] Compiling MLXLLM LFM2.swift
[251/272] Compiling MLXLLM Llama.swift
[252/272] Compiling MLXLLM MiMo.swift
[253/272] Compiling MLXLLM Ernie4_5.swift
[254/272] Compiling MLXLLM Exaone4.swift
[255/272] Compiling MLXLLM GLM4.swift
[256/272] Compiling MLXLLM GPTOSS.swift
[257/272] Compiling MLXLLM PhiMoE.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/PhiMoE.swift:90:13: warning: variable 'v' was never mutated; consider changing to 'let' constant
88 | var q = queries.reshaped(B, L, args.attentionHeads, -1).transposed(0, 2, 1, 3)
89 | var k = keys.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3)
90 | var v = values.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3)
| `- warning: variable 'v' was never mutated; consider changing to 'let' constant
91 |
92 | if let cache {
[258/272] Compiling MLXLLM Qwen2.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/PhiMoE.swift:90:13: warning: variable 'v' was never mutated; consider changing to 'let' constant
88 | var q = queries.reshaped(B, L, args.attentionHeads, -1).transposed(0, 2, 1, 3)
89 | var k = keys.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3)
90 | var v = values.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3)
| `- warning: variable 'v' was never mutated; consider changing to 'let' constant
91 |
92 | if let cache {
[259/272] Compiling MLXLLM Qwen3.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/PhiMoE.swift:90:13: warning: variable 'v' was never mutated; consider changing to 'let' constant
88 | var q = queries.reshaped(B, L, args.attentionHeads, -1).transposed(0, 2, 1, 3)
89 | var k = keys.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3)
90 | var v = values.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3)
| `- warning: variable 'v' was never mutated; consider changing to 'let' constant
91 |
92 | if let cache {
[260/272] Compiling MLXLLM Gemma3nText.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:124:13: warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
122 |
123 | public init(_ args: GraniteConfiguration) {
124 | let attentionHeads = args.attentionHeads
| `- warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
125 | let hiddenSize = args.hiddenSize
126 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:274:74: warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
272 | self.kvHeads = try container.decode(Int.self, forKey: .kvHeads)
273 | self.attentionBias = try container.decode(Bool.self, forKey: .attentionBias)
274 | self.mlpBias = try container.decode(Bool.self, forKey: .mlpBias) ?? false
| `- warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
275 | self.ropeTheta = try container.decodeIfPresent(Float.self, forKey: .ropeTheta) ?? 10000000.0
276 | self.ropeScaling = try container.decodeIfPresent(
[261/272] Compiling MLXLLM Granite.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:124:13: warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
122 |
123 | public init(_ args: GraniteConfiguration) {
124 | let attentionHeads = args.attentionHeads
| `- warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
125 | let hiddenSize = args.hiddenSize
126 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:274:74: warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
272 | self.kvHeads = try container.decode(Int.self, forKey: .kvHeads)
273 | self.attentionBias = try container.decode(Bool.self, forKey: .attentionBias)
274 | self.mlpBias = try container.decode(Bool.self, forKey: .mlpBias) ?? false
| `- warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
275 | self.ropeTheta = try container.decodeIfPresent(Float.self, forKey: .ropeTheta) ?? 10000000.0
276 | self.ropeScaling = try container.decodeIfPresent(
[262/272] Compiling MLXLLM Internlm2.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:124:13: warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
122 |
123 | public init(_ args: GraniteConfiguration) {
124 | let attentionHeads = args.attentionHeads
| `- warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
125 | let hiddenSize = args.hiddenSize
126 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:274:74: warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
272 | self.kvHeads = try container.decode(Int.self, forKey: .kvHeads)
273 | self.attentionBias = try container.decode(Bool.self, forKey: .attentionBias)
274 | self.mlpBias = try container.decode(Bool.self, forKey: .mlpBias) ?? false
| `- warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
275 | self.ropeTheta = try container.decodeIfPresent(Float.self, forKey: .ropeTheta) ?? 10000000.0
276 | self.ropeScaling = try container.decodeIfPresent(
[263/272] Compiling MLXLLM BaichuanM1.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:6:8: warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
4 | import MLX
5 | import MLXFast
6 | import MLXLLM
| `- warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
7 | import MLXLMCommon
8 | import MLXNN
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:357:27: warning: immutable value 'h' was never used; consider replacing with '_' or removing it
355 |
356 | func callAsFunction(_ x: MLXArray) -> (MLXArray, MLXArray) {
357 | let (bsz, seqLen, h) = (x.dim(0), x.dim(1), x.dim(2))
| `- warning: immutable value 'h' was never used; consider replacing with '_' or removing it
358 |
359 | let hiddenStates = x.matmul(weight.T)
[264/272] Compiling MLXLLM Bitnet.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:6:8: warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
4 | import MLX
5 | import MLXFast
6 | import MLXLLM
| `- warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
7 | import MLXLMCommon
8 | import MLXNN
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:357:27: warning: immutable value 'h' was never used; consider replacing with '_' or removing it
355 |
356 | func callAsFunction(_ x: MLXArray) -> (MLXArray, MLXArray) {
357 | let (bsz, seqLen, h) = (x.dim(0), x.dim(1), x.dim(2))
| `- warning: immutable value 'h' was never used; consider replacing with '_' or removing it
358 |
359 | let hiddenStates = x.matmul(weight.T)
[265/272] Compiling MLXLLM Cohere.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:6:8: warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
4 | import MLX
5 | import MLXFast
6 | import MLXLLM
| `- warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
7 | import MLXLMCommon
8 | import MLXNN
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:357:27: warning: immutable value 'h' was never used; consider replacing with '_' or removing it
355 |
356 | func callAsFunction(_ x: MLXArray) -> (MLXArray, MLXArray) {
357 | let (bsz, seqLen, h) = (x.dim(0), x.dim(1), x.dim(2))
| `- warning: immutable value 'h' was never used; consider replacing with '_' or removing it
358 |
359 | let hiddenStates = x.matmul(weight.T)
[266/272] Compiling MLXLLM DeepseekV3.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:6:8: warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
4 | import MLX
5 | import MLXFast
6 | import MLXLLM
| `- warning: file 'DeepseekV3.swift' is part of module 'MLXLLM'; ignoring import
7 | import MLXLMCommon
8 | import MLXNN
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/DeepseekV3.swift:357:27: warning: immutable value 'h' was never used; consider replacing with '_' or removing it
355 |
356 | func callAsFunction(_ x: MLXArray) -> (MLXArray, MLXArray) {
357 | let (bsz, seqLen, h) = (x.dim(0), x.dim(1), x.dim(2))
| `- warning: immutable value 'h' was never used; consider replacing with '_' or removing it
358 |
359 | let hiddenStates = x.matmul(weight.T)
[267/272] Compiling MLXLLM Qwen3MoE.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/RoPEUtils.swift:104:13: warning: variable 'x' was never mutated; consider changing to 'let' constant
102 |
103 | public func callAsFunction(_ x: MLXArray, offset: Int = 0) -> MLXArray {
104 | var x = x
| `- warning: variable 'x' was never mutated; consider changing to 'let' constant
105 |
106 | if _mscale != 1.0 {
[268/272] Compiling MLXLLM RoPEUtils.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/RoPEUtils.swift:104:13: warning: variable 'x' was never mutated; consider changing to 'let' constant
102 |
103 | public func callAsFunction(_ x: MLXArray, offset: Int = 0) -> MLXArray {
104 | var x = x
| `- warning: variable 'x' was never mutated; consider changing to 'let' constant
105 |
106 | if _mscale != 1.0 {
[269/272] Compiling MLXLLM SmolLM3.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/RoPEUtils.swift:104:13: warning: variable 'x' was never mutated; consider changing to 'let' constant
102 |
103 | public func callAsFunction(_ x: MLXArray, offset: Int = 0) -> MLXArray {
104 | var x = x
| `- warning: variable 'x' was never mutated; consider changing to 'let' constant
105 |
106 | if _mscale != 1.0 {
[270/272] Compiling MLXLLM Starcoder2.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/SuScaledRotaryEmbedding.swift:42:13: warning: variable 'scaledX' was never mutated; consider changing to 'let' constant
40 | public func callAsFunction(_ x: MLXArray, offset: Int = 0) -> MLXArray {
41 | // Apply scaling only to the dimensions that will be rotated
42 | var scaledX = x
| `- warning: variable 'scaledX' was never mutated; consider changing to 'let' constant
43 | let sliceToScale = scaledX[.ellipsis, 0 ..< dimensions]
44 | scaledX[.ellipsis, 0 ..< dimensions] = scale * sliceToScale
[271/272] Compiling MLXLLM SuScaledRotaryEmbedding.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/SuScaledRotaryEmbedding.swift:42:13: warning: variable 'scaledX' was never mutated; consider changing to 'let' constant
40 | public func callAsFunction(_ x: MLXArray, offset: Int = 0) -> MLXArray {
41 | // Apply scaling only to the dimensions that will be rotated
42 | var scaledX = x
| `- warning: variable 'scaledX' was never mutated; consider changing to 'let' constant
43 | let sliceToScale = scaledX[.ellipsis, 0 ..< dimensions]
44 | scaledX[.ellipsis, 0 ..< dimensions] = scale * sliceToScale
[272/272] Compiling MLXLLM SwitchLayers.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/SuScaledRotaryEmbedding.swift:42:13: warning: variable 'scaledX' was never mutated; consider changing to 'let' constant
40 | public func callAsFunction(_ x: MLXArray, offset: Int = 0) -> MLXArray {
41 | // Apply scaling only to the dimensions that will be rotated
42 | var scaledX = x
| `- warning: variable 'scaledX' was never mutated; consider changing to 'let' constant
43 | let sliceToScale = scaledX[.ellipsis, 0 ..< dimensions]
44 | scaledX[.ellipsis, 0 ..< dimensions] = scale * sliceToScale
Build of target: 'MLXLLM' complete! (7.98s)
Target: MLXVLM
Extracting symbol information for 'MLXVLM'...
Finished extracting symbol information for 'MLXVLM'. (3.77s)
Building documentation for 'MLXVLM'...
warning: 'LLMModelFactory' doesn't exist at '/MLXVLM/VLMTypeRegistry'
--> Libraries/MLXVLM/VLMModelFactory.swift:75:28-75:43
73 | /// Registry of model type, e.g 'llama', to functions that can instantiate the model from configuration.
74 | ///
75 + /// Typically called via ``LLMModelFactory/load(hub:configuration:progressHandler:)``.
76 | public class VLMTypeRegistry: ModelTypeRegistry, @unchecked Sendable {
77 |
Finished building documentation for 'MLXVLM' (0.30s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/main
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.71s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/11] Compiling MLXVLM VLMModel.swift
[3/11] Compiling MLXVLM QwenVL.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/QwenVL.swift:180:33: warning: no calls to throwing functions occur within 'try' expression
178 | ) throws -> [Int] {
179 | // Replace single padding token with correct number for each image or video frame
180 | let placeholderTokens = try tokenizer.encode(
| `- warning: no calls to throwing functions occur within 'try' expression
181 | text: "<|vision_start|>\(paddingToken)<|vision_end|>")
182 | let placeholderRanges = promptTokens.ranges(of: placeholderTokens)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/QwenVL.swift:190:20: warning: no calls to throwing functions occur within 'try' expression
188 | let replacementSequences = try frames.map { frame in
189 | let paddingCount = frame.product / mergeLength
190 | return try tokenizer.encode(
| `- warning: no calls to throwing functions occur within 'try' expression
191 | text:
192 | "<|vision_start|>\(Array(repeating: paddingToken, count: paddingCount).joined())<|vision_end|>"
[4/11] Compiling MLXVLM SmolVLM2.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:313:35: warning: 'try' must precede 'await'
311 | var video = try input.videos[0].asAVAsset()
312 |
313 | let processedFrames = await try MediaProcessing.asProcessedSequence(
| `- warning: 'try' must precede 'await'
314 | video,
315 | maxFrames: maxVideoFrames,
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:157:13: warning: variable 'targetSize' was never mutated; consider changing to 'let' constant
155 | func aspectRatioSize(for size: CGSize, longestEdge: CGFloat, multiple: CGFloat? = nil) -> CGSize
156 | {
157 | var targetSize = MediaProcessing.bestFit(
| `- warning: variable 'targetSize' was never mutated; consider changing to 'let' constant
158 | size, in: CGSize(width: longestEdge, height: longestEdge))
159 | guard let multiple = multiple else { return targetSize }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:292:39: warning: trailing closure in this context is confusable with the body of the statement; pass as a parenthesized argument to silence this warning
290 | // Insert a default system message if the input doesn't have one
291 | func messagesWithSystem(_ messages: [Message]) -> [Message] {
292 | guard messages.filter { $0["role"] as? String == "system" }.isEmpty else {
| `- warning: trailing closure in this context is confusable with the body of the statement; pass as a parenthesized argument to silence this warning
293 | return messages
294 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:306:17: warning: initialization of immutable value 'finalMessages' was never used; consider replacing with assignment to '_' or removing it
304 |
305 | // Unfortunately we don't have a "render" option in Tokenizers yet, so decoding
306 | let finalMessages = messagesWithSystem(messages)
| `- warning: initialization of immutable value 'finalMessages' was never used; consider replacing with assignment to '_' or removing it
307 | let promptTokens = try tokenizer.applyChatTemplate(
308 | messages: messagesWithSystem(messages))
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:311:17: warning: variable 'video' was never mutated; consider changing to 'let' constant
309 | let decoded = try tokenizer.decode(tokens: promptTokens, skipSpecialTokens: false)
310 |
311 | var video = try input.videos[0].asAVAsset()
| `- warning: variable 'video' was never mutated; consider changing to 'let' constant
312 |
313 | let processedFrames = await try MediaProcessing.asProcessedSequence(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:240:27: warning: no calls to throwing functions occur within 'try' expression
238 | // Unfortunately we don't have a "render" option in Tokenizers yet, so decoding
239 | let promptTokens = try tokenizer.applyChatTemplate(messages: messages)
240 | let decoded = try tokenizer.decode(tokens: promptTokens, skipSpecialTokens: false)
| `- warning: no calls to throwing functions occur within 'try' expression
241 |
242 | let image = try input.images[0].asCIImage().toSRGB()
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:272:37: warning: no calls to throwing functions occur within 'try' expression
270 | let splitPrompt = decoded.split(by: imageToken, options: .literal)
271 | let prompt = splitPrompt.joined(separator: imagePromptString)
272 | let finalPromptTokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
273 |
274 | let promptArray = MLXArray(finalPromptTokens).expandedDimensions(axis: 0)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:309:27: warning: no calls to throwing functions occur within 'try' expression
307 | let promptTokens = try tokenizer.applyChatTemplate(
308 | messages: messagesWithSystem(messages))
309 | let decoded = try tokenizer.decode(tokens: promptTokens, skipSpecialTokens: false)
| `- warning: no calls to throwing functions occur within 'try' expression
310 |
311 | var video = try input.videos[0].asAVAsset()
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:311:25: warning: no calls to throwing functions occur within 'try' expression
309 | let decoded = try tokenizer.decode(tokens: promptTokens, skipSpecialTokens: false)
310 |
311 | var video = try input.videos[0].asAVAsset()
| `- warning: no calls to throwing functions occur within 'try' expression
312 |
313 | let processedFrames = await try MediaProcessing.asProcessedSequence(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/SmolVLM2.swift:347:37: warning: no calls to throwing functions occur within 'try' expression
345 | let splitPrompt = decoded.split(by: "User: ", options: .literal)
346 | let prompt = splitPrompt[0] + "User: " + videoPromptString + splitPrompt[1]
347 | let finalPromptTokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
348 |
349 | let promptArray = MLXArray(finalPromptTokens).expandedDimensions(axis: 0)
[5/12] Compiling MLXVLM Qwen2VL.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Qwen2VL.swift:475:17: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it
473 | let rotaryPositionEmbedding = rotaryPositionEmbedding(frames)
474 |
475 | let batchSize = frames.count
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it
476 |
477 | for block in blocks {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Qwen2VL.swift:562:31: warning: no calls to throwing functions occur within 'try' expression
560 | let resizedSize = CGSize(width: resizedWidth, height: resizedHeight)
561 |
562 | let processedImages = try images.map { image in
| `- warning: no calls to throwing functions occur within 'try' expression
563 | preprocess(image: image, resizedSize: resizedSize).asMLXArray()
564 | }
[6/12] Compiling MLXVLM Paligemma.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:459:17: warning: no calls to throwing functions occur within 'try' expression
457 | image = MediaProcessing.apply(image, processing: processing)
458 |
459 | image = try MediaProcessing.resampleBicubic(image, to: config.size.cgSize)
| `- warning: no calls to throwing functions occur within 'try' expression
460 | image = MediaProcessing.normalize(
461 | image, mean: config.imageMeanTuple, std: config.imageStdTuple)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:482:28: warning: no calls to throwing functions occur within 'try' expression
480 | + "\n"
481 |
482 | let promptTokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
483 | let promptArray = MLXArray(promptTokens).expandedDimensions(axis: 0)
484 | let mask = ones(like: promptArray).asType(.int8)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:571:13: warning: initialization of immutable value 'embedDimension' was never used; consider replacing with assignment to '_' or removing it
569 | attentionMask: MLXArray
570 | ) -> (MLXArray, MLXArray) {
571 | let embedDimension = imageFeatures.dim(2)
| `- warning: initialization of immutable value 'embedDimension' was never used; consider replacing with assignment to '_' or removing it
572 | let (batchSize, sequenceLength) = inputIds.shape2
573 | var scaledImageFeatures = imageFeatures / pow(Float(config.hiddenSize), 0.5)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:572:14: warning: immutable value 'batchSize' was never used; consider replacing with '_' or removing it
570 | ) -> (MLXArray, MLXArray) {
571 | let embedDimension = imageFeatures.dim(2)
572 | let (batchSize, sequenceLength) = inputIds.shape2
| `- warning: immutable value 'batchSize' was never used; consider replacing with '_' or removing it
573 | var scaledImageFeatures = imageFeatures / pow(Float(config.hiddenSize), 0.5)
574 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:572:25: warning: immutable value 'sequenceLength' was never used; consider replacing with '_' or removing it
570 | ) -> (MLXArray, MLXArray) {
571 | let embedDimension = imageFeatures.dim(2)
572 | let (batchSize, sequenceLength) = inputIds.shape2
| `- warning: immutable value 'sequenceLength' was never used; consider replacing with '_' or removing it
573 | var scaledImageFeatures = imageFeatures / pow(Float(config.hiddenSize), 0.5)
574 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:580:13: warning: variable 'textMaskExpanded' was never mutated; consider changing to 'let' constant
578 |
579 | // expand masks to match embedding dimension
580 | var textMaskExpanded = expandedDimensions(textMask, axis: -1)
| `- warning: variable 'textMaskExpanded' was never mutated; consider changing to 'let' constant
581 | var padMaskExpanded = expandedDimensions(padMask, axis: -1)
582 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:581:13: warning: variable 'padMaskExpanded' was never mutated; consider changing to 'let' constant
579 | // expand masks to match embedding dimension
580 | var textMaskExpanded = expandedDimensions(textMask, axis: -1)
581 | var padMaskExpanded = expandedDimensions(padMask, axis: -1)
| `- warning: variable 'padMaskExpanded' was never mutated; consider changing to 'let' constant
582 |
583 | // insert padding and text token embeddings
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:591:13: warning: variable 'imageMaskExpanded' was never mutated; consider changing to 'let' constant
589 |
590 | // insert image embeddings - the image mask is always less or equal to the sentence in length
591 | var imageMaskExpanded = expandedDimensions(imageMask, axis: -1)
| `- warning: variable 'imageMaskExpanded' was never mutated; consider changing to 'let' constant
592 | finalEmbedding = which(imageMaskExpanded, scaledImageFeatures, finalEmbedding)
593 |
[7/12] Compiling MLXVLM Idefics3.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:851:17: warning: initialization of immutable value 'count' was never used; consider replacing with assignment to '_' or removing it
849 | }
850 |
851 | let count = config.imageSequenceLength ?? 1
| `- warning: initialization of immutable value 'count' was never used; consider replacing with assignment to '_' or removing it
852 |
853 | // Encode only the text part of the prompt, without <image>
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:841:26: warning: no calls to throwing functions occur within 'try' expression
839 | if input.images.isEmpty {
840 | // No image scenario
841 | let tokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
842 | let tokensArray = MLXArray(tokens).expandedDimensions(axis: 0)
843 | let mask = ones(like: tokensArray)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:854:32: warning: no calls to throwing functions occur within 'try' expression
852 |
853 | // Encode only the text part of the prompt, without <image>
854 | var promptTokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
855 |
856 | let imageTokenIndex = promptTokens.count / 2
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:869:21: warning: no calls to throwing functions occur within 'try' expression
867 | )
868 | image = MediaProcessing.apply(image, processing: input.processing)
869 | image = try MediaProcessing.resampleBicubic(image, to: targetSize)
| `- warning: no calls to throwing functions occur within 'try' expression
870 | image = MediaProcessing.normalize(
871 | image,
[8/12] Compiling MLXVLM Qwen25VL.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Qwen25VL.swift:715:24: warning: no calls to throwing functions occur within 'try' expression
713 | }
714 | .map {
715 | return try MediaProcessing.resampleBicubic($0, to: resizedSize)
| `- warning: no calls to throwing functions occur within 'try' expression
716 | }
717 | .map {
[9/12] Compiling MLXVLM VLMModelFactory.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:202:14: warning: non-final class 'VLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
200 | /// configuration: VLMRegistry.paligemma3bMix4488bit)
201 | /// ```
202 | public class VLMModelFactory: ModelFactory {
| `- warning: non-final class 'VLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
203 |
204 | public init(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:84:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
82 | private static func all() -> [String: @Sendable (URL) throws -> any LanguageModel] {
83 | [
84 | "paligemma": create(PaliGemmaConfiguration.self, PaliGemma.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
85 | "qwen2_vl": create(Qwen2VLConfiguration.self, Qwen2VL.init),
86 | "qwen2_5_vl": create(Qwen25VLConfiguration.self, Qwen25VL.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:85:25: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
83 | [
84 | "paligemma": create(PaliGemmaConfiguration.self, PaliGemma.init),
85 | "qwen2_vl": create(Qwen2VLConfiguration.self, Qwen2VL.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
86 | "qwen2_5_vl": create(Qwen25VLConfiguration.self, Qwen25VL.init),
87 | "idefics3": create(Idefics3Configuration.self, Idefics3.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:86:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
84 | "paligemma": create(PaliGemmaConfiguration.self, PaliGemma.init),
85 | "qwen2_vl": create(Qwen2VLConfiguration.self, Qwen2VL.init),
86 | "qwen2_5_vl": create(Qwen25VLConfiguration.self, Qwen25VL.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
87 | "idefics3": create(Idefics3Configuration.self, Idefics3.init),
88 | "gemma3": create(Gemma3Configuration.self, Gemma3.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:87:25: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
85 | "qwen2_vl": create(Qwen2VLConfiguration.self, Qwen2VL.init),
86 | "qwen2_5_vl": create(Qwen25VLConfiguration.self, Qwen25VL.init),
87 | "idefics3": create(Idefics3Configuration.self, Idefics3.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
88 | "gemma3": create(Gemma3Configuration.self, Gemma3.init),
89 | "smolvlm": create(SmolVLM2Configuration.self, SmolVLM2.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:88:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
86 | "qwen2_5_vl": create(Qwen25VLConfiguration.self, Qwen25VL.init),
87 | "idefics3": create(Idefics3Configuration.self, Idefics3.init),
88 | "gemma3": create(Gemma3Configuration.self, Gemma3.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
89 | "smolvlm": create(SmolVLM2Configuration.self, SmolVLM2.init),
90 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:89:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
87 | "idefics3": create(Idefics3Configuration.self, Idefics3.init),
88 | "gemma3": create(Gemma3Configuration.self, Gemma3.init),
89 | "smolvlm": create(SmolVLM2Configuration.self, SmolVLM2.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
90 | ]
91 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:104:35: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
102 | {
103 | [
104 | "PaliGemmaProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
105 | PaliGemmaProcessorConfiguration.self, PaliGemmaProcessor.init),
106 | "Qwen2VLProcessor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:106:33: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
104 | "PaliGemmaProcessor": create(
105 | PaliGemmaProcessorConfiguration.self, PaliGemmaProcessor.init),
106 | "Qwen2VLProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
107 | Qwen2VLProcessorConfiguration.self, Qwen2VLProcessor.init),
108 | "Qwen2_5_VLProcessor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:108:36: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
106 | "Qwen2VLProcessor": create(
107 | Qwen2VLProcessorConfiguration.self, Qwen2VLProcessor.init),
108 | "Qwen2_5_VLProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
109 | Qwen25VLProcessorConfiguration.self, Qwen25VLProcessor.init),
110 | "Idefics3Processor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:110:34: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
108 | "Qwen2_5_VLProcessor": create(
109 | Qwen25VLProcessorConfiguration.self, Qwen25VLProcessor.init),
110 | "Idefics3Processor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
111 | Idefics3ProcessorConfiguration.self, Idefics3Processor.init),
112 | "Gemma3Processor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:112:32: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
110 | "Idefics3Processor": create(
111 | Idefics3ProcessorConfiguration.self, Idefics3Processor.init),
112 | "Gemma3Processor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
113 | Gemma3ProcessorConfiguration.self, Gemma3Processor.init),
114 | "SmolVLMProcessor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:114:33: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
112 | "Gemma3Processor": create(
113 | Gemma3ProcessorConfiguration.self, Gemma3Processor.init),
114 | "SmolVLMProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
115 | SmolVLMProcessorConfiguration.self, SmolVLMProcessor.init),
116 | ]
[10/12] Compiling MLXVLM MediaProcessing.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:19:13: warning: let 'context' is not concurrency-safe because non-'Sendable' type 'CIContext' may have shared mutable state; this is an error in the Swift 6 language mode
17 | }
18 |
19 | private let context = CIContext()
| `- warning: let 'context' is not concurrency-safe because non-'Sendable' type 'CIContext' may have shared mutable state; this is an error in the Swift 6 language mode
20 |
21 | /// Collection of methods for processing media (images, video, etc.).
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIContext.h:36:12: note: class 'CIContext' does not conform to the 'Sendable' protocol
34 |
35 | NS_CLASS_AVAILABLE(10_4, 5_0)
36 | @interface CIContext : NSObject
| `- note: class 'CIContext' does not conform to the 'Sendable' protocol
37 | {
38 | void *_priv;
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:4:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
2 |
3 | import AVFoundation
4 | import CoreImage.CIFilterBuiltins
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
5 | import MLX
6 | import MLXLMCommon
:
17 | }
18 |
19 | private let context = CIContext()
| |- note: add '@MainActor' to make let 'context' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
20 |
21 | /// Collection of methods for processing media (images, video, etc.).
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:287:13: warning: initialization of immutable value 'secondsPerSample' was never used; consider replacing with assignment to '_' or removing it
285 | let durationInSeconds = duration.seconds
286 | let samplesPerSecond = Double(samplesPerSecond)
287 | let secondsPerSample = 1.0 / samplesPerSecond
| `- warning: initialization of immutable value 'secondsPerSample' was never used; consider replacing with assignment to '_' or removing it
288 | let totalFramesToSample = durationInSeconds * samplesPerSecond
289 | let durationTimeValue = duration.value
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:302:46: warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
300 | for await result in await generator.images(for: sampledTimes) {
301 | switch result {
302 | case .success(requestedTime: let requested, let image, actualTime: let actual):
| `- warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
303 | let ciImage = CIImage(
304 | cgImage: image, options: [.colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!])
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:302:84: warning: immutable value 'actual' was never used; consider replacing with '_' or removing it
300 | for await result in await generator.images(for: sampledTimes) {
301 | switch result {
302 | case .success(requestedTime: let requested, let image, actualTime: let actual):
| `- warning: immutable value 'actual' was never used; consider replacing with '_' or removing it
303 | let ciImage = CIImage(
304 | cgImage: image, options: [.colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!])
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:306:46: warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
304 | cgImage: image, options: [.colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!])
305 | ciImages.append(ciImage)
306 | case .failure(requestedTime: let requested, let error):
| `- warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
307 | break
308 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:306:61: warning: immutable value 'error' was never used; consider replacing with '_' or removing it
304 | cgImage: image, options: [.colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!])
305 | ciImages.append(ciImage)
306 | case .failure(requestedTime: let requested, let error):
| `- warning: immutable value 'error' was never used; consider replacing with '_' or removing it
307 | break
308 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:300:29: warning: no 'async' operations occur within 'await' expression
298 | // Collect the frames
299 | var ciImages: [CIImage] = []
300 | for await result in await generator.images(for: sampledTimes) {
| `- warning: no 'async' operations occur within 'await' expression
301 | switch result {
302 | case .success(requestedTime: let requested, let image, actualTime: let actual):
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:341:13: warning: variable 'desiredFrames' was never mutated; consider changing to 'let' constant
339 | // Note: the round was not present in `asCIImageSequence`, so we may now be passing 1 more frame to Qwen depending on video duration.
340 | let estimatedFrames = Int(round(fps * duration.seconds))
341 | var desiredFrames = min(estimatedFrames, maxFrames)
| `- warning: variable 'desiredFrames' was never mutated; consider changing to 'let' constant
342 | let finalFrameCount = max(desiredFrames, 1)
343 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:356:13: warning: variable 'frames' was never used; consider replacing with '_' or removing it
354 | var timestamps: [CMTime] = []
355 |
356 | var frames: [VideoFrame] = []
| `- warning: variable 'frames' was never used; consider replacing with '_' or removing it
357 |
358 | for await result in await generator.images(for: sampledTimes) {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:360:46: warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
358 | for await result in await generator.images(for: sampledTimes) {
359 | switch result {
360 | case .success(requestedTime: let requested, let image, actualTime: let actual):
| `- warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
361 | let ciImage = CIImage(
362 | cgImage: image, options: [.colorSpace: CGColorSpace(name: CGColorSpace.sRGB)!])
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:366:46: warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
364 | ciImages.append(frame.frame)
365 | timestamps.append(frame.timeStamp)
366 | case .failure(requestedTime: let requested, let error):
| `- warning: immutable value 'requested' was never used; consider replacing with '_' or removing it
367 | break
368 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:366:61: warning: immutable value 'error' was never used; consider replacing with '_' or removing it
364 | ciImages.append(frame.frame)
365 | timestamps.append(frame.timeStamp)
366 | case .failure(requestedTime: let requested, let error):
| `- warning: immutable value 'error' was never used; consider replacing with '_' or removing it
367 | break
368 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:358:29: warning: no 'async' operations occur within 'await' expression
356 | var frames: [VideoFrame] = []
357 |
358 | for await result in await generator.images(for: sampledTimes) {
| `- warning: no 'async' operations occur within 'await' expression
359 | switch result {
360 | case .success(requestedTime: let requested, let image, actualTime: let actual):
[11/12] Compiling MLXVLM Gemma3.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:977:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it
975 | ) -> (MLXArray, MLXArray?) {
976 | let embedDim = inputsEmbeds.dim(2)
977 | let batchSize = inputIds.dim(0)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it
978 | let sequenceLength = inputIds.dim(1)
979 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:978:13: warning: initialization of immutable value 'sequenceLength' was never used; consider replacing with assignment to '_' or removing it
976 | let embedDim = inputsEmbeds.dim(2)
977 | let batchSize = inputIds.dim(0)
978 | let sequenceLength = inputIds.dim(1)
| `- warning: initialization of immutable value 'sequenceLength' was never used; consider replacing with assignment to '_' or removing it
979 |
980 | // Scale image features to match text embedding magnitude
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:990:13: warning: initialization of immutable value 'textMask' was never used; consider replacing with assignment to '_' or removing it
988 |
989 | // Create masks for different token types
990 | let textMask = MLX.logicalAnd(
| `- warning: initialization of immutable value 'textMask' was never used; consider replacing with assignment to '_' or removing it
991 | MLX.notEqual(inputIds, MLXArray(imageTokenId)),
992 | MLX.notEqual(inputIds, MLXArray(padTokenId))
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:1030:56: warning: conditional cast from 'any KVCache' to 'any KVCache' always succeeds
1028 | guard let imagePixels = input.image?.pixels else {
1029 | // Text-only input
1030 | let convertedCache = cache.compactMap { $0 as? KVCache }
| `- warning: conditional cast from 'any KVCache' to 'any KVCache' always succeeds
1031 | let result = languageModel(
1032 | input.text.tokens, cache: convertedCache, inputEmbedding: nil, mask: nil)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:1042:52: warning: conditional cast from 'any KVCache' to 'any KVCache' always succeeds
1040 | )
1041 |
1042 | let convertedCache = cache.compactMap { $0 as? KVCache }
| `- warning: conditional cast from 'any KVCache' to 'any KVCache' always succeeds
1043 | // Use causal masking for text generation
1044 | let maskMode: MLXFast.ScaledDotProductAttentionMaskMode = .causal
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:1061:13: warning: initialization of immutable value 'lmHeadKeys' was never used; consider replacing with assignment to '_' or removing it
1059 |
1060 | public func sanitize(weights: [String: MLXArray]) -> [String: MLXArray] {
1061 | let lmHeadKeys = weights.keys.filter { $0.contains("lm_head") }
| `- warning: initialization of immutable value 'lmHeadKeys' was never used; consider replacing with assignment to '_' or removing it
1062 |
1063 | // Also check attention layer structures
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:1064:13: warning: initialization of immutable value 'attnKeys' was never used; consider replacing with assignment to '_' or removing it
1062 |
1063 | // Also check attention layer structures
1064 | let attnKeys = weights.keys.filter {
| `- warning: initialization of immutable value 'attnKeys' was never used; consider replacing with assignment to '_' or removing it
1065 | $0.contains("self_attn")
1066 | && ($0.contains("q_proj") || $0.contains("k_proj") || $0.contains("v_proj")
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Gemma3.swift:1103:32: warning: no calls to throwing functions occur within 'try' expression
1101 | let processedImage = MediaProcessing.apply(image, processing: userProcessing)
1102 | let srgbImage = MediaProcessing.inSRGBToneCurveSpace(processedImage)
1103 | let resizedImage = try MediaProcessing.resampleBicubic(srgbImage, to: targetSize)
| `- warning: no calls to throwing functions occur within 'try' expression
1104 | let normalizedImage = MediaProcessing.normalize(
1105 | resizedImage, mean: config.imageMeanTuple, std: config.imageStdTuple)
[12/12] Emitting module MLXVLM
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:19:13: warning: let 'context' is not concurrency-safe because non-'Sendable' type 'CIContext' may have shared mutable state; this is an error in the Swift 6 language mode
17 | }
18 |
19 | private let context = CIContext()
| `- warning: let 'context' is not concurrency-safe because non-'Sendable' type 'CIContext' may have shared mutable state; this is an error in the Swift 6 language mode
20 |
21 | /// Collection of methods for processing media (images, video, etc.).
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIContext.h:36:12: note: class 'CIContext' does not conform to the 'Sendable' protocol
34 |
35 | NS_CLASS_AVAILABLE(10_4, 5_0)
36 | @interface CIContext : NSObject
| `- note: class 'CIContext' does not conform to the 'Sendable' protocol
37 | {
38 | void *_priv;
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/MediaProcessing.swift:4:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
2 |
3 | import AVFoundation
4 | import CoreImage.CIFilterBuiltins
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
5 | import MLX
6 | import MLXLMCommon
:
17 | }
18 |
19 | private let context = CIContext()
| |- note: add '@MainActor' to make let 'context' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
20 |
21 | /// Collection of methods for processing media (images, video, etc.).
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:202:14: warning: non-final class 'VLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
200 | /// configuration: VLMRegistry.paligemma3bMix4488bit)
201 | /// ```
202 | public class VLMModelFactory: ModelFactory {
| `- warning: non-final class 'VLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
203 |
204 | public init(
Build of target: 'MLXVLM' complete! (1.87s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/linkable-paths.json
Target: MLXLMCommon
Extracting symbol information for 'MLXLMCommon'...
Finished extracting symbol information for 'MLXLMCommon'. (1.00s)
Building documentation for 'MLXLMCommon'...
warning: 'LoRAConvertToLinear' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Adapters/LoRA/LoRA+Layers.swift:14:74-14:93
12 | ///
13 | /// - converting `Linear` or `QuantizedLinear` layers to ``LoRALinear`` / ``QLoRALinear``
14 + /// - converting ``LoRALinear`` back to `Linear` or `QuantizedLinear` (``LoRAConvertToLinear``)
15 | /// - implementing the LoRA evaluation
16 | ///
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Adapters/LoRA/LoRA+Layers.swift:19:46-19:55
17 | /// ``QLoRALinear`` is the equivalent class for `QuantizedLinear`.
18 | ///
19 + /// This is not typically used directly -- ``LoRATrain/convert(model:layers:)`` is used to
20 | /// add the adapter layers to a given model.
21 | ///
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Adapters/LoRA/LoRA+Layers.swift:26:9-26:18
24 | /// - [QLoRA: Efficient Finetuning of Quantized LLMs](https://arxiv.org/abs/2305.14314)
25 | /// - ``QLoRALinear``
26 + /// - ``LoRATrain/convert(model:layers:)``
27 | /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
28 | public class LoRALinear: Linear, LoRALayer {
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Adapters/LoRA/LoRA+Layers.swift:27:9-27:18
25 | /// - ``QLoRALinear``
26 | /// - ``LoRATrain/convert(model:layers:)``
27 + /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
28 | public class LoRALinear: Linear, LoRALayer {
29 |
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/from(linear:rank:scale:)'
--> ../Adapters/LoRA/LoRA+Layers.swift:69:40-69:49
67 | /// that implements the `LoRA` adapter.
68 | ///
69 + /// This is typically called via ``LoRATrain/convert(model:layers:)``.
70 | ///
71 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/from(linear:rank:scale:)'
--> ../Adapters/LoRA/LoRA+Layers.swift:72:13-72:22
70 | ///
71 | /// ### See Also
72 + /// - ``LoRATrain/convert(model:layers:)``
73 | /// - ``QLoRALinear/from(linear:rank:)``
74 | public static func from(linear: Linear, rank: Int = 8, scale: Float = 20.0) -> LoRALayer {
warning: 'from(linear:rank:)' doesn't exist at '/MLXLMCommon/QLoRALinear'
--> ../Adapters/LoRA/LoRA+Layers.swift:73:25-73:43
71 | /// ### See Also
72 | /// - ``LoRATrain/convert(model:layers:)``
73 + /// - ``QLoRALinear/from(linear:rank:)``
| ╰─suggestion: Replace 'from(linear:rank:)' with 'from(linear:rank:scale:)'
74 | public static func from(linear: Linear, rank: Int = 8, scale: Float = 20.0) -> LoRALayer {
75 | if let linear = linear as? QuantizedLinear {
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/fused()'
--> ../Adapters/LoRA/LoRA+Layers.swift:85:40-85:49
83 | /// Convert back into a fused `Linear` layer.
84 | ///
85 + /// This is typically called via ``LoRATrain/fuse(model:layers:deQuantize:)``.
86 | ///
87 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/fused()'
--> ../Adapters/LoRA/LoRA+Layers.swift:88:13-88:22
86 | ///
87 | /// ### See Also
88 + /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
89 | /// - ``LoRAConvertToLinear``
90 | /// - ``QLoRALinear/toLinear(deQuantize:)``
warning: 'LoRAConvertToLinear' doesn't exist at '/MLXLMCommon/LoRALinear/fused()'
--> ../Adapters/LoRA/LoRA+Layers.swift:89:13-89:32
87 | /// ### See Also
88 | /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
89 + /// - ``LoRAConvertToLinear``
90 | /// - ``QLoRALinear/toLinear(deQuantize:)``
91 | public func fused() -> Module {
warning: 'toLinear(deQuantize:)' doesn't exist at '/MLXLMCommon/QLoRALinear'
--> ../Adapters/LoRA/LoRA+Layers.swift:90:25-90:46
88 | /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
89 | /// - ``LoRAConvertToLinear``
90 + /// - ``QLoRALinear/toLinear(deQuantize:)``
91 | public func fused() -> Module {
92 | let dtype = weight.dtype
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/from(linear:rank:scale:)'
--> ../Adapters/LoRA/LoRA+Layers.swift:153:40-153:49
151 | /// that implements the `LoRA` adapter.
152 | ///
153 + /// This is typically called via ``LoRATrain/convert(model:layers:)``.
154 | ///
155 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/from(linear:rank:scale:)'
--> ../Adapters/LoRA/LoRA+Layers.swift:156:13-156:22
154 | ///
155 | /// ### See Also
156 + /// - ``LoRATrain/convert(model:layers:)``
157 | /// - ``LoRALinear/from(linear:rank:)``
158 | public static func from(linear: QuantizedLinear, rank: Int = 8, scale: Float = 20.0)
warning: 'from(linear:rank:)' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Adapters/LoRA/LoRA+Layers.swift:157:24-157:42
155 | /// ### See Also
156 | /// - ``LoRATrain/convert(model:layers:)``
157 + /// - ``LoRALinear/from(linear:rank:)``
| ╰─suggestion: Replace 'from(linear:rank:)' with 'from(linear:rank:scale:)'
158 | public static func from(linear: QuantizedLinear, rank: Int = 8, scale: Float = 20.0)
159 | -> LoRALayer
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/fused()'
--> ../Adapters/LoRA/LoRA+Layers.swift:168:40-168:49
166 | /// Convert back into a fused `QuantizedLinear` layer.
167 | ///
168 + /// This is typically called via ``LoRATrain/fuse(model:layers:deQuantize:)``.
169 | ///
170 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/fused()'
--> ../Adapters/LoRA/LoRA+Layers.swift:171:13-171:22
169 | ///
170 | /// ### See Also
171 + /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
172 | public func fused() -> Module {
173 | let weight = dequantizedWeight
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRAModel/loraLinearLayers()'
--> ../Adapters/LoRA/LoRAModel.swift:31:13-31:22
29 | ///
30 | /// ### See Also
31 + /// - ``LoRATrain/convert(model:layers:)``
32 | func loraLinearLayers() -> LoRALinearLayers
33 |
warning: 'Chat.Message' doesn't exist at '/MLXLMCommon/MessageGenerator'
--> ../Chat.swift:59:7-59:19
57 |
58 | /// Protocol for something that can convert structured
59 + /// ``Chat.Message`` into model specific ``Message``
60 | /// (raw dictionary) format.
61 | ///
warning: 'loadWeights(modelDirectory:model:quantization:)' doesn't exist at '/MLXLMCommon/porting'
--> porting.md:298:189-298:236
296 | ```
297 |
298 + Note that the weight is given an initial value and shape based on the parameters to the initializer. In typical inference use, these values will be replaced when the weights are loaded (``loadWeights(modelDirectory:model:quantization:)``).
299 |
300 | * Note: If the property names in Python don't make good Swift names, you can use the `@ParameterInfo` property wrapper to specify the key: `@ParameterInfo(key: "some_weight") var weight: MLXArray`
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:243:44-243:91
241 | /// Generator of tokens.
242 | ///
243 + /// This is typically used via a call to ``generate(input:parameters:context:didGenerate:)``.
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: (Int) -> GenerateDisposition) throws -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: ([Int]) -> GenerateDisposition) throws -> GenerateResult'
244 | ///
245 | /// To use it directly:
warning: 'init(input:model:cache:processor:sampler:prefillStepSize:)' doesn't exist at '/MLXLMCommon/TokenIterator/init(input:model:cache:parameters:)'
--> ../Evaluate.swift:312:11-312:69
310 | ///
311 | /// If more control is needed over the generation,
312 + /// ``init(input:model:cache:processor:sampler:prefillStepSize:)``
313 | /// allows a caller to specify ``LogitProcessor`` and ``LogitSampler``
314 | /// directly.
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:440:27-440:74
438 | }
439 |
440 + /// Result of a call to ``generate(input:parameters:context:didGenerate:)``.
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: (Int) -> GenerateDisposition) throws -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: ([Int]) -> GenerateDisposition) throws -> GenerateResult'
441 | public struct GenerateResult: Sendable {
442 |
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:506:45-506:92
504 | }
505 |
506 + /// Action from token visitor callback in ``generate(input:parameters:context:didGenerate:)``.
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: (Int) -> GenerateDisposition) throws -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: ([Int]) -> GenerateDisposition) throws -> GenerateResult'
507 | public enum GenerateDisposition: Sendable {
508 | /// keep producing tokens until an EOS token is produced
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:517:7-517:54
515 | /// Given prompt tokens generate text using the given model and parameters.
516 | ///
517 + /// ``generate(input:parameters:context:didGenerate:)`` is the preferred call.
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: (Int) -> GenerateDisposition) throws -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: ([Int]) -> GenerateDisposition) throws -> GenerateResult'
518 | ///
519 | /// - Parameters:
warning: 'generate(input:context:iterator:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:567:7-567:52
565 | ///
566 | /// Internally this constructs a ``TokenIterator`` and calls
567 + /// ``generate(input:context:iterator:didGenerate:)``
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, context: ModelContext, iterator: TokenIterator, didGenerate: (Int) -> GenerateDisposition) -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, context: ModelContext, iterator: TokenIterator, didGenerate: ([Int]) -> GenerateDisposition) -> GenerateResult'
568 | ///
569 | /// - Parameters:
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:587:7-587:54
585 | /// Low level token generation using a ``TokenIterator``.
586 | ///
587 + /// ``generate(input:parameters:context:didGenerate:)`` is the preferred call.
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: (Int) -> GenerateDisposition) throws -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: ([Int]) -> GenerateDisposition) throws -> GenerateResult'
588 | ///
589 | /// - Parameters:
warning: 'generate(input:context:iterator:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:664:7-664:52
662 | ///
663 | /// Internally this constructs a ``TokenIterator`` and calls
664 + /// ``generate(input:context:iterator:didGenerate:)``
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, context: ModelContext, iterator: TokenIterator, didGenerate: (Int) -> GenerateDisposition) -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, context: ModelContext, iterator: TokenIterator, didGenerate: ([Int]) -> GenerateDisposition) -> GenerateResult'
665 | ///
666 | /// - Parameters:
warning: 'MultiHeadAttention' doesn't exist at '/MLXLMCommon/createAttentionMask(h:cache:)'
--> ../KVCache.swift:166:16-166:34
164 | /// Create an attention mask using the parameters from the KVCache.
165 | ///
166 + /// See also ``MultiHeadAttention/createAdditiveCausalMask(_:dtype:)`` -- same idea
167 | /// but doesn't honor the cache offset.
168 | @_disfavoredOverload
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../ModelFactory.swift:57:52-57:99
55 | ///
56 | /// - ``ModelConfiguration`` -- identifier for the model
57 + /// - ``LanguageModel`` -- the model itself, see ``generate(input:parameters:context:didGenerate:)``
| ├─suggestion: Insert '->GenerateCompletionInfo' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: (Int) -> GenerateDisposition) throws -> GenerateCompletionInfo'
| ╰─suggestion: Insert '->GenerateResult' for 'func generate(input: LMInput, parameters: GenerateParameters, context: ModelContext, didGenerate: ([Int]) -> GenerateDisposition) throws -> GenerateResult'
58 | /// - ``UserInputProcessor`` -- can convert ``UserInput`` into ``LMInput``
59 | /// - `Tokenizer` -- the tokenizer used by ``UserInputProcessor``
warning: 'loadModel(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactory'
--> ../ModelFactory.swift:83:9-83:43
81 | ///
82 | /// ## See Also
83 + /// - ``loadModel(hub:id:progressHandler:)``
| ├─suggestion: Replace 'loadModel(hub:id:progressHandler:)' with 'load(hub:configuration:progressHandler:)'
| ╰─suggestion: Replace 'loadModel(hub:id:progressHandler:)' with 'loadContainer(hub:configuration:progressHandler:)'
84 | /// - ``loadModel(hub:directory:progressHandler:)``
85 | /// - ``loadModelContainer(hub:id:progressHandler:)``
warning: 'loadModelContainer(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactory'
--> ../ModelFactory.swift:85:9-85:52
83 | /// - ``loadModel(hub:id:progressHandler:)``
84 | /// - ``loadModel(hub:directory:progressHandler:)``
85 + /// - ``loadModelContainer(hub:id:progressHandler:)``
| ├─suggestion: Replace 'loadModelContainer(hub:id:progressHandler:)' with 'loadContainer(hub:configuration:progressHandler:)'
| ╰─suggestion: Replace 'loadModelContainer(hub:id:progressHandler:)' with 'load(hub:configuration:progressHandler:)'
86 | /// - ``loadModelContainer(hub:directory:progressHandler:)``
87 | public protocol ModelFactory: Sendable {
warning: 'loadModel(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactory/load(hub:configuration:progressHandler:)'
--> ../ModelFactory.swift:138:13-138:47
136 | ///
137 | /// ## See Also
138 + /// - ``loadModel(hub:id:progressHandler:)``
139 | /// - ``loadModelContainer(hub:id:progressHandler:)``
140 | public func load(
warning: 'loadModelContainer(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactory/load(hub:configuration:progressHandler:)'
--> ../ModelFactory.swift:139:13-139:56
137 | /// ## See Also
138 | /// - ``loadModel(hub:id:progressHandler:)``
139 + /// - ``loadModelContainer(hub:id:progressHandler:)``
140 | public func load(
141 | hub: HubApi = defaultHubApi, configuration: ModelConfiguration,
warning: Parameter 'revision' is missing documentation
--> ../ModelFactory.swift:216:56-216:56
214 | /// - hub: optional HubApi -- by default uses ``defaultHubApi``
215 | /// - id: huggingface model identifier, e.g "mlx-community/Qwen3-4B-4bit"
216 + /// - progressHandler: optional callback for progress
| ╰─suggestion: Document 'revision' parameter
217 | /// - Returns: a ``ModelContext``
218 | public func loadModel(
warning: Parameter 'revision' is missing documentation
--> ../ModelFactory.swift:237:56-237:56
235 | /// - hub: optional HubApi -- by default uses ``defaultHubApi``
236 | /// - id: huggingface model identifier, e.g "mlx-community/Qwen3-4B-4bit"
237 + /// - progressHandler: optional callback for progress
| ╰─suggestion: Document 'revision' parameter
238 | /// - Returns: a ``ModelContainer``
239 | public func loadModelContainer(
warning: 'loadModel(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactoryRegistry'
--> ../ModelFactory.swift:342:19-342:53
340 | /// Registry of ``ModelFactory`` trampolines.
341 | ///
342 + /// This allows ``loadModel(hub:id:progressHandler:)`` to use any ``ModelFactory`` instances
343 | /// available but be defined in the `LLMCommon` layer. This is not typically used directly -- it is
344 | /// called via ``loadModel(hub:id:progressHandler:)``:
warning: 'loadModel(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactoryRegistry'
--> ../ModelFactory.swift:344:18-344:52
342 | /// This allows ``loadModel(hub:id:progressHandler:)`` to use any ``ModelFactory`` instances
343 | /// available but be defined in the `LLMCommon` layer. This is not typically used directly -- it is
344 + /// called via ``loadModel(hub:id:progressHandler:)``:
345 | ///
346 | /// ```swift
warning: 'loadModel(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactoryRegistry'
--> ../ModelFactory.swift:351:9-351:43
349 | ///
350 | /// ## See Also
351 + /// - ``loadModel(hub:id:progressHandler:)``
352 | /// - ``loadModel(hub:directory:progressHandler:)``
353 | /// - ``loadModelContainer(hub:id:progressHandler:)``
warning: 'loadModelContainer(hub:id:progressHandler:)' doesn't exist at '/MLXLMCommon/ModelFactoryRegistry'
--> ../ModelFactory.swift:353:9-353:52
351 | /// - ``loadModel(hub:id:progressHandler:)``
352 | /// - ``loadModel(hub:directory:progressHandler:)``
353 + /// - ``loadModelContainer(hub:id:progressHandler:)``
354 | /// - ``loadModelContainer(hub:directory:progressHandler:)``
355 | final public class ModelFactoryRegistry: @unchecked Sendable {
warning: 'modelRegistry' doesn't exist at '/MLXLMCommon/AbstractModelRegistry/configuration(id:)'
--> ../Registries/AbstractModelRegistry.swift:28:38-28:51
26 | }
27 |
28 + /// Returns configuration from ``modelRegistry``.
29 | ///
30 | /// - Note: If the id doesn't exists in the configuration, this will return a new instance of it.
warning: 'init(chat:tools:additionalContext:)' doesn't exist at '/MLXLMCommon/UserInput/init(prompt:images:videos:tools:additionalContext:)'
--> ../UserInput.swift:178:13-178:48
176 | /// ### See Also
177 | /// - ``Prompt-swift.enum/text(_:)``
178 + /// - ``init(chat:tools:additionalContext:)``
179 | public init(
180 | prompt: String, images: [Image] = [Image](), videos: [Video] = [Video](),
warning: 'init(chat:tools:additionalContext:)' doesn't exist at '/MLXLMCommon/UserInput/init(messages:images:videos:tools:additionalContext:)'
--> ../UserInput.swift:212:25-212:60
210 | /// ```
211 | ///
212 + /// Typically the ``init(chat:tools:additionalContext:)`` should be used instead
213 | /// along with a model specific ``MessageGenerator`` (supplied by the ``UserInputProcessor``).
214 | ///
warning: 'init(chat:tools:additionalContext:)' doesn't exist at '/MLXLMCommon/UserInput/init(messages:images:videos:tools:additionalContext:)'
--> ../UserInput.swift:223:13-223:48
221 | /// ### See Also
222 | /// - ``Prompt-swift.enum/text(_:)``
223 + /// - ``init(chat:tools:additionalContext:)``
224 | public init(
225 | messages: [Message], images: [Image] = [Image](), videos: [Video] = [Video](),
warning: 'init(chat:tools:additionalContext:)' doesn't exist at '/MLXLMCommon/UserInput/init(chat:processing:tools:additionalContext:)'
--> ../UserInput.swift:258:13-258:48
256 | /// ### See Also
257 | /// - ``Prompt-swift.enum/text(_:)``
258 + /// - ``init(chat:tools:additionalContext:)``
259 | public init(
260 | chat: [Chat.Message],
warning: 'init(chat:tools:additionalContext:)' doesn't exist at '/MLXLMCommon/UserInput/init(prompt:images:videos:processing:tools:additionalContext:)'
--> ../UserInput.swift:282:11-282:46
280 | /// Initialize the `UserInput` with a preconfigured ``Prompt-swift.enum``.
281 | ///
282 + /// ``init(chat:tools:additionalContext:)`` is the preferred mechanism.
283 | ///
284 | /// - Parameters:
warning: 'init(chat:tools:additionalContext:)' doesn't exist at '/MLXLMCommon/UserInput/init(prompt:images:videos:processing:tools:additionalContext:)'
--> ../UserInput.swift:293:13-293:48
291 | /// ### See Also
292 | /// - ``Prompt-swift.enum/text(_:)``
293 + /// - ``init(chat:tools:additionalContext:)``
294 | public init(
295 | prompt: Prompt,
Finished building documentation for 'MLXLMCommon' (0.43s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/main
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.72s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
Build of target: 'MLXLMCommon' complete! (0.82s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/linkable-paths.json
Target: MLXMNIST
Extracting symbol information for 'MLXMNIST'...
Finished extracting symbol information for 'MLXMNIST'. (1.61s)
Building documentation for 'MLXMNIST'...
Finished building documentation for 'MLXMNIST' (0.05s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/main
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.71s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/3] Emitting module Gzip
[3/3] Compiling Gzip Data+Gzip.swift
[4/7] Compiling MLXMNIST MNIST.swift
[5/7] Compiling MLXMNIST Random.swift
[6/7] Emitting module MLXMNIST
[7/7] Compiling MLXMNIST Files.swift
Build of target: 'MLXMNIST' complete! (1.48s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/linkable-paths.json
Target: MLXEmbedders
Extracting symbol information for 'MLXEmbedders'...
Finished extracting symbol information for 'MLXEmbedders'. (1.51s)
Building documentation for 'MLXEmbedders'...
warning: 'LanguageModel' doesn't exist at '/MLXEmbedders/BaseConfiguration'
--> Libraries/Embedders/BaseConfiguration.swift:5:12-5:25
3 | import Foundation
4 |
5 + /// Base ``LanguageModel`` configuration -- provides `modelType`
6 | /// and `quantization` (used in loading the model).
7 | ///
warning: 'ModelFactory' doesn't exist at '/MLXEmbedders/BaseConfiguration'
--> Libraries/Embedders/BaseConfiguration.swift:8:23-8:35
6 | /// and `quantization` (used in loading the model).
7 | ///
8 + /// This is used by ``ModelFactory/load(hub:configuration:progressHandler:)``
9 | /// to determine the type of model to load.
10 | public struct BaseConfiguration: Codable, Sendable {
Finished building documentation for 'MLXEmbedders' (0.10s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/main
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.71s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/11] Compiling MLXEmbedders Tokenizer.swift
[3/11] Compiling MLXEmbedders Pooling.swift
[4/11] Compiling MLXEmbedders EmbeddingModel.swift
[5/11] Compiling MLXEmbedders Configuration.swift
[6/11] Compiling MLXEmbedders BaseConfiguration.swift
[7/11] Compiling MLXEmbedders Load.swift
/Users/admin/builder/spi-builder-workspace/Libraries/Embedders/Load.swift:94:38: warning: 'quantization' is deprecated: Please use perLayerQuantization instead
92 | }
93 |
94 | if let quantization = baseConfig.quantization {
| `- warning: 'quantization' is deprecated: Please use perLayerQuantization instead
95 | quantize(model: model, groupSize: quantization.groupSize, bits: quantization.bits) {
96 | path, module in
[8/11] Compiling MLXEmbedders Models.swift
[9/11] Compiling MLXEmbedders Bert.swift
[10/11] Compiling MLXEmbedders NomicBert.swift
/Users/admin/builder/spi-builder-workspace/Libraries/Embedders/NomicBert.swift:315:14: warning: immutable value 'index' was never used; consider replacing with '_' or removing it
313 | func callAsFunction(_ inputs: MLXArray, attentionMask: MLXArray? = nil) -> MLXArray {
314 | var outputs = inputs
315 | for (index, layer) in layers.enumerated() {
| `- warning: immutable value 'index' was never used; consider replacing with '_' or removing it
316 | outputs = layer(outputs, mask: attentionMask)
317 | }
[11/11] Emitting module MLXEmbedders
Build of target: 'MLXEmbedders' complete! (1.39s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/linkable-paths.json
Target: StableDiffusion
Extracting symbol information for 'StableDiffusion'...
Finished extracting symbol information for 'StableDiffusion'. (1.47s)
Building documentation for 'StableDiffusion'...
warning: 'setConservativeMemory(_:)' doesn't exist at '/StableDiffusion/ModelContainer/performTwoStage(first:second:)'
--> Libraries/StableDiffusion/StableDiffusion.swift:180:14-180:39
178 | /// Perform a two stage action where the first stage returns values passed to the second stage.
179 | ///
180 + /// If ``setConservativeMemory(_:)`` is `true` this will discard the model in between
181 | /// the `first` and `second` blocks. The container will have to be recreated if a caller
182 | /// wants to use it again.
Finished building documentation for 'StableDiffusion' (0.11s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/main
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.72s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/11] Compiling StableDiffusion VAE.swift
[3/11] Compiling StableDiffusion Load.swift
[4/11] Compiling StableDiffusion Tokenizer.swift
[5/11] Compiling StableDiffusion StableDiffusion.swift
[6/11] Compiling StableDiffusion Sampler.swift
[7/11] Compiling StableDiffusion UNet.swift
/Users/admin/builder/spi-builder-workspace/Libraries/StableDiffusion/UNet.swift:134:13: warning: initialization of immutable value 'dtype' was never used; consider replacing with assignment to '_' or removing it
132 | ) -> MLXArray {
133 | let inputX = x
134 | let dtype = x.dtype
| `- warning: initialization of immutable value 'dtype' was never used; consider replacing with assignment to '_' or removing it
135 | var x = x
136 |
/Users/admin/builder/spi-builder-workspace/Libraries/StableDiffusion/UNet.swift:196:13: warning: initialization of immutable value 'dtype' was never used; consider replacing with assignment to '_' or removing it
194 |
195 | func callAsFunction(_ x: MLXArray, timeEmbedding: MLXArray? = nil) -> MLXArray {
196 | let dtype = x.dtype
| `- warning: initialization of immutable value 'dtype' was never used; consider replacing with assignment to '_' or removing it
197 |
198 | var y = norm1(x)
/Users/admin/builder/spi-builder-workspace/Libraries/StableDiffusion/UNet.swift:503:13: warning: initialization of immutable value 'dtype' was never used; consider replacing with assignment to '_' or removing it
501 |
502 | // postprocess the output
503 | let dtype = x.dtype
| `- warning: initialization of immutable value 'dtype' was never used; consider replacing with assignment to '_' or removing it
504 | x = convNormOut(x)
505 | x = silu(x)
[8/11] Compiling StableDiffusion Image.swift
/Users/admin/builder/spi-builder-workspace/Libraries/StableDiffusion/Image.swift:135:20: warning: immutable value 'C' was never used; consider replacing with '_' or removing it
133 |
134 | let arrayData = raster.asData()
135 | let (H, W, C) = raster.shape3
| `- warning: immutable value 'C' was never used; consider replacing with '_' or removing it
136 | let cs = CGColorSpace(name: CGColorSpace.sRGB)!
137 |
[9/11] Compiling StableDiffusion Clip.swift
[10/11] Emitting module StableDiffusion
[11/11] Compiling StableDiffusion Configuration.swift
Build of target: 'StableDiffusion' complete! (1.34s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/main/linkable-paths.json
4662
25 /Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/main
✅ Doc result (uploading) reported
========================================
SyncDocs
========================================
Doc archive source directory: $PWD/.docs/ml-explore/mlx-swift-examples/main
File count: 4662
Doc size: 25.0MB
Preparing doc bundle ...
Uploading prod-ml-explore-mlx-swift-examples-main-0d4ec73b.zip to s3://spi-docs-inbox/prod-ml-explore-mlx-swift-examples-main-0d4ec73b.zip
Copying... [10%]
Copying... [21%]
Copying... [30%]
Copying... [41%]
Copying... [51%]
Copying... [60%]
Copying... [71%]
Copying... [81%]
Copying... [90%]
Copying... [100%]
Done.