Build Information
Successful build of mlx-libraries, reference 2.25.4 (8e4131
), with Swift 6.1 for macOS (SPM) on 6 Jun 2025 19:07:07 UTC.
Swift 6 data race errors: 16
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
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):
[466/467] Compiling MLXVLM Qwen25VL.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Qwen25VL.swift:704:24: warning: no calls to throwing functions occur within 'try' expression
702 | }
703 | .map {
704 | return try MediaProcessing.resampleBicubic($0, to: resizedSize)
| `- warning: no calls to throwing functions occur within 'try' expression
705 | }
706 | .map {
[467/467] 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:178:14: warning: non-final class 'VLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
176 | /// configuration: VLMRegistry.paligemma3bMix4488bit)
177 | /// ```
178 | 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
179 |
180 | public init(
Build complete! (47.10s)
Build complete.
{
"dependencies" : [
{
"identity" : "mlx-swift",
"requirement" : {
"range" : [
{
"lower_bound" : "0.25.4",
"upper_bound" : "0.26.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/ml-explore/mlx-swift"
},
{
"identity" : "swift-transformers",
"requirement" : {
"range" : [
{
"lower_bound" : "0.1.21",
"upper_bound" : "0.2.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/huggingface/swift-transformers"
},
{
"identity" : "gzipswift",
"requirement" : {
"range" : [
{
"lower_bound" : "6.0.1",
"upper_bound" : "6.0.2"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/1024jp/GzipSwift"
}
],
"manifest_display_name" : "mlx-libraries",
"name" : "mlx-libraries",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
{
"name" : "macos",
"version" : "14.0"
},
{
"name" : "ios",
"version" : "16.0"
}
],
"products" : [
{
"name" : "MLXLLM",
"targets" : [
"MLXLLM"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "MLXVLM",
"targets" : [
"MLXVLM"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "MLXLMCommon",
"targets" : [
"MLXLMCommon"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "MLXMNIST",
"targets" : [
"MLXMNIST"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "MLXEmbedders",
"targets" : [
"MLXEmbedders"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "StableDiffusion",
"targets" : [
"StableDiffusion"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"targets" : [
{
"c99name" : "StableDiffusion",
"module_type" : "SwiftTarget",
"name" : "StableDiffusion",
"path" : "Libraries/StableDiffusion",
"product_dependencies" : [
"MLX",
"MLXNN",
"MLXRandom",
"Transformers"
],
"product_memberships" : [
"StableDiffusion"
],
"sources" : [
"Clip.swift",
"Configuration.swift",
"Image.swift",
"Load.swift",
"Sampler.swift",
"StableDiffusion.swift",
"Tokenizer.swift",
"UNet.swift",
"VAE.swift"
],
"type" : "library"
},
{
"c99name" : "MLXVLM",
"module_type" : "SwiftTarget",
"name" : "MLXVLM",
"path" : "Libraries/MLXVLM",
"product_dependencies" : [
"MLX",
"MLXFast",
"MLXNN",
"MLXOptimizers",
"MLXRandom",
"Transformers"
],
"product_memberships" : [
"MLXVLM"
],
"sources" : [
"MediaProcessing.swift",
"Models/Idefics3.swift",
"Models/Paligemma.swift",
"Models/Qwen25VL.swift",
"Models/Qwen2VL.swift",
"Models/QwenVL.swift",
"Models/SmolVLM2.swift",
"VLMModel.swift",
"VLMModelFactory.swift"
],
"target_dependencies" : [
"MLXLMCommon"
],
"type" : "library"
},
{
"c99name" : "MLXMNIST",
"module_type" : "SwiftTarget",
"name" : "MLXMNIST",
"path" : "Libraries/MLXMNIST",
"product_dependencies" : [
"MLX",
"MLXFast",
"MLXNN",
"MLXOptimizers",
"MLXRandom",
"Transformers",
"Gzip"
],
"product_memberships" : [
"MLXMNIST"
],
"sources" : [
"Files.swift",
"MNIST.swift",
"Random.swift"
],
"type" : "library"
},
{
"c99name" : "MLXLMTests",
"module_type" : "SwiftTarget",
"name" : "MLXLMTests",
"path" : "Tests/MLXLMTests",
"product_dependencies" : [
"MLX",
"MLXNN",
"MLXOptimizers",
"MLXRandom",
"Transformers"
],
"sources" : [
"BaseConfigurationTests.swift",
"EvalTests.swift",
"UserInputTests.swift"
],
"target_dependencies" : [
"MLXLMCommon",
"MLXLLM",
"MLXVLM"
],
"type" : "test"
},
{
"c99name" : "MLXLMCommon",
"module_type" : "SwiftTarget",
"name" : "MLXLMCommon",
"path" : "Libraries/MLXLMCommon",
"product_dependencies" : [
"MLX",
"MLXNN",
"MLXOptimizers",
"MLXRandom",
"Transformers"
],
"product_memberships" : [
"MLXLLM",
"MLXVLM",
"MLXLMCommon"
],
"sources" : [
"BaseConfiguration.swift",
"Chat.swift",
"Evaluate.swift",
"KVCache.swift",
"LanguageModel.swift",
"Load.swift",
"Lora.swift",
"ModelConfiguration.swift",
"ModelContainer.swift",
"ModelFactory.swift",
"Module+Extensions.swift",
"Registries/AbstractModelRegistry.swift",
"Registries/ModelTypeRegistry.swift",
"Registries/ProcessorTypeRegistry.swift",
"StringOrNumber.swift",
"Tokenizer.swift",
"UserInput.swift"
],
"type" : "library"
},
{
"c99name" : "MLXLLM",
"module_type" : "SwiftTarget",
"name" : "MLXLLM",
"path" : "Libraries/MLXLLM",
"product_dependencies" : [
"MLX",
"MLXFast",
"MLXNN",
"MLXOptimizers",
"MLXRandom",
"Transformers"
],
"product_memberships" : [
"MLXLLM"
],
"sources" : [
"LLMModel.swift",
"LLMModelFactory.swift",
"Lora+Data.swift",
"LoraTrain.swift",
"Models/Cohere.swift",
"Models/GLM4.swift",
"Models/Gemma.swift",
"Models/Gemma2.swift",
"Models/Granite.swift",
"Models/Internlm2.swift",
"Models/Llama.swift",
"Models/MiMo.swift",
"Models/OpenELM.swift",
"Models/Phi.swift",
"Models/Phi3.swift",
"Models/PhiMoE.swift",
"Models/Qwen2.swift",
"Models/Qwen3.swift",
"Models/Qwen3MoE.swift",
"Models/Starcoder2.swift",
"SuScaledRotaryEmbedding.swift",
"SwitchLayers.swift"
],
"target_dependencies" : [
"MLXLMCommon"
],
"type" : "library"
},
{
"c99name" : "MLXEmbedders",
"module_type" : "SwiftTarget",
"name" : "MLXEmbedders",
"path" : "Libraries/Embedders",
"product_dependencies" : [
"MLX",
"MLXFast",
"MLXNN",
"Transformers",
"MLXLinalg"
],
"product_memberships" : [
"MLXEmbedders"
],
"sources" : [
"BaseConfiguration.swift",
"Bert.swift",
"Configuration.swift",
"EmbeddingModel.swift",
"Load.swift",
"Models.swift",
"NomicBert.swift",
"Pooling.swift",
"Tokenizer.swift"
],
"type" : "library"
}
],
"tools_version" : "5.9"
}
✅ Doc result (pending) reported
========================================
GenerateDocs
========================================
Generating docs at path: $PWD/.docs/ml-explore/mlx-swift-examples/2.25.4
Repository: ml-explore/mlx-swift-examples
Swift version used: 6.1
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0")
Target: MLXLLM
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/swift-docc-render-artifact/.git/
From https://github.com/swiftlang/swift-docc-render-artifact
* branch 4633b45fc732d8c55568be09dd852f9dc1582c25 -> FETCH_HEAD
HEAD is now at 4633b45 Update the artifact
Cloned https://github.com/swiftlang/swift-docc-render-artifact
Extracting symbol information for 'MLXLLM'...
Finished extracting symbol information for 'MLXLLM'. (12.22s)
Building documentation for 'MLXLLM'...
warning: 'LoRALinear' doesn't exist at '/MLXLLM/LoRATrain/convert(model:layers:)'
--> ../LoraTrain.swift:154:24-154:34
152 |
153 | /// Freeze the model layers and replace the indicated modules (Linear) that should be
154 + /// converted to ``LoRALinear`` and remain trainable.
155 | ///
156 | /// Once a model has had the LoRA adapters applied, adapter weights can be loaded
warning: 'generate(promptTokens:parameters:model:tokenizer:additionalEOSTokens:didGenerate:)' doesn't exist at '/MLXLLM/LoRATrain/convert(model:layers:)'
--> ../LoraTrain.swift:168:34-168:116
166 | /// - loss evaluation with ``evaluate(model:dataset:loss:tokenizer:batchSize:batchCount:)``
167 | /// - fusing with ``fuse(model:layers:deQuantize:)``
168 + /// - text generation with ``generate(promptTokens:parameters:model:tokenizer:additionalEOSTokens:didGenerate:)``
169 | /// - note that this is just using normal model text generation
170 | ///
warning: Parameter 'layers' is missing documentation
--> ../LoraTrain.swift:202:84-202:84
200 | /// - Parameters:
201 | /// - model: model to convert
202 + /// - deQuantize: if `true` will convert `QuantizedLinear` back into `Linear`
| ╰─suggestion: Document 'layers' parameter
203 | public static func fuse(model: Module, layers: LoRALinearLayers, deQuantize: Bool = false) {
204 | for (layer, keys) in layers {
Finished building documentation for 'MLXLLM' (0.25s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/2.25.4
Updating https://github.com/apple/swift-collections.git
Updating https://github.com/apple/swift-numerics
Updating https://github.com/ml-explore/mlx-swift
Updating https://github.com/apple/swift-argument-parser.git
Updating https://github.com/1024jp/GzipSwift
Updating https://github.com/johnmai-dev/Jinja
Updating https://github.com/huggingface/swift-transformers
Updated https://github.com/ml-explore/mlx-swift (0.51s)
Updated https://github.com/apple/swift-numerics (0.52s)
Fetching https://github.com/apple/swift-docc-plugin
Updated https://github.com/apple/swift-collections.git (0.53s)
Updated https://github.com/1024jp/GzipSwift (0.58s)
Updated https://github.com/johnmai-dev/Jinja (0.58s)
Updated https://github.com/huggingface/swift-transformers (0.58s)
Updated https://github.com/apple/swift-argument-parser.git (0.58s)
[1/2068] Fetching swift-docc-plugin
Fetched https://github.com/apple/swift-docc-plugin from cache (1.17s)
Computing version for https://github.com/1024jp/GzipSwift
Computed https://github.com/1024jp/GzipSwift at 6.0.1 (2.29s)
Computing version for https://github.com/huggingface/swift-transformers
Computed https://github.com/huggingface/swift-transformers at 0.1.21 (0.46s)
Computing version for https://github.com/ml-explore/mlx-swift
Computed https://github.com/ml-explore/mlx-swift at 0.25.4 (0.49s)
Computing version for https://github.com/johnmai-dev/Jinja
Computed https://github.com/johnmai-dev/Jinja at 1.1.1 (0.46s)
Computing version for https://github.com/apple/swift-argument-parser.git
Computed https://github.com/apple/swift-argument-parser.git at 1.4.0 (0.44s)
Computing version for https://github.com/apple/swift-numerics
Computed https://github.com/apple/swift-numerics at 1.0.2 (0.53s)
Computing version for https://github.com/apple/swift-collections.git
Computed https://github.com/apple/swift-collections.git at 1.1.4 (0.62s)
Computing version for https://github.com/apple/swift-docc-plugin
Computed https://github.com/apple/swift-docc-plugin at 1.4.4 (0.57s)
Fetching https://github.com/swiftlang/swift-docc-symbolkit from cache
Fetched https://github.com/swiftlang/swift-docc-symbolkit from cache (0.83s)
Computing version for https://github.com/swiftlang/swift-docc-symbolkit
Computed https://github.com/swiftlang/swift-docc-symbolkit at 1.0.0 (1.48s)
Creating working copy for https://github.com/swiftlang/swift-docc-symbolkit
Working copy of https://github.com/swiftlang/swift-docc-symbolkit resolved at 1.0.0
Creating working copy for https://github.com/apple/swift-docc-plugin
Working copy of https://github.com/apple/swift-docc-plugin resolved at 1.4.4
Building for debugging...
[0/8] Write sources
[1/8] Write snippet-extract-tool-entitlement.plist
[3/8] Write sources
[4/8] Write swift-version-2F0A5646E1D333AE.txt
[6/53] Compiling SymbolKit GenericConstraint.swift
[7/53] Compiling SymbolKit GenericParameter.swift
[8/53] Compiling SymbolKit Generics.swift
[9/53] Compiling SymbolKit Namespace.swift
[10/57] Compiling SymbolKit Identifier.swift
[11/57] Compiling SymbolKit KindIdentifier.swift
[12/57] Compiling SymbolKit Location.swift
[13/57] Compiling SymbolKit Mutability.swift
[14/57] Emitting module SymbolKit
[15/57] Compiling SymbolKit Mixin+Equals.swift
[16/57] Compiling SymbolKit Mixin+Hash.swift
[17/57] Compiling SymbolKit Mixin.swift
[18/57] Compiling SymbolKit LineList.swift
[19/57] Compiling SymbolKit Position.swift
[20/57] Compiling SymbolKit DeclarationFragments.swift
[21/57] Compiling SymbolKit Fragment.swift
[22/57] Compiling SymbolKit FragmentKind.swift
[23/57] Compiling SymbolKit FunctionParameter.swift
[24/57] Compiling SymbolKit FunctionSignature.swift
[25/57] Compiling SymbolKit SemanticVersion.swift
[26/57] Compiling SymbolKit AccessControl.swift
[27/57] Compiling SymbolKit Availability.swift
[28/57] Compiling SymbolKit AvailabilityItem.swift
[29/57] Compiling SymbolKit Domain.swift
[30/57] Compiling SymbolKit Names.swift
[31/57] Compiling SymbolKit SPI.swift
[32/57] Compiling SymbolKit Snippet.swift
[33/57] Compiling SymbolKit Extension.swift
[34/57] Compiling SymbolKit Relationship.swift
[35/57] Compiling SymbolKit RelationshipKind.swift
[36/57] Compiling SymbolKit SourceOrigin.swift
[37/57] Compiling SymbolKit GenericConstraints.swift
[38/57] Compiling SymbolKit Swift.swift
[39/57] Compiling SymbolKit SourceRange.swift
[40/57] Compiling SymbolKit Metadata.swift
[41/57] Compiling SymbolKit Module.swift
[42/57] Compiling SymbolKit OperatingSystem.swift
[43/57] Compiling SymbolKit Platform.swift
[44/57] Compiling SymbolKit Symbol.swift
[45/57] Compiling SymbolKit SymbolKind.swift
[46/57] Compiling SymbolKit SymbolGraph.swift
[47/57] Compiling SymbolKit GraphCollector.swift
[48/57] Compiling SymbolKit UnifiedSymbol+Encodable.swift
[49/57] Compiling SymbolKit UnifiedSymbol.swift
[50/57] Compiling SymbolKit UnifiedSymbolGraph+Encodable.swift
[51/57] Compiling SymbolKit UnifiedSymbolGraph.swift
[52/57] Compiling Snippets Snippet.swift
[53/57] Emitting module Snippets
[54/57] Compiling Snippets SnippetParser.swift
[55/61] Compiling snippet_extract URL+Status.swift
[56/61] Compiling snippet_extract SymbolGraph+Snippet.swift
[57/61] Emitting module snippet_extract
[58/61] Compiling snippet_extract SnippetBuildCommand.swift
[58/61] Write Objects.LinkFileList
[59/61] Linking snippet-extract-tool
[60/61] Applying snippet-extract-tool
Build of product 'snippet-extract' complete! (4.16s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/46] Compiling RealModule Float80+Real.swift
[3/46] Compiling RealModule Real.swift
[4/47] Compiling InternalCollectionsUtilities RandomAccessCollection+Offsets.swift
[5/47] Compiling InternalCollectionsUtilities Specialize.swift
[6/47] Compiling InternalCollectionsUtilities UnsafeBufferPointer+Extras.swift
[7/48] Compiling InternalCollectionsUtilities UnsafeMutableBufferPointer+SE-0370.swift
[8/48] Compiling InternalCollectionsUtilities UnsafeMutablePointer+SE-0370.swift
[9/48] Compiling RealModule Float16+Real.swift
[10/48] Compiling RealModule RealFunctions.swift
[11/48] Compiling InternalCollectionsUtilities _SortedCollection.swift
[12/48] Compiling InternalCollectionsUtilities _UniqueCollection.swift
[13/48] Compiling InternalCollectionsUtilities Debugging.swift
[14/48] Compiling InternalCollectionsUtilities Descriptions.swift
[15/48] Compiling RealModule Float+Real.swift
[16/48] Compiling RealModule ElementaryFunctions.swift
[17/48] Compiling RealModule AugmentedArithmetic.swift
[18/48] Compiling RealModule ApproximateEquality.swift
[19/48] Compiling RealModule AlgebraicField.swift
[20/48] Compiling RealModule Double+Real.swift
[21/48] Compiling InternalCollectionsUtilities UnsafeMutableBufferPointer+Extras.swift
[22/48] Emitting module RealModule
[23/48] Compiling InternalCollectionsUtilities UnsafeRawPointer extensions.swift
[24/48] Compiling InternalCollectionsUtilities FixedWidthInteger+roundUpToPowerOfTwo.swift
[25/48] Compiling InternalCollectionsUtilities Integer rank.swift
[26/48] Compiling InternalCollectionsUtilities UInt+first and last set bit.swift
[27/48] Compiling Hub resource_bundle_accessor.swift
[28/48] Emitting module InternalCollectionsUtilities
[29/53] Compiling TensorUtils MLShapedArray+Utils.swift
[30/53] Compiling TensorUtils TopPLogitsWarper.swift
[31/53] Compiling TensorUtils MLMultiArray+Utils.swift
[32/53] Compiling TensorUtils TopKLogitsWarper.swift
[33/53] Compiling TensorUtils RepetitionPenaltyWarper.swift
[34/53] Compiling TensorUtils TemperatureLogitsWarper.swift
[35/53] Compiling TensorUtils LogitsWarper.swift
[36/53] Compiling TensorUtils LogitsProcessor.swift
[37/53] Emitting module TensorUtils
[38/53] Compiling TensorUtils Math.swift
[39/54] Emitting module Hub
[40/54] Compiling Hub BinaryDistinct.swift
[41/54] Compiling InternalCollectionsUtilities UInt+reversed.swift
[42/54] Compiling InternalCollectionsUtilities _UnsafeBitSet+Index.swift
[43/54] Compiling InternalCollectionsUtilities _UnsafeBitSet+_Word.swift
[44/54] Compiling InternalCollectionsUtilities _UnsafeBitSet.swift
[45/54] Compiling Hub Config.swift
[46/54] Compiling Hub Downloader.swift
[47/107] Compiling TensorUtils Weights.swift
[48/110] Compiling ComplexModule Differentiable.swift
[49/110] Compiling ComplexModule Complex.swift
[50/110] Compiling ComplexModule Arithmetic.swift
[51/110] Emitting module ComplexModule
[52/110] Compiling ComplexModule ElementaryFunctions.swift
[53/110] Compiling OrderedCollections OrderedSet+Partial SetAlgebra formIntersection.swift
[54/110] Compiling OrderedCollections OrderedSet+Partial SetAlgebra formSymmetricDifference.swift
[55/110] Compiling OrderedCollections OrderedSet+Partial SetAlgebra formUnion.swift
[56/110] Compiling OrderedCollections OrderedSet+Partial SetAlgebra intersection.swift
[57/110] Compiling OrderedCollections OrderedSet+Partial SetAlgebra isDisjoint.swift
[58/110] Compiling OrderedCollections OrderedSet+Partial SetAlgebra isEqualSet.swift
[59/118] Compiling OrderedCollections _Hashtable+Header.swift
[60/118] Compiling OrderedCollections OrderedDictionary+Codable.swift
[61/118] Compiling OrderedCollections OrderedDictionary+CustomReflectable.swift
[62/118] Compiling OrderedCollections OrderedDictionary+Deprecations.swift
[63/118] Compiling OrderedCollections OrderedDictionary+Descriptions.swift
[64/118] Compiling OrderedCollections OrderedDictionary+Elements.SubSequence.swift
[65/118] Compiling OrderedCollections OrderedDictionary+Elements.swift
[66/118] Compiling OrderedCollections OrderedDictionary+Equatable.swift
[67/118] Compiling OrderedCollections OrderedDictionary+ExpressibleByDictionaryLiteral.swift
[68/118] Compiling OrderedCollections OrderedDictionary+Hashable.swift
[69/118] Compiling OrderedCollections OrderedDictionary+Initializers.swift
[70/118] Compiling OrderedCollections OrderedDictionary+Invariants.swift
[71/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra isStrictSubset.swift
[72/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra isStrictSuperset.swift
[73/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra isSubset.swift
[74/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra isSuperset.swift
[75/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra subtract.swift
[76/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra subtracting.swift
[77/118] Compiling OrderedCollections OrderedSet+Codable.swift
[78/118] Compiling OrderedCollections OrderedSet+CustomReflectable.swift
[79/118] Compiling OrderedCollections OrderedSet+Descriptions.swift
[80/118] Compiling OrderedCollections OrderedSet+Diffing.swift
[81/118] Compiling OrderedCollections OrderedSet+Equatable.swift
[82/118] Compiling OrderedCollections OrderedSet+ExpressibleByArrayLiteral.swift
[83/118] Compiling OrderedCollections OrderedSet+Hashable.swift
[84/118] Compiling OrderedCollections OrderedSet+Initializers.swift
[85/118] Compiling OrderedCollections OrderedSet+Insertions.swift
[86/118] Compiling OrderedCollections OrderedSet+Invariants.swift
[87/118] Compiling OrderedCollections OrderedSet+Partial MutableCollection.swift
[88/118] Compiling OrderedCollections OrderedSet+Partial RangeReplaceableCollection.swift
[89/118] Emitting module Numerics
[90/118] Compiling Numerics Numerics.swift
[91/118] Compiling OrderedCollections OrderedDictionary+Partial MutableCollection.swift
[92/118] Compiling OrderedCollections OrderedDictionary+Partial RangeReplaceableCollection.swift
[93/118] Compiling OrderedCollections OrderedDictionary+Sendable.swift
[94/118] Compiling OrderedCollections OrderedDictionary+Sequence.swift
[95/118] Compiling OrderedCollections OrderedDictionary+Values.swift
[96/118] Compiling OrderedCollections OrderedDictionary.swift
[97/118] Compiling Hub Hub.swift
[98/118] Compiling Hub HubApi.swift
[99/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra symmetricDifference.swift
[100/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra union.swift
[101/118] Compiling OrderedCollections OrderedSet+Partial SetAlgebra+Basics.swift
[102/118] Compiling OrderedCollections OrderedSet+RandomAccessCollection.swift
[103/118] Compiling OrderedCollections OrderedSet+ReserveCapacity.swift
[104/118] Compiling OrderedCollections OrderedSet+Sendable.swift
[105/118] Compiling OrderedCollections _HashTable+Bucket.swift
[106/118] Compiling OrderedCollections _HashTable+BucketIterator.swift
[107/118] Compiling OrderedCollections _HashTable+Constants.swift
[108/118] Compiling OrderedCollections _HashTable+CustomStringConvertible.swift
[109/118] Compiling OrderedCollections _HashTable+Testing.swift
[110/118] Compiling OrderedCollections _HashTable+UnsafeHandle.swift
[111/118] Compiling OrderedCollections _HashTable.swift
[112/148] Compiling OrderedCollections OrderedSet+SubSequence.swift
[113/148] Compiling OrderedCollections OrderedSet+Testing.swift
[114/148] Compiling OrderedCollections OrderedSet+UnorderedView.swift
[115/148] Compiling OrderedCollections OrderedSet+UnstableInternals.swift
[116/148] Compiling OrderedCollections OrderedSet.swift
[117/148] Compiling OrderedCollections _UnsafeBitset.swift
[118/148] Emitting module OrderedCollections
[119/148] Compiling MLX Stream.swift
[120/148] Compiling MLX Transforms+Compile.swift
[121/148] Compiling MLX Transforms+Eval.swift
[122/148] Compiling MLX Foundation+Util.swift
[123/148] Compiling MLX GPU.swift
[124/148] Compiling MLX IO.swift
[125/161] Compiling MLX ArrayAt.swift
[126/161] Compiling MLX Cmlx+Util.swift
[127/161] Compiling MLX DType.swift
[128/161] Compiling MLX Device.swift
[129/161] Emitting module MLX
[130/161] Compiling MLX Transforms+Grad.swift
[131/161] Compiling MLX Transforms+Internal.swift
[132/161] Compiling MLX Transforms.swift
[133/161] Compiling MLX Ops+Array.swift
[134/161] Compiling MLX Ops.swift
[135/161] Compiling MLX ParameterTypes.swift
[136/161] Compiling Jinja Template.swift
[137/161] Compiling Jinja Utilities.swift
[138/161] Compiling MLX MLXArray+Init.swift
[139/161] Compiling MLX MLXArray+Ops.swift
[140/161] Compiling MLX MLXArray.swift
[141/161] Compiling MLX ErrorHandler.swift
[142/161] Compiling MLX Export.swift
[143/161] Compiling MLX FFT.swift
[144/161] Compiling MLX Factory.swift
[145/161] Compiling Jinja Parser.swift
[146/161] Compiling Jinja StringExtension.swift
[147/161] Compiling Jinja Error.swift
[148/161] Compiling Jinja Runtime.swift
[149/161] Compiling Jinja Lexer.swift
[150/161] Compiling MLX MLXFast.swift
[151/161] Compiling MLX MLXFastKernel.swift
[152/161] Compiling MLX Nested.swift
[153/161] Compiling MLX Protocols.swift
[154/161] Compiling MLX Random.swift
[155/161] Compiling MLX State.swift
[156/161] Compiling MLX Linalg.swift
[157/161] Compiling MLX MLXArray+Bytes.swift
[158/161] Compiling MLX MLXArray+Indexing.swift
[159/166] Compiling MLXFast MLXFastKernel.swift
[160/166] Compiling MLXFast MLXFast.swift
[161/166] Emitting module MLXFast
[162/166] Compiling MLXRandom Random.swift
[163/166] Emitting module MLXRandom
[164/166] Compiling Jinja Ast.swift
[165/166] Emitting module Jinja
[166/166] Compiling Jinja Environment.swift
[167/196] Compiling Tokenizers Trie.swift
[168/196] Compiling Tokenizers UnigramTokenizer.swift
[169/197] Compiling MLXNN Upsample.swift
[170/198] Compiling Tokenizers Normalizer.swift
[171/198] Compiling MLXNN PositionalEncoding.swift
[172/198] Compiling MLXNN Quantized.swift
[173/198] Compiling Tokenizers ByteEncoder.swift
[174/198] Compiling Tokenizers Decoder.swift
[175/198] Compiling Tokenizers BPETokenizer.swift
[176/198] Compiling Tokenizers BertTokenizer.swift
[177/198] Emitting module Tokenizers
[178/198] Compiling Tokenizers TokenLattice.swift
[179/198] Compiling Tokenizers Tokenizer.swift
[180/198] Compiling Tokenizers PostProcessor.swift
[181/198] Compiling Tokenizers PreTokenizer.swift
[182/198] Compiling Tokenizers Utils.swift
[183/198] Compiling MLXNN ValueAndGrad.swift
[184/201] Compiling MLXNN Recurrent.swift
[185/201] Compiling MLXNN Transformer.swift
[186/201] Compiling MLXNN Normalization.swift
[187/201] Compiling MLXNN Pooling.swift
[188/201] Compiling MLXNN ConvolutionTransposed.swift
[189/201] Compiling MLXNN Dropout.swift
[190/201] Compiling MLXNN Containers.swift
[191/201] Compiling MLXNN Convolution.swift
[194/201] Compiling MLXNN Losses.swift
[195/201] Compiling MLXNN Module.swift
[196/201] Emitting module MLXNN
[199/203] Compiling Generation GenerationConfig.swift
[200/203] Emitting module Generation
[201/203] Compiling Generation Generation.swift
[202/206] Compiling Models LanguageModelTypes.swift
[203/206] Emitting module MLXOptimizers
[204/206] Compiling MLXOptimizers Optimizers.swift
[205/206] Emitting module Models
[206/206] Compiling Models LanguageModel.swift
[207/223] Compiling MLXLMCommon StringOrNumber.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:50:26: warning: immutable value 'string' was never used; consider replacing with '_' or removing it
48 | public func asInts() -> [Int]? {
49 | switch self {
50 | case .string(let string): nil
| `- warning: immutable value 'string' was never used; consider replacing with '_' or removing it
51 | case .int(let v): [v]
52 | case .float(let float): nil
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:52:25: warning: immutable value 'float' was never used; consider replacing with '_' or removing it
50 | case .string(let string): nil
51 | case .int(let v): [v]
52 | case .float(let float): nil
| `- warning: immutable value 'float' was never used; consider replacing with '_' or removing it
53 | case .ints(let array): array
54 | case .floats(let array): nil
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:54:26: warning: immutable value 'array' was never used; consider replacing with '_' or removing it
52 | case .float(let float): nil
53 | case .ints(let array): array
54 | case .floats(let array): nil
| `- warning: immutable value 'array' was never used; consider replacing with '_' or removing it
55 | }
56 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:63:26: warning: immutable value 'string' was never used; consider replacing with '_' or removing it
61 | public func asInt() -> Int? {
62 | switch self {
63 | case .string(let string): nil
| `- warning: immutable value 'string' was never used; consider replacing with '_' or removing it
64 | case .int(let v): v
65 | case .float(let float): nil
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:65:25: warning: immutable value 'float' was never used; consider replacing with '_' or removing it
63 | case .string(let string): nil
64 | case .int(let v): v
65 | case .float(let float): nil
| `- warning: immutable value 'float' was never used; consider replacing with '_' or removing it
66 | case .ints(let array): array.count == 1 ? array[0] : nil
67 | case .floats(let array): nil
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:67:26: warning: immutable value 'array' was never used; consider replacing with '_' or removing it
65 | case .float(let float): nil
66 | case .ints(let array): array.count == 1 ? array[0] : nil
67 | case .floats(let array): nil
| `- warning: immutable value 'array' was never used; consider replacing with '_' or removing it
68 | }
69 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:76:26: warning: immutable value 'string' was never used; consider replacing with '_' or removing it
74 | public func asFloats() -> [Float]? {
75 | switch self {
76 | case .string(let string): nil
| `- warning: immutable value 'string' was never used; consider replacing with '_' or removing it
77 | case .int(let v): [Float(v)]
78 | case .float(let float): [float]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/StringOrNumber.swift:89:26: warning: immutable value 'string' was never used; consider replacing with '_' or removing it
87 | public func asFloat() -> Float? {
88 | switch self {
89 | case .string(let string): nil
| `- warning: immutable value 'string' was never used; consider replacing with '_' or removing it
90 | case .int(let v): Float(v)
91 | case .float(let float): float
[208/223] Compiling MLXLMCommon Tokenizer.swift
[209/223] Compiling MLXLMCommon ModelTypeRegistry.swift
[210/223] Compiling MLXLMCommon ProcessorTypeRegistry.swift
[211/224] Compiling MLXLMCommon UserInput.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:26:14: warning: associated value 'messages' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
24 |
25 | /// model specific array of dictionaries
26 | case messages([Message])
| `- warning: associated value 'messages' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
27 |
28 | /// model agnostic structured chat (series of messages)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:29:14: warning: associated value 'chat' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Chat.Message'; this is an error in the Swift 6 language mode
27 |
28 | /// model agnostic structured chat (series of messages)
29 | case chat([Chat.Message])
| `- warning: associated value 'chat' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Chat.Message'; this is an error in the Swift 6 language mode
30 |
31 | public var description: String {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Chat.swift:4:19: note: consider making struct 'Message' conform to the 'Sendable' protocol
2 |
3 | public enum Chat {
4 | public struct Message {
| `- note: consider making struct 'Message' conform to the 'Sendable' protocol
5 | /// The role of the message sender.
6 | public var role: Role
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:45:14: warning: associated value 'avAsset' of 'Sendable'-conforming enum 'Video' has non-sendable type 'AVAsset'; this is an error in the Swift 6 language mode
43 | /// Representation of a video resource.
44 | public enum Video: Sendable {
45 | case avAsset(AVAsset)
| `- warning: associated value 'avAsset' of 'Sendable'-conforming enum 'Video' has non-sendable type 'AVAsset'; this is an error in the Swift 6 language mode
46 | case url(URL)
47 |
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsset.h:62:12: note: class 'AVAsset' does not conform to the 'Sendable' protocol
60 |
61 | API_AVAILABLE(macos(10.7), ios(4.0), tvos(9.0), watchos(1.0), visionos(1.0))
62 | @interface AVAsset : NSObject <NSCopying, AVAsynchronousKeyValueLoading>
| `- note: class 'AVAsset' does not conform to the 'Sendable' protocol
63 | {
64 | @private
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:3:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'AVFoundation'
1 | // Copyright © 2024 Apple Inc.
2 |
3 | import AVFoundation
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'AVFoundation'
4 | import CoreImage
5 | import Foundation
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:60:14: warning: associated value 'ciImage' of 'Sendable'-conforming enum 'Image' has non-sendable type 'CIImage'; this is an error in the Swift 6 language mode
58 | /// Representation of an image resource.
59 | public enum Image: Sendable {
60 | case ciImage(CIImage)
| `- warning: associated value 'ciImage' of 'Sendable'-conforming enum 'Image' has non-sendable type 'CIImage'; this is an error in the Swift 6 language mode
61 | case url(URL)
62 | case array(MLXArray)
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:34:12: note: class 'CIImage' does not conform to the 'Sendable' protocol
32 |
33 | NS_CLASS_AVAILABLE(10_4, 5_0)
34 | @interface CIImage : NSObject <NSSecureCoding, NSCopying>
| `- note: class 'CIImage' does not conform to the 'Sendable' protocol
35 | {
36 | #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:4:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
2 |
3 | import AVFoundation
4 | import CoreImage
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
5 | import Foundation
6 | import MLX
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:62:14: warning: associated value 'array' of 'Sendable'-conforming enum 'Image' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
60 | case ciImage(CIImage)
61 | case url(URL)
62 | case array(MLXArray)
| `- warning: associated value 'array' of 'Sendable'-conforming enum 'Image' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
63 |
64 | public func asCIImage() throws -> CIImage {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:6:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
4 | import CoreImage
5 | import Foundation
6 | import MLX
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
7 | import Tokenizers
8 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:162:16: warning: stored property 'tools' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[ToolSpec]?' (aka 'Optional<Array<Dictionary<String, Any>>>'); this is an error in the Swift 6 language mode
160 | public var videos = [Video]()
161 |
162 | public var tools: [ToolSpec]?
| `- warning: stored property 'tools' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[ToolSpec]?' (aka 'Optional<Array<Dictionary<String, Any>>>'); this is an error in the Swift 6 language mode
163 |
164 | /// Additional values provided for the chat template rendering context
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:165:16: warning: stored property 'additionalContext' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[String : Any]?'; this is an error in the Swift 6 language mode
163 |
164 | /// Additional values provided for the chat template rendering context
165 | public var additionalContext: [String: Any]?
| `- warning: stored property 'additionalContext' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[String : Any]?'; this is an error in the Swift 6 language mode
166 | public var processing: Processing = .init()
167 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:111:28: warning: immutable value 'C' was never used; consider replacing with '_' or removing it
109 |
110 | let arrayData = array.asData()
111 | let (H, W, C) = array.shape3
| `- warning: immutable value 'C' was never used; consider replacing with '_' or removing it
112 | let cs = CGColorSpace(name: CGColorSpace.sRGB)!
113 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:107:21: warning: code after 'throw' will never be executed
105 | throw UserInputError.arrayError(
106 | "channel dimension must be last and 3/4: \(array.shape)")
107 | break
| `- warning: code after 'throw' will never be executed
108 | }
109 |
[212/224] Compiling MLXLMCommon Module+Extensions.swift
[213/224] Compiling MLXLMCommon AbstractModelRegistry.swift
[214/224] Compiling MLXLMCommon BaseConfiguration.swift
[215/224] Compiling MLXLMCommon Chat.swift
[216/224] Compiling MLXLMCommon ModelContainer.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:65:19: warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
61 | /// Perform an action on the ``ModelContext``. Callers _must_ eval any `MLXArray` before returning as
62 | /// `MLXArray` is not `Sendable`.
63 | public func perform<R>(_ action: @Sendable (ModelContext) async throws -> R) async rethrows -> R
| `- note: consider making generic parameter 'R' conform to the 'Sendable' protocol
64 | {
65 | try await action(context)
| `- warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
66 | }
67 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:74:19: warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
69 | /// Callers _must_ eval any `MLXArray` before returning as
70 | /// `MLXArray` is not `Sendable`.
71 | public func perform<V, R>(
| `- note: consider making generic parameter 'R' conform to the 'Sendable' protocol
72 | values: V, _ action: @Sendable (ModelContext, V) async throws -> R
73 | ) async rethrows -> R {
74 | try await action(context, values)
| `- warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
75 | }
76 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:65:19: warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
63 | public func perform<R>(_ action: @Sendable (ModelContext) async throws -> R) async rethrows -> R
64 | {
65 | try await action(context)
| |- warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type 'ModelContext' to nonisolated callee risks causing races in between 'self'-isolated and nonisolated uses
66 | }
67 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:74:19: warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
72 | values: V, _ action: @Sendable (ModelContext, V) async throws -> R
73 | ) async rethrows -> R {
74 | try await action(context, values)
| |- warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type 'ModelContext' to nonisolated callee risks causing races in between 'self'-isolated and nonisolated uses
75 | }
76 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:74:19: warning: sending 'values' risks causing data races; this is an error in the Swift 6 language mode
72 | values: V, _ action: @Sendable (ModelContext, V) async throws -> R
73 | ) async rethrows -> R {
74 | try await action(context, values)
| |- warning: sending 'values' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'values' to nonisolated callee risks causing data races between nonisolated and 'self'-isolated uses
75 | }
76 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelFactory.swift:114:16: warning: sending 'context' risks causing data races; this is an error in the Swift 6 language mode
112 | let context = try await _load(
113 | hub: hub, configuration: configuration, progressHandler: progressHandler)
114 | return ModelContainer(context: context)
| |- warning: sending 'context' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'context' to actor-isolated callee risks causing data races between actor-isolated and task-isolated uses
115 | }
116 |
[217/224] Compiling MLXLMCommon ModelFactory.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:65:19: warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
61 | /// Perform an action on the ``ModelContext``. Callers _must_ eval any `MLXArray` before returning as
62 | /// `MLXArray` is not `Sendable`.
63 | public func perform<R>(_ action: @Sendable (ModelContext) async throws -> R) async rethrows -> R
| `- note: consider making generic parameter 'R' conform to the 'Sendable' protocol
64 | {
65 | try await action(context)
| `- warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
66 | }
67 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:74:19: warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
69 | /// Callers _must_ eval any `MLXArray` before returning as
70 | /// `MLXArray` is not `Sendable`.
71 | public func perform<V, R>(
| `- note: consider making generic parameter 'R' conform to the 'Sendable' protocol
72 | values: V, _ action: @Sendable (ModelContext, V) async throws -> R
73 | ) async rethrows -> R {
74 | try await action(context, values)
| `- warning: non-sendable result type 'R' cannot be sent from nonisolated context in call to parameter 'action'; this is an error in the Swift 6 language mode
75 | }
76 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:65:19: warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
63 | public func perform<R>(_ action: @Sendable (ModelContext) async throws -> R) async rethrows -> R
64 | {
65 | try await action(context)
| |- warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type 'ModelContext' to nonisolated callee risks causing races in between 'self'-isolated and nonisolated uses
66 | }
67 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:74:19: warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
72 | values: V, _ action: @Sendable (ModelContext, V) async throws -> R
73 | ) async rethrows -> R {
74 | try await action(context, values)
| |- warning: sending value of non-Sendable type 'ModelContext' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated value of non-Sendable type 'ModelContext' to nonisolated callee risks causing races in between 'self'-isolated and nonisolated uses
75 | }
76 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelContainer.swift:74:19: warning: sending 'values' risks causing data races; this is an error in the Swift 6 language mode
72 | values: V, _ action: @Sendable (ModelContext, V) async throws -> R
73 | ) async rethrows -> R {
74 | try await action(context, values)
| |- warning: sending 'values' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'self'-isolated 'values' to nonisolated callee risks causing data races between nonisolated and 'self'-isolated uses
75 | }
76 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/ModelFactory.swift:114:16: warning: sending 'context' risks causing data races; this is an error in the Swift 6 language mode
112 | let context = try await _load(
113 | hub: hub, configuration: configuration, progressHandler: progressHandler)
114 | return ModelContainer(context: context)
| |- warning: sending 'context' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated 'context' to actor-isolated callee risks causing data races between actor-isolated and task-isolated uses
115 | }
116 |
[218/224] Emitting module MLXLMCommon
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:115:9: warning: stored property 'temp' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
113 | /// Sampler that uses `topP` and `temperature` to sample the logits.
114 | public struct TopPSampler: LogitSampler {
115 | let temp: MLXArray
| `- warning: stored property 'temp' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
116 | let topP: MLXArray
117 |
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:4:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
2 |
3 | import Foundation
4 | import MLX
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
5 | import Tokenizers
6 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:116:9: warning: stored property 'topP' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
114 | public struct TopPSampler: LogitSampler {
115 | let temp: MLXArray
116 | let topP: MLXArray
| `- warning: stored property 'topP' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
117 |
118 | public init(temperature: Float, topP: Float) {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:123:17: warning: stored property 'compiledTopPSampling' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type '(MLXArray, MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
121 | }
122 |
123 | private let compiledTopPSampling: (MLXArray, MLXArray, MLXArray) -> MLXArray = {
| |- warning: stored property 'compiledTopPSampling' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type '(MLXArray, MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
124 | compile(inputs: [MLXRandom.globalState], outputs: [MLXRandom.globalState]) {
125 | logits, topP, temp in
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:154:9: warning: stored property 'temp' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
152 | /// Processor that uses `temperature` to sample the logits
153 | public struct CategoricalSampler: LogitSampler {
154 | let temp: MLXArray
| `- warning: stored property 'temp' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
155 |
156 | public init(temperature: Float) {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:160:17: warning: stored property 'compiledCategorical' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type '(MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
158 | }
159 |
160 | private let compiledCategorical: (MLXArray, MLXArray) -> MLXArray = {
| |- warning: stored property 'compiledCategorical' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type '(MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
161 | compile(inputs: [MLXRandom.globalState], outputs: [MLXRandom.globalState]) { logits, temp in
162 | categorical(logits * (1 / temp))
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:421:16: warning: stored property 'inputText' of 'Sendable'-conforming struct 'GenerateResult' has non-sendable type 'LMInput.Text'; this is an error in the Swift 6 language mode
419 |
420 | /// input (prompt, images, etc.)
421 | public let inputText: LMInput.Text
| `- warning: stored property 'inputText' of 'Sendable'-conforming struct 'GenerateResult' has non-sendable type 'LMInput.Text'; this is an error in the Swift 6 language mode
422 |
423 | @available(*, deprecated, message: "use inputText")
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/LanguageModel.swift:43:19: note: consider making struct 'Text' conform to the 'Sendable' protocol
41 |
42 | /// Representation of tokenized input text.
43 | public struct Text {
| `- note: consider making struct 'Text' conform to the 'Sendable' protocol
44 |
45 | /// input token array
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:26:14: warning: associated value 'messages' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
24 |
25 | /// model specific array of dictionaries
26 | case messages([Message])
| `- warning: associated value 'messages' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Any'; this is an error in the Swift 6 language mode
27 |
28 | /// model agnostic structured chat (series of messages)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:29:14: warning: associated value 'chat' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Chat.Message'; this is an error in the Swift 6 language mode
27 |
28 | /// model agnostic structured chat (series of messages)
29 | case chat([Chat.Message])
| `- warning: associated value 'chat' of 'Sendable'-conforming enum 'Prompt' has non-sendable type 'Chat.Message'; this is an error in the Swift 6 language mode
30 |
31 | public var description: String {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Chat.swift:4:19: note: consider making struct 'Message' conform to the 'Sendable' protocol
2 |
3 | public enum Chat {
4 | public struct Message {
| `- note: consider making struct 'Message' conform to the 'Sendable' protocol
5 | /// The role of the message sender.
6 | public var role: Role
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:45:14: warning: associated value 'avAsset' of 'Sendable'-conforming enum 'Video' has non-sendable type 'AVAsset'; this is an error in the Swift 6 language mode
43 | /// Representation of a video resource.
44 | public enum Video: Sendable {
45 | case avAsset(AVAsset)
| `- warning: associated value 'avAsset' of 'Sendable'-conforming enum 'Video' has non-sendable type 'AVAsset'; this is an error in the Swift 6 language mode
46 | case url(URL)
47 |
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsset.h:62:12: note: class 'AVAsset' does not conform to the 'Sendable' protocol
60 |
61 | API_AVAILABLE(macos(10.7), ios(4.0), tvos(9.0), watchos(1.0), visionos(1.0))
62 | @interface AVAsset : NSObject <NSCopying, AVAsynchronousKeyValueLoading>
| `- note: class 'AVAsset' does not conform to the 'Sendable' protocol
63 | {
64 | @private
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:3:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'AVFoundation'
1 | // Copyright © 2024 Apple Inc.
2 |
3 | import AVFoundation
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'AVFoundation'
4 | import CoreImage
5 | import Foundation
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:60:14: warning: associated value 'ciImage' of 'Sendable'-conforming enum 'Image' has non-sendable type 'CIImage'; this is an error in the Swift 6 language mode
58 | /// Representation of an image resource.
59 | public enum Image: Sendable {
60 | case ciImage(CIImage)
| `- warning: associated value 'ciImage' of 'Sendable'-conforming enum 'Image' has non-sendable type 'CIImage'; this is an error in the Swift 6 language mode
61 | case url(URL)
62 | case array(MLXArray)
/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:34:12: note: class 'CIImage' does not conform to the 'Sendable' protocol
32 |
33 | NS_CLASS_AVAILABLE(10_4, 5_0)
34 | @interface CIImage : NSObject <NSSecureCoding, NSCopying>
| `- note: class 'CIImage' does not conform to the 'Sendable' protocol
35 | {
36 | #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:4:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
2 |
3 | import AVFoundation
4 | import CoreImage
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'CoreImage'
5 | import Foundation
6 | import MLX
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:62:14: warning: associated value 'array' of 'Sendable'-conforming enum 'Image' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
60 | case ciImage(CIImage)
61 | case url(URL)
62 | case array(MLXArray)
| `- warning: associated value 'array' of 'Sendable'-conforming enum 'Image' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
63 |
64 | public func asCIImage() throws -> CIImage {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:6:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
4 | import CoreImage
5 | import Foundation
6 | import MLX
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
7 | import Tokenizers
8 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:162:16: warning: stored property 'tools' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[ToolSpec]?' (aka 'Optional<Array<Dictionary<String, Any>>>'); this is an error in the Swift 6 language mode
160 | public var videos = [Video]()
161 |
162 | public var tools: [ToolSpec]?
| `- warning: stored property 'tools' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[ToolSpec]?' (aka 'Optional<Array<Dictionary<String, Any>>>'); this is an error in the Swift 6 language mode
163 |
164 | /// Additional values provided for the chat template rendering context
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/UserInput.swift:165:16: warning: stored property 'additionalContext' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[String : Any]?'; this is an error in the Swift 6 language mode
163 |
164 | /// Additional values provided for the chat template rendering context
165 | public var additionalContext: [String: Any]?
| `- warning: stored property 'additionalContext' of 'Sendable'-conforming struct 'UserInput' has non-sendable type '[String : Any]?'; this is an error in the Swift 6 language mode
166 | public var processing: Processing = .init()
167 |
[219/224] Compiling MLXLMCommon Evaluate.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:115:9: warning: stored property 'temp' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
113 | /// Sampler that uses `topP` and `temperature` to sample the logits.
114 | public struct TopPSampler: LogitSampler {
115 | let temp: MLXArray
| `- warning: stored property 'temp' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
116 | let topP: MLXArray
117 |
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:4:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
2 |
3 | import Foundation
4 | import MLX
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
5 | import Tokenizers
6 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:116:9: warning: stored property 'topP' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
114 | public struct TopPSampler: LogitSampler {
115 | let temp: MLXArray
116 | let topP: MLXArray
| `- warning: stored property 'topP' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
117 |
118 | public init(temperature: Float, topP: Float) {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:123:17: warning: stored property 'compiledTopPSampling' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type '(MLXArray, MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
121 | }
122 |
123 | private let compiledTopPSampling: (MLXArray, MLXArray, MLXArray) -> MLXArray = {
| |- warning: stored property 'compiledTopPSampling' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type '(MLXArray, MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
124 | compile(inputs: [MLXRandom.globalState], outputs: [MLXRandom.globalState]) {
125 | logits, topP, temp in
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:154:9: warning: stored property 'temp' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
152 | /// Processor that uses `temperature` to sample the logits
153 | public struct CategoricalSampler: LogitSampler {
154 | let temp: MLXArray
| `- warning: stored property 'temp' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
155 |
156 | public init(temperature: Float) {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:160:17: warning: stored property 'compiledCategorical' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type '(MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
158 | }
159 |
160 | private let compiledCategorical: (MLXArray, MLXArray) -> MLXArray = {
| |- warning: stored property 'compiledCategorical' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type '(MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
161 | compile(inputs: [MLXRandom.globalState], outputs: [MLXRandom.globalState]) { logits, temp in
162 | categorical(logits * (1 / temp))
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:421:16: warning: stored property 'inputText' of 'Sendable'-conforming struct 'GenerateResult' has non-sendable type 'LMInput.Text'; this is an error in the Swift 6 language mode
419 |
420 | /// input (prompt, images, etc.)
421 | public let inputText: LMInput.Text
| `- warning: stored property 'inputText' of 'Sendable'-conforming struct 'GenerateResult' has non-sendable type 'LMInput.Text'; this is an error in the Swift 6 language mode
422 |
423 | @available(*, deprecated, message: "use inputText")
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/LanguageModel.swift:43:19: note: consider making struct 'Text' conform to the 'Sendable' protocol
41 |
42 | /// Representation of tokenized input text.
43 | public struct Text {
| `- note: consider making struct 'Text' conform to the 'Sendable' protocol
44 |
45 | /// input token array
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:562:47: warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
560 |
561 | let additionalEOSTokenIds = Set(
562 | (context.configuration.extraEOSTokens ?? [])
| `- warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
563 | .compactMap {
564 | context.tokenizer.convertTokenToId($0)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:649:47: warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
647 |
648 | let additionalEOSTokenIds = Set(
649 | (context.configuration.extraEOSTokens ?? [])
| `- warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
650 | .compactMap {
651 | context.tokenizer.convertTokenToId($0)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:748: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
746 |
747 | // Launch a Task to perform iteration asynchronously.
748 | 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
749 | var start = Date.timeIntervalSinceReferenceDate
750 | var promptTime: TimeInterval = 0
:
788 |
789 | let info = GenerateCompletionInfo(
790 | promptTokenCount: input.text.tokens.size,
| `- note: closure captures 'input' which is accessible to code in the current task
791 | generationTokenCount: tokenCount,
792 | promptTime: promptTime,
[220/224] Compiling MLXLMCommon KVCache.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:115:9: warning: stored property 'temp' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
113 | /// Sampler that uses `topP` and `temperature` to sample the logits.
114 | public struct TopPSampler: LogitSampler {
115 | let temp: MLXArray
| `- warning: stored property 'temp' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
116 | let topP: MLXArray
117 |
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:4:1: warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
2 |
3 | import Foundation
4 | import MLX
| `- warning: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'MLX'
5 | import Tokenizers
6 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:116:9: warning: stored property 'topP' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
114 | public struct TopPSampler: LogitSampler {
115 | let temp: MLXArray
116 | let topP: MLXArray
| `- warning: stored property 'topP' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
117 |
118 | public init(temperature: Float, topP: Float) {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:123:17: warning: stored property 'compiledTopPSampling' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type '(MLXArray, MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
121 | }
122 |
123 | private let compiledTopPSampling: (MLXArray, MLXArray, MLXArray) -> MLXArray = {
| |- warning: stored property 'compiledTopPSampling' of 'Sendable'-conforming struct 'TopPSampler' has non-sendable type '(MLXArray, MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
124 | compile(inputs: [MLXRandom.globalState], outputs: [MLXRandom.globalState]) {
125 | logits, topP, temp in
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:154:9: warning: stored property 'temp' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
152 | /// Processor that uses `temperature` to sample the logits
153 | public struct CategoricalSampler: LogitSampler {
154 | let temp: MLXArray
| `- warning: stored property 'temp' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type 'MLXArray'; this is an error in the Swift 6 language mode
155 |
156 | public init(temperature: Float) {
/Users/admin/builder/spi-builder-workspace/.build/checkouts/mlx-swift/Source/MLX/MLXArray.swift:8:20: note: class 'MLXArray' does not conform to the 'Sendable' protocol
6 | import Numerics
7 |
8 | public final class MLXArray {
| `- note: class 'MLXArray' does not conform to the 'Sendable' protocol
9 |
10 | /// Internal pointer to the mlx-c wrapper on `mlx::core::array`, used with `Cmlx` interop.
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:160:17: warning: stored property 'compiledCategorical' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type '(MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
158 | }
159 |
160 | private let compiledCategorical: (MLXArray, MLXArray) -> MLXArray = {
| |- warning: stored property 'compiledCategorical' of 'Sendable'-conforming struct 'CategoricalSampler' has non-sendable type '(MLXArray, MLXArray) -> MLXArray'; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
161 | compile(inputs: [MLXRandom.globalState], outputs: [MLXRandom.globalState]) { logits, temp in
162 | categorical(logits * (1 / temp))
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:421:16: warning: stored property 'inputText' of 'Sendable'-conforming struct 'GenerateResult' has non-sendable type 'LMInput.Text'; this is an error in the Swift 6 language mode
419 |
420 | /// input (prompt, images, etc.)
421 | public let inputText: LMInput.Text
| `- warning: stored property 'inputText' of 'Sendable'-conforming struct 'GenerateResult' has non-sendable type 'LMInput.Text'; this is an error in the Swift 6 language mode
422 |
423 | @available(*, deprecated, message: "use inputText")
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/LanguageModel.swift:43:19: note: consider making struct 'Text' conform to the 'Sendable' protocol
41 |
42 | /// Representation of tokenized input text.
43 | public struct Text {
| `- note: consider making struct 'Text' conform to the 'Sendable' protocol
44 |
45 | /// input token array
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:562:47: warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
560 |
561 | let additionalEOSTokenIds = Set(
562 | (context.configuration.extraEOSTokens ?? [])
| `- warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
563 | .compactMap {
564 | context.tokenizer.convertTokenToId($0)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:649:47: warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
647 |
648 | let additionalEOSTokenIds = Set(
649 | (context.configuration.extraEOSTokens ?? [])
| `- warning: left side of nil coalescing operator '??' has non-optional type 'Set<String>', so the right side is never used
650 | .compactMap {
651 | context.tokenizer.convertTokenToId($0)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLMCommon/Evaluate.swift:748: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
746 |
747 | // Launch a Task to perform iteration asynchronously.
748 | 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
749 | var start = Date.timeIntervalSinceReferenceDate
750 | var promptTime: TimeInterval = 0
:
788 |
789 | let info = GenerateCompletionInfo(
790 | promptTokenCount: input.text.tokens.size,
| `- note: closure captures 'input' which is accessible to code in the current task
791 | generationTokenCount: tokenCount,
792 | promptTime: promptTime,
[221/224] Compiling MLXLMCommon LanguageModel.swift
[222/224] Compiling MLXLMCommon Load.swift
[223/224] Compiling MLXLMCommon Lora.swift
[224/224] Compiling MLXLMCommon ModelConfiguration.swift
[225/245] Emitting module MLXLLM
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:295:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
293 | /// configuration: LLMRegistry.llama3_8B_4bit)
294 | /// ```
295 | 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
296 |
297 | public init(typeRegistry: ModelTypeRegistry, modelRegistry: AbstractModelRegistry) {
[226/247] 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:295:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
293 | /// configuration: LLMRegistry.llama3_8B_4bit)
294 | /// ```
295 | 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
296 |
297 | 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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:38:22: 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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:39:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:40:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:41:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:42:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:43:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:44:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:45:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:46:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
48 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:47:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | ]
49 | }
[227/247] 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:295:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
293 | /// configuration: LLMRegistry.llama3_8B_4bit)
294 | /// ```
295 | 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
296 |
297 | 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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:38:22: 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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:39:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:40:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:41:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:42:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:43:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:44:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:45:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:46:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
48 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:47:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | ]
49 | }
[228/247] 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:295:14: warning: non-final class 'LLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
293 | /// configuration: LLMRegistry.llama3_8B_4bit)
294 | /// ```
295 | 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
296 |
297 | 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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:38:22: 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 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:39:22: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
37 | "gemma2": create(Gemma2Configuration.self, Gemma2Model.init),
38 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:40:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
38 | "qwen2": create(Qwen2Configuration.self, Qwen2Model.init),
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:41:27: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
39 | "qwen3": create(Qwen3Configuration.self, Qwen3Model.init),
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:42:23: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
40 | "qwen3_moe": create(Qwen3MoEConfiguration.self, Qwen3MoEModel.init),
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:43:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
41 | "starcoder2": create(Starcoder2Configuration.self, Starcoder2Model.init),
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:44:26: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
42 | "cohere": create(CohereConfiguration.self, CohereModel.init),
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:45:24: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
43 | "openelm": create(OpenElmConfiguration.self, OpenELMModel.init),
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:46:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
44 | "internlm2": create(InternLM2Configuration.self, InternLM2Model.init),
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
48 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/LLMModelFactory.swift:47:21: warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
45 | "granite": create(GraniteConfiguration.self, GraniteModel.init),
46 | "mimo": create(MiMoConfiguration.self, MiMoModel.init),
47 | "glm4": create(GLM4Configuration.self, GLM4Model.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
48 | ]
49 | }
[229/247] Compiling MLXLLM Qwen3MoE.swift
[230/247] Compiling MLXLLM Starcoder2.swift
[231/247] Compiling MLXLLM LoraTrain.swift
[232/247] Compiling MLXLLM Cohere.swift
[233/247] Compiling MLXLLM GLM4.swift
[234/247] Compiling MLXLLM Phi3.swift
/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(
[235/247] Compiling MLXLLM PhiMoE.swift
/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(
[236/247] Compiling MLXLLM Granite.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:120:13: warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
118 |
119 | public init(_ args: GraniteConfiguration) {
120 | let attentionHeads = args.attentionHeads
| `- warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
121 | let hiddenSize = args.hiddenSize
122 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:270:74: warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
268 | self.kvHeads = try container.decode(Int.self, forKey: .kvHeads)
269 | self.attentionBias = try container.decode(Bool.self, forKey: .attentionBias)
270 | 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
271 | self.ropeTheta = try container.decodeIfPresent(Float.self, forKey: .ropeTheta) ?? 10000000.0
272 | self.ropeScaling = try container.decodeIfPresent(
[237/247] Compiling MLXLLM Internlm2.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:120:13: warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
118 |
119 | public init(_ args: GraniteConfiguration) {
120 | let attentionHeads = args.attentionHeads
| `- warning: initialization of immutable value 'attentionHeads' was never used; consider replacing with assignment to '_' or removing it
121 | let hiddenSize = args.hiddenSize
122 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXLLM/Models/Granite.swift:270:74: warning: left side of nil coalescing operator '??' has non-optional type 'Bool', so the right side is never used
268 | self.kvHeads = try container.decode(Int.self, forKey: .kvHeads)
269 | self.attentionBias = try container.decode(Bool.self, forKey: .attentionBias)
270 | 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
271 | self.ropeTheta = try container.decodeIfPresent(Float.self, forKey: .ropeTheta) ?? 10000000.0
272 | self.ropeScaling = try container.decodeIfPresent(
[238/247] Compiling MLXLLM Gemma.swift
[239/247] Compiling MLXLLM Gemma2.swift
[240/247] Compiling MLXLLM OpenELM.swift
[241/247] Compiling MLXLLM Phi.swift
[242/247] Compiling MLXLLM Qwen2.swift
[243/247] Compiling MLXLLM Qwen3.swift
[244/247] Compiling MLXLLM Llama.swift
[245/247] Compiling MLXLLM MiMo.swift
[246/247] 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
[247/247] 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.20s)
Target: MLXVLM
Extracting symbol information for 'MLXVLM'...
Finished extracting symbol information for 'MLXVLM'. (3.14s)
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.21s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/2.25.4
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.66s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
[2/11] Compiling MLXVLM VLMModel.swift
[3/11] Compiling MLXVLM VLMModelFactory.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:178:14: warning: non-final class 'VLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
176 | /// configuration: VLMRegistry.paligemma3bMix4488bit)
177 | /// ```
178 | 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
179 |
180 | 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 | "smolvlm": create(SmolVLM2Configuration.self, SmolVLM2.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 | "smolvlm": create(SmolVLM2Configuration.self, SmolVLM2.init),
89 | ]
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:88:24: 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 | "smolvlm": create(SmolVLM2Configuration.self, SmolVLM2.init),
| `- warning: converting non-sendable function value to '@Sendable (URL) throws -> any LanguageModel' may introduce data races
89 | ]
90 | }
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:103:35: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
101 | {
102 | [
103 | "PaliGemmaProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
104 | PaliGemmaProcessorConfiguration.self, PaliGemmaProcessor.init),
105 | "Qwen2VLProcessor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:105:33: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
103 | "PaliGemmaProcessor": create(
104 | PaliGemmaProcessorConfiguration.self, PaliGemmaProcessor.init),
105 | "Qwen2VLProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
106 | Qwen2VLProcessorConfiguration.self, Qwen2VLProcessor.init),
107 | "Qwen2_5_VLProcessor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:107:36: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
105 | "Qwen2VLProcessor": create(
106 | Qwen2VLProcessorConfiguration.self, Qwen2VLProcessor.init),
107 | "Qwen2_5_VLProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
108 | Qwen25VLProcessorConfiguration.self, Qwen25VLProcessor.init),
109 | "Idefics3Processor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:109:34: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
107 | "Qwen2_5_VLProcessor": create(
108 | Qwen25VLProcessorConfiguration.self, Qwen25VLProcessor.init),
109 | "Idefics3Processor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
110 | Idefics3ProcessorConfiguration.self, Idefics3Processor.init),
111 | "SmolVLMProcessor": create(
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/VLMModelFactory.swift:111:33: warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
109 | "Idefics3Processor": create(
110 | Idefics3ProcessorConfiguration.self, Idefics3Processor.init),
111 | "SmolVLMProcessor": create(
| `- warning: converting non-sendable function value to '@Sendable (URL, any Tokenizer) throws -> any UserInputProcessor' may introduce data races
112 | SmolVLMProcessorConfiguration.self, SmolVLMProcessor.init),
113 | ]
[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/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|>"
[6/11] Compiling MLXVLM Qwen2VL.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Qwen2VL.swift:465:17: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it
463 | let rotaryPositionEmbedding = rotaryPositionEmbedding(frames)
464 |
465 | let batchSize = frames.count
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it
466 |
467 | for block in blocks {
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Qwen2VL.swift:552:31: warning: no calls to throwing functions occur within 'try' expression
550 | let resizedSize = CGSize(width: resizedWidth, height: resizedHeight)
551 |
552 | let processedImages = try images.map { image in
| `- warning: no calls to throwing functions occur within 'try' expression
553 | preprocess(image: image, resizedSize: resizedSize).asMLXArray()
554 | }
[7/11] Compiling MLXVLM Paligemma.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:465:17: warning: no calls to throwing functions occur within 'try' expression
463 | image = MediaProcessing.apply(image, processing: processing)
464 |
465 | image = try MediaProcessing.resampleBicubic(image, to: config.size.cgSize)
| `- warning: no calls to throwing functions occur within 'try' expression
466 | image = MediaProcessing.normalize(
467 | image, mean: config.imageMeanTuple, std: config.imageStdTuple)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:488:28: warning: no calls to throwing functions occur within 'try' expression
486 | + "\n"
487 |
488 | let promptTokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
489 | let promptArray = MLXArray(promptTokens).expandedDimensions(axis: 0)
490 | let mask = ones(like: promptArray).asType(.int8)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:577:13: warning: initialization of immutable value 'embedDimension' was never used; consider replacing with assignment to '_' or removing it
575 | attentionMask: MLXArray
576 | ) -> (MLXArray, MLXArray) {
577 | let embedDimension = imageFeatures.dim(2)
| `- warning: initialization of immutable value 'embedDimension' was never used; consider replacing with assignment to '_' or removing it
578 | let (batchSize, sequenceLength) = inputIds.shape2
579 | var scaledImageFeatures = imageFeatures / pow(Float(config.hiddenSize), 0.5)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:578:14: warning: immutable value 'batchSize' was never used; consider replacing with '_' or removing it
576 | ) -> (MLXArray, MLXArray) {
577 | let embedDimension = imageFeatures.dim(2)
578 | let (batchSize, sequenceLength) = inputIds.shape2
| `- warning: immutable value 'batchSize' was never used; consider replacing with '_' or removing it
579 | var scaledImageFeatures = imageFeatures / pow(Float(config.hiddenSize), 0.5)
580 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:578:25: warning: immutable value 'sequenceLength' was never used; consider replacing with '_' or removing it
576 | ) -> (MLXArray, MLXArray) {
577 | let embedDimension = imageFeatures.dim(2)
578 | let (batchSize, sequenceLength) = inputIds.shape2
| `- warning: immutable value 'sequenceLength' was never used; consider replacing with '_' or removing it
579 | var scaledImageFeatures = imageFeatures / pow(Float(config.hiddenSize), 0.5)
580 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:586:13: warning: variable 'textMaskExpanded' was never mutated; consider changing to 'let' constant
584 |
585 | // expand masks to match embedding dimension
586 | var textMaskExpanded = expandedDimensions(textMask, axis: -1)
| `- warning: variable 'textMaskExpanded' was never mutated; consider changing to 'let' constant
587 | var padMaskExpanded = expandedDimensions(padMask, axis: -1)
588 |
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:587:13: warning: variable 'padMaskExpanded' was never mutated; consider changing to 'let' constant
585 | // expand masks to match embedding dimension
586 | var textMaskExpanded = expandedDimensions(textMask, axis: -1)
587 | var padMaskExpanded = expandedDimensions(padMask, axis: -1)
| `- warning: variable 'padMaskExpanded' was never mutated; consider changing to 'let' constant
588 |
589 | // insert padding and text token embeddings
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Paligemma.swift:597:13: warning: variable 'imageMaskExpanded' was never mutated; consider changing to 'let' constant
595 |
596 | // insert image embeddings - the image mask is always less or equal to the sentence in length
597 | var imageMaskExpanded = expandedDimensions(imageMask, axis: -1)
| `- warning: variable 'imageMaskExpanded' was never mutated; consider changing to 'let' constant
598 | finalEmbedding = which(imageMaskExpanded, scaledImageFeatures, finalEmbedding)
599 |
[8/11] Compiling MLXVLM Idefics3.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:847:17: warning: initialization of immutable value 'count' was never used; consider replacing with assignment to '_' or removing it
845 | }
846 |
847 | let count = config.imageSequenceLength ?? 1
| `- warning: initialization of immutable value 'count' was never used; consider replacing with assignment to '_' or removing it
848 |
849 | // Encode only the text part of the prompt, without <image>
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:837:26: warning: no calls to throwing functions occur within 'try' expression
835 | if input.images.isEmpty {
836 | // No image scenario
837 | let tokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
838 | let tokensArray = MLXArray(tokens).expandedDimensions(axis: 0)
839 | let mask = ones(like: tokensArray)
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:850:32: warning: no calls to throwing functions occur within 'try' expression
848 |
849 | // Encode only the text part of the prompt, without <image>
850 | var promptTokens = try tokenizer.encode(text: prompt)
| `- warning: no calls to throwing functions occur within 'try' expression
851 |
852 | let imageTokenIndex = promptTokens.count / 2
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Idefics3.swift:865:21: warning: no calls to throwing functions occur within 'try' expression
863 | )
864 | image = MediaProcessing.apply(image, processing: input.processing)
865 | image = try MediaProcessing.resampleBicubic(image, to: targetSize)
| `- warning: no calls to throwing functions occur within 'try' expression
866 | image = MediaProcessing.normalize(
867 | image,
[9/11] 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:178:14: warning: non-final class 'VLMModelFactory' cannot conform to 'Sendable'; use '@unchecked Sendable'; this is an error in the Swift 6 language mode
176 | /// configuration: VLMRegistry.paligemma3bMix4488bit)
177 | /// ```
178 | 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
179 |
180 | public init(
[10/11] 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/11] Compiling MLXVLM Qwen25VL.swift
/Users/admin/builder/spi-builder-workspace/Libraries/MLXVLM/Models/Qwen25VL.swift:704:24: warning: no calls to throwing functions occur within 'try' expression
702 | }
703 | .map {
704 | return try MediaProcessing.resampleBicubic($0, to: resizedSize)
| `- warning: no calls to throwing functions occur within 'try' expression
705 | }
706 | .map {
Build of target: 'MLXVLM' complete! (1.58s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/linkable-paths.json
Target: MLXLMCommon
Extracting symbol information for 'MLXLMCommon'...
Finished extracting symbol information for 'MLXLMCommon'. (0.93s)
Building documentation for 'MLXLMCommon'...
warning: 'Chat.Message' doesn't exist at '/MLXLMCommon/MessageGenerator'
--> ../Chat.swift:54:7-54:19
52 |
53 | /// Protocol for something that can convert structured
54 + /// ``Chat.Message`` into model specific ``Message``
55 | /// (raw dictionary) format.
56 | ///
warning: 'Codable' doesn't exist at '/MLXLMCommon/porting'
--> porting.md:65:36-65:43
63 | like `rms_norm_eps` and structure like `num_hidden_layers`.
64 |
65 + This translates naturally into a ``Codable`` struct in Swift with a few details:
66 |
67 | - the keys in the JSON file will be `snake_case` -- the simplest way to accomodate that is to specify `CodingKeys` to name them explicitly
warning: 'loadWeights(modelDirectory:model:quantization:)' doesn't exist at '/MLXLMCommon/porting'
--> porting.md:188:4-188:51
186 | parameters to the initializer. In typical inference use these values
187 | will be replaced when the weights are loaded
188 + (``loadWeights(modelDirectory:model:quantization:)``).
189 |
190 | * Note:
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:227:44-227:91
225 | /// Generator of tokens.
226 | ///
227 + /// 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'
228 | ///
229 | /// 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:287:11-287:69
285 | ///
286 | /// If more control is needed over the generation,
287 + /// ``init(input:model:cache:processor:sampler:prefillStepSize:)``
288 | /// allows a caller to specify ``LogitProcessor`` and ``LogitSampler``
289 | /// directly.
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:398:27-398:74
396 | }
397 |
398 + /// 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'
399 | public struct GenerateResult: Sendable {
400 |
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:464:45-464:92
462 | }
463 |
464 + /// 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'
465 | public enum GenerateDisposition: Sendable {
466 | /// keep producing tokens until an EOS token is produced
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:475:7-475:54
473 | /// Given prompt tokens generate text using the given model and parameters.
474 | ///
475 + /// ``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'
476 | ///
477 | /// - Parameters:
warning: 'generate(input:context:iterator:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:525:7-525:52
523 | ///
524 | /// Internally this constructs a ``TokenIterator`` and calls
525 + /// ``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'
526 | ///
527 | /// - Parameters:
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:545:7-545:54
543 | /// Low level token generation using a ``TokenIterator``.
544 | ///
545 + /// ``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'
546 | ///
547 | /// - Parameters:
warning: 'generate(input:context:iterator:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../Evaluate.swift:622:7-622:52
620 | ///
621 | /// Internally this constructs a ``TokenIterator`` and calls
622 + /// ``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'
623 | ///
624 | /// - Parameters:
warning: 'MultiHeadAttention' doesn't exist at '/MLXLMCommon/createAttentionMask(h:cache:)'
--> ../KVCache.swift:35:16-35:34
33 | /// create an attention mask using the parameters from the KVCache.
34 | ///
35 + /// See also ``MultiHeadAttention/createAdditiveCausalMask(_:dtype:)`` -- same idea
36 | /// but doesn't honor the cache offset.
37 | @_disfavoredOverload
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRAModel/loraLinearLayers()'
--> ../Lora.swift:28:13-28:22
26 | ///
27 | /// ### See Also
28 + /// - ``LoRATrain/convert(model:layers:)``
29 | func loraLinearLayers() -> LoRALinearLayers
30 |
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRAConvertToLinear'
--> ../Lora.swift:46:35-46:44
44 | /// (or subtype).
45 | ///
46 + /// This is normally called via ``LoRATrain/fuse(model:layers:deQuantize:)``
47 | public protocol LoRAConvertToLinear {
48 | func toLinear(deQuantize: Bool) -> Linear
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Lora.swift:61:46-61:55
59 | /// ``QLoRALinear`` is the equivalent class for `QuantizedLinear`.
60 | ///
61 + /// This is not typically used directly -- ``LoRATrain/convert(model:layers:)`` is used to
62 | /// add the adapter layers to a given model.
63 | ///
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Lora.swift:68:9-68:18
66 | /// - [QLoRA: Efficient Finetuning of Quantized LLMs](https://arxiv.org/abs/2305.14314)
67 | /// - ``QLoRALinear``
68 + /// - ``LoRATrain/convert(model:layers:)``
69 | /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
70 | public class LoRALinear: Linear, LoRAConvertToLinear {
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear'
--> ../Lora.swift:69:9-69:18
67 | /// - ``QLoRALinear``
68 | /// - ``LoRATrain/convert(model:layers:)``
69 + /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
70 | public class LoRALinear: Linear, LoRAConvertToLinear {
71 |
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/from(linear:rank:)'
--> ../Lora.swift:111:40-111:49
109 | /// that implements the `LoRA` adapter.
110 | ///
111 + /// This is typically called via ``LoRATrain/convert(model:layers:)``.
112 | ///
113 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/from(linear:rank:)'
--> ../Lora.swift:114:13-114:22
112 | ///
113 | /// ### See Also
114 + /// - ``LoRATrain/convert(model:layers:)``
115 | /// - ``QLoRALinear/from(linear:rank:)``
116 | public static func from(linear: Linear, rank: Int = 8) -> Linear {
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/toLinear(deQuantize:)'
--> ../Lora.swift:126:40-126:49
124 | /// Convert back into a fused `Linear` layer.
125 | ///
126 + /// This is typically called via ``LoRATrain/fuse(model:layers:deQuantize:)``.
127 | ///
128 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/LoRALinear/toLinear(deQuantize:)'
--> ../Lora.swift:129:13-129:22
127 | ///
128 | /// ### See Also
129 + /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
130 | /// - ``LoRAConvertToLinear``
131 | /// - ``QLoRALinear/toLinear(deQuantize:)``
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/from(linear:rank:)'
--> ../Lora.swift:194:40-194:49
192 | /// that implements the `LoRA` adapter.
193 | ///
194 + /// This is typically called via ``LoRATrain/convert(model:layers:)``.
195 | ///
196 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/from(linear:rank:)'
--> ../Lora.swift:197:13-197:22
195 | ///
196 | /// ### See Also
197 + /// - ``LoRATrain/convert(model:layers:)``
198 | /// - ``LoRALinear/from(linear:rank:)``
199 | public static func from(linear: QuantizedLinear, rank: Int = 8) -> Linear {
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/toLinear(deQuantize:)'
--> ../Lora.swift:206:40-206:49
204 | /// Convert back into a fused `QuantizedLinear` layer.
205 | ///
206 + /// This is typically called via ``LoRATrain/fuse(model:layers:deQuantize:)``.
207 | ///
208 | /// ### See Also
warning: 'LoRATrain' doesn't exist at '/MLXLMCommon/QLoRALinear/toLinear(deQuantize:)'
--> ../Lora.swift:209:13-209:22
207 | ///
208 | /// ### See Also
209 + /// - ``LoRATrain/fuse(model:layers:deQuantize:)``
210 | public func toLinear(deQuantize: Bool = false) -> Linear {
211 | // convert back into full weights
warning: 'generate(input:parameters:context:didGenerate:)' is ambiguous at '/MLXLMCommon'
--> ../ModelFactory.swift:25:52-25:99
23 | ///
24 | /// - ``ModelConfiguration`` -- identifier for the model
25 + /// - ``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'
26 | /// - ``UserInputProcessor`` -- can convert ``UserInput`` into ``LMInput``
27 | /// - `Tokenizer` -- the tokenizer used by ``UserInputProcessor``
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.28s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/2.25.4
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.69s)
Building for debugging...
[0/1] Write swift-version-2F0A5646E1D333AE.txt
Build of target: 'MLXLMCommon' complete! (0.76s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/linkable-paths.json
Target: MLXMNIST
Extracting symbol information for 'MLXMNIST'...
Finished extracting symbol information for 'MLXMNIST'. (1.64s)
Building documentation for 'MLXMNIST'...
Finished building documentation for 'MLXMNIST' (0.06s)
Generated documentation archive at:
/Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/2.25.4
Building for debugging...
[0/3] Write swift-version-2F0A5646E1D333AE.txt
Build of product 'snippet-extract' complete! (0.68s)
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 Random.swift
[5/7] Compiling MLXMNIST MNIST.swift
[6/7] Emitting module MLXMNIST
[7/7] Compiling MLXMNIST Files.swift
Build of target: 'MLXMNIST' complete! (1.50s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/linkable-paths.json
Target: MLXEmbedders
Extracting symbol information for 'MLXEmbedders'...
Finished extracting symbol information for 'MLXEmbedders'. (1.79s)
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/2.25.4
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/3] Emitting module MLXLinalg
[3/3] Compiling MLXLinalg Linalg.swift
[4/13] Compiling MLXEmbedders Tokenizer.swift
[5/13] Compiling MLXEmbedders Pooling.swift
[6/13] Compiling MLXEmbedders Models.swift
[7/13] 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/13] Compiling MLXEmbedders Configuration.swift
[9/13] Compiling MLXEmbedders EmbeddingModel.swift
[10/13] Compiling MLXEmbedders Bert.swift
[11/13] Compiling MLXEmbedders BaseConfiguration.swift
[12/13] Emitting module MLXEmbedders
[13/13] 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 | }
Build of target: 'MLXEmbedders' complete! (1.65s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/linkable-paths.json
Target: StableDiffusion
Extracting symbol information for 'StableDiffusion'...
Finished extracting symbol information for 'StableDiffusion'. (1.49s)
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/2.25.4
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 StableDiffusion VAE.swift
[3/11] Compiling StableDiffusion StableDiffusion.swift
[4/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 |
[5/11] Compiling StableDiffusion Tokenizer.swift
[6/11] Compiling StableDiffusion Load.swift
[7/11] Compiling StableDiffusion Sampler.swift
[8/11] Compiling StableDiffusion Configuration.swift
[9/11] Compiling StableDiffusion Clip.swift
[10/11] Emitting module StableDiffusion
[11/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)
Build of target: 'StableDiffusion' complete! (1.35s)
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/index/index.json
Successfully merged into /Users/admin/builder/spi-builder-workspace/.docs-staging/ml-explore/mlx-swift-examples/2.25.4/linkable-paths.json
2962
17 /Users/admin/builder/spi-builder-workspace/.docs/ml-explore/mlx-swift-examples/2.25.4
✅ Doc result (uploading) reported
========================================
SyncDocs
========================================
Doc archive source directory: $PWD/.docs/ml-explore/mlx-swift-examples/2.25.4
File count: 2962
Doc size: 17.0MB
Preparing doc bundle ...
Uploading prod-ml-explore-mlx-swift-examples-2.25.4-8dd99ee3.zip to s3://spi-docs-inbox/prod-ml-explore-mlx-swift-examples-2.25.4-8dd99ee3.zip
Copying... [10%]
Copying... [21%]
Copying... [31%]
Copying... [40%]
Copying... [51%]
Copying... [61%]
Copying... [72%]
Copying... [80%]
Copying... [91%]
Copying... [100%]
Done.