├── Libraries ├── MNIST │ ├── MNIST.h │ ├── README.md │ ├── Random.swift │ ├── MNIST.swift │ └── Files.swift ├── SentencePiece │ ├── SentencePiece-Bridging.h │ ├── SentencePiece.xcconfig │ ├── README.md │ ├── SentencePieceImpl.h │ ├── SentencePiece.swift │ └── SentencePieceImpl.mm └── Llama │ ├── README.md │ ├── Util.swift │ ├── Configuration.swift │ └── Llama.swift ├── MLXChat ├── Assets.xcassets │ ├── Contents.json │ ├── bot.imageset │ │ ├── chatbot-icon.png │ │ └── Contents.json │ ├── profile.imageset │ │ ├── unnamed.jpg │ │ └── Contents.json │ ├── AccentColor.colorset │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── Info.plist ├── Models │ ├── ParserResult.swift │ └── MessageRow.swift ├── MLXChat.entitlements ├── MLXChatApp.swift ├── Views │ ├── HeaderView.swift │ ├── DotLoadingView.swift │ ├── PreferencePane.swift │ ├── MessageRowView.swift │ └── ContentView.swift └── ViewModel.swift ├── .swift-format ├── .pre-commit-config.yaml ├── mlx-examples-swift.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── swiftpm │ │ └── Package.resolved ├── xcshareddata │ └── xcschemes │ │ ├── Tutorial.xcscheme │ │ ├── LinearModelTraining.xcscheme │ │ ├── mnist-tool.xcscheme │ │ └── llm-tool.xcscheme └── project.pbxproj ├── MLXChatXPCService ├── MLXChatXPCService.entitlements ├── main.swift ├── Info.plist ├── MLXChatXPCServiceProtocol.swift ├── MLXChat.swift └── MLXChatXPCService.swift ├── Tools ├── LinearModelTraining │ ├── README.md │ └── LinearModelTraining.swift ├── mnist-tool │ ├── README.md │ └── MNISTTool.swift ├── llm-tool │ ├── README.md │ └── LLMTool.swift └── Tutorial │ └── Tutorial.swift ├── README.md ├── .circleci └── config.yml └── .gitignore /Libraries/MNIST/MNIST.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Libraries/SentencePiece/SentencePiece-Bridging.h: -------------------------------------------------------------------------------- 1 | #import "SentencePieceImpl.h" 2 | -------------------------------------------------------------------------------- /MLXChat/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /MLXChat/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.swift-format: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "indentation": { 4 | "spaces": 4 5 | }, 6 | "spacesAroundRangeFormationOperators": true, 7 | } 8 | -------------------------------------------------------------------------------- /MLXChat/Assets.xcassets/bot.imageset/chatbot-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfianlosari/mlx-swift-examples/HEAD/MLXChat/Assets.xcassets/bot.imageset/chatbot-icon.png -------------------------------------------------------------------------------- /MLXChat/Assets.xcassets/profile.imageset/unnamed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alfianlosari/mlx-swift-examples/HEAD/MLXChat/Assets.xcassets/profile.imageset/unnamed.jpg -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/slessans/pre-commit-swift-format 3 | rev: "" 4 | hooks: 5 | - id: swift-format 6 | args: ["--configuration", ".swift-format"] 7 | -------------------------------------------------------------------------------- /MLXChat/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MLXChat/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MLXChatXPCService/MLXChatXPCService.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Libraries/SentencePiece/SentencePiece.xcconfig: -------------------------------------------------------------------------------- 1 | HEADER_SEARCH_PATHS = /opt/homebrew/include 2 | LIBRARY_SEARCH_PATHS = /opt/homebrew/lib 3 | OTHER_LDFLAGS = -lsentencepiece 4 | SWIFT_OBJC_BRIDGING_HEADER = Libraries/SentencePiece/SentencePiece-Bridging.h 5 | -------------------------------------------------------------------------------- /MLXChatXPCService/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // MLXChatXPCService 4 | // 5 | // Created by Alfian Losari on 22/02/24. 6 | // 7 | 8 | import Foundation 9 | 10 | let xpcService = MLXChatXPCService() 11 | xpcService.start() 12 | RunLoop.main.run() 13 | -------------------------------------------------------------------------------- /MLXChat/Models/ParserResult.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | struct ParserResult: Identifiable { 4 | 5 | let id = UUID() 6 | let attributedString: AttributedString 7 | let isCodeBlock: Bool 8 | let codeBlockLanguage: String? 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Libraries/SentencePiece/README.md: -------------------------------------------------------------------------------- 1 | # SentencePiece 2 | 3 | This is a swift wrapper for the `sentencepiece` api: 4 | 5 | - https://github.com/google/sentencepiece 6 | 7 | Building requires `sentencepiece` be installed on your system: 8 | 9 | ``` 10 | brew install sentencepiece 11 | ``` 12 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Tools/LinearModelTraining/README.md: -------------------------------------------------------------------------------- 1 | # LinearModelTraining 2 | 3 | A command line tool that creates a Model that represents: 4 | 5 | f(x) = mx + b 6 | 7 | and trains it against an unknown linear function. Very 8 | simple but illustrates: 9 | 10 | - a very simple model with parameters 11 | - a loss function 12 | - the gradient 13 | - use of an optimizers 14 | - the training loop 15 | -------------------------------------------------------------------------------- /MLXChat/MLXChat.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.allow-dyld-environment-variables 6 | 7 | com.apple.security.cs.disable-library-validation 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MLXChat/Assets.xcassets/bot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "chatbot-icon.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MLXChat/Assets.xcassets/profile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "unnamed.jpg", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Libraries/MNIST/README.md: -------------------------------------------------------------------------------- 1 | # MNIST 2 | 3 | This is a port of the MNIST model and training code from: 4 | 5 | - https://github.com/ml-explore/mlx-examples/blob/main/mnist 6 | 7 | It provides code to: 8 | 9 | - download the test/train data 10 | - provides the MNIST model (MLP) 11 | - some functions to shuffle and batch the data 12 | 13 | See [mnist-tool](../../Tools/mnist-tool) for an example of how to run this. The training loop also lives there. 14 | -------------------------------------------------------------------------------- /MLXChatXPCService/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | XPCService 6 | 7 | ServiceType 8 | Application 9 | JoinExistingSession 10 | 11 | RunLoopType 12 | NSRunLoop 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /MLXChatXPCService/MLXChatXPCServiceProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MLXChatXPCServiceProtocol.swift 3 | // MLXChatXPCService 4 | // 5 | // Created by Alfian Losari on 22/02/24. 6 | // 7 | 8 | import Foundation 9 | 10 | let xpcServiceLabel = "com.xca.MLXChatXPCService" 11 | 12 | @objc protocol MLXChatXPCServiceProtocol { 13 | 14 | func prompt(text: String, model: String, maxTokens: Int, temperature: Float, seed: UInt64, completion: @escaping (Error?) -> Void) 15 | func stopResponse() 16 | } 17 | 18 | @objc protocol MLXChatClientProtocol { 19 | 20 | func tokenReceived(t: String) 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Libraries/Llama/README.md: -------------------------------------------------------------------------------- 1 | # Llama 2 | 3 | This is a port of the llama model from: 4 | 5 | - https://github.com/ml-explore/mlx-examples/blob/main/llms/mlx_lm/models/llama.py 6 | 7 | You can use this to load models from huggingface, e.g.: 8 | 9 | - https://huggingface.co/mlx-community/Mistral-7B-v0.1-hf-4bit-mlx 10 | 11 | For example: 12 | 13 | ``` 14 | # Make sure you have git-lfs installed (https://git-lfs.com) 15 | git lfs install 16 | 17 | # get the model weights 18 | cd ~ 19 | git clone https://huggingface.co/mlx-community/Mistral-7B-v0.1-hf-4bit-mlx 20 | ``` 21 | 22 | See [llm-tool](../../Tools/llm-tool) 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mlx-examples-swift 2 | 3 | Example mlx-swift programs. 4 | 5 | ## MLXChat macOS SwiftUI App 6 | 7 | A macOS SwiftUI Application for prompting LLM Model. The LLM Model text generation is run a different XPC Process so it won't affect UI performance of main App Process. 8 | 9 | ## LinearModelTraining 10 | 11 | A simple linear model and a training loop. 12 | 13 | - [README](Tools/LinearModelTraining/README.md) 14 | 15 | ## llm-tool 16 | 17 | A command line tool for generating text using a Llama / Mistral model: 18 | 19 | - [README](Tools/llm-tool/README.md) 20 | 21 | ## mnist-tool 22 | 23 | A command line tool for training an MNIST (MLP) model: 24 | 25 | - [README](Tools/mnist-tool/README.md) 26 | 27 | -------------------------------------------------------------------------------- /Libraries/SentencePiece/SentencePieceImpl.h: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | #import 4 | 5 | NS_ASSUME_NONNULL_BEGIN 6 | 7 | /// Simple ObjC interface to setencepiece C++ API. 8 | /// 9 | /// See https://github.com/google/sentencepiece 10 | @interface SentencePieceImpl : NSObject 11 | 12 | - (nullable instancetype)initWithModel:(NSURL *)url error:(NSError **)error; 13 | 14 | - (nullable NSArray *)encode:(NSString *)string error:(NSError **)error; 15 | 16 | - (nullable NSString *)decode:(NSArray *)ids error:(NSError **)error; 17 | 18 | - (int)bosId; 19 | - (int)padId; 20 | - (int)eosId; 21 | 22 | - (NSString *)modelIdToPiece:(int)modelId; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /MLXChat/MLXChatApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MLXChatApp.swift 3 | // MLXChat 4 | // 5 | // Created by Alfian Losari on 21/02/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct MLXChatApp: App { 12 | 13 | @State var vm = ViewModel() 14 | 15 | var body: some Scene { 16 | WindowGroup { 17 | VStack(spacing: 0) { 18 | HeaderView(vm: $vm) 19 | Divider() 20 | ContentView(vm: $vm) 21 | }.frame(width: 500) 22 | } 23 | .windowResizability(.contentSize) 24 | .commands { 25 | CommandGroup(replacing: .newItem) {} 26 | } 27 | 28 | // MenuBarExtra("XCA MLX Chat", systemImage: "bubbles.and.sparkles") { 29 | // VStack(spacing: 16) { 30 | // HeaderView(vm: $vm).padding([.horizontal, .top]) 31 | // ContentView(vm: $vm) 32 | // }.frame(width: 480, height: 648) 33 | // }.menuBarExtraStyle(.window) 34 | // 35 | Settings { 36 | PreferencePane(vm: $vm) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /MLXChat/Models/MessageRow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessageRow.swift 3 | // XCAChatGPT 4 | // 5 | // Created by Alfian Losari on 02/02/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct AttributedOutput { 11 | let string: String 12 | let results: [ParserResult] 13 | } 14 | 15 | enum MessageRowType { 16 | case attributed(AttributedOutput) 17 | case rawText(String) 18 | 19 | var text: String { 20 | switch self { 21 | case .attributed(let attributedOutput): 22 | return attributedOutput.string 23 | case .rawText(let string): 24 | return string 25 | } 26 | } 27 | } 28 | 29 | struct MessageRow: Identifiable { 30 | 31 | let id = UUID() 32 | 33 | var isInteracting: Bool 34 | 35 | let sendImage: String 36 | var send: MessageRowType 37 | var sendText: String { 38 | send.text 39 | } 40 | 41 | let responseImage: String 42 | var response: MessageRowType? 43 | var responseText: String? { 44 | response?.text 45 | } 46 | 47 | var responseError: String? 48 | 49 | } 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Libraries/MNIST/Random.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import Foundation 4 | 5 | // From https://github.com/apple/swift/blob/cb0fb1ea051631219c0b944b84c78571448d58c2/benchmark/utils/TestsUtils.swift#L254 6 | // 7 | // This is just a seedable RandomNumberGenerator for shuffle() 8 | 9 | // This is a fixed-increment version of Java 8's SplittableRandom generator. 10 | // It is a very fast generator passing BigCrush, with 64 bits of state. 11 | // See http://dx.doi.org/10.1145/2714064.2660195 and 12 | // http://docs.oracle.com/javase/8/docs/api/java/util/SplittableRandom.html 13 | // 14 | // Derived from public domain C implementation by Sebastiano Vigna 15 | // See http://xoshiro.di.unimi.it/splitmix64.c 16 | public struct SplitMix64: RandomNumberGenerator { 17 | private var state: UInt64 18 | 19 | public init(seed: UInt64) { 20 | self.state = seed 21 | } 22 | 23 | public mutating func next() -> UInt64 { 24 | self.state &+= 0x9e37_79b9_7f4a_7c15 25 | var z: UInt64 = self.state 26 | z = (z ^ (z &>> 30)) &* 0xbf58_476d_1ce4_e5b9 27 | z = (z ^ (z &>> 27)) &* 0x94d0_49bb_1331_11eb 28 | return z ^ (z &>> 31) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MLXChat/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "1x", 16 | "size" : "32x32" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "2x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "1x", 26 | "size" : "128x128" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "2x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "1x", 36 | "size" : "256x256" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "2x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "1x", 46 | "size" : "512x512" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "2x", 51 | "size" : "512x512" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /MLXChat/Views/HeaderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderView.swift 3 | // MLXChat 4 | // 5 | // Created by Alfian Losari on 24/02/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct HeaderView: View { 11 | 12 | @Binding var vm: ViewModel 13 | 14 | var body: some View { 15 | HStack { 16 | VStack(alignment: .leading, spacing: 8) { 17 | Text("XCA MLX Chat").font(.title) 18 | if let model = vm.model { 19 | Text(model.lastPathComponent).font(.headline) 20 | } else { 21 | Text("Select local LLM Folder in Settings Pane").font(.headline) 22 | } 23 | } 24 | 25 | Spacer() 26 | 27 | Button("Clear list", role: .destructive) { 28 | guard !vm.isPrompting else { return } 29 | vm.clearMessages() 30 | }.font(.system(size: 14)) 31 | 32 | SettingsLink { 33 | Image(systemName: "gearshape") 34 | .symbolRenderingMode(.multicolor) 35 | .font(.system(size: 14)) 36 | } 37 | } 38 | .padding() 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Tools/mnist-tool/README.md: -------------------------------------------------------------------------------- 1 | # mnist-tool 2 | 3 | See other README: 4 | 5 | - [MNIST](../../Libraries/MNIST/README.md) 6 | 7 | ### Building 8 | 9 | `mnist-tool` has no dependencies outside of the package dependencies 10 | represented in xcode. 11 | 12 | When you run the tool it will download the test/train datasets and 13 | store them in a specified directory (see run arguments -- default is /tmp). 14 | 15 | Simply build the project in xcode. 16 | 17 | ### Running (Xcode) 18 | 19 | To run this in Xcode simply press cmd-opt-r to set the scheme arguments. For example: 20 | 21 | ``` 22 | --data /tmp 23 | ``` 24 | 25 | Then cmd-r to run. 26 | 27 | ### Running (CommandLine) 28 | 29 | `mnist-tool` can also be run from the command line if built from Xcode, but 30 | the `DYLD_FRAMEWORK_PATH` must be set so that the frameworks and bundles can be found: 31 | 32 | - [MLX troubleshooting](https://ml-explore.github.io/mlx-swift/MLX/documentation/mlx/troubleshooting) 33 | 34 | ``` 35 | DYLD_FRAMEWORK_PATH=~/Library/Developer/Xcode/DerivedData/mlx-examples-swift-ceuohnhzsownvsbbleukxoksddja/Build/Products/Debug ~/Library/Developer/Xcode/DerivedData/mlx-examples-swift-ceuohnhzsownvsbbleukxoksddja/Build/Products/Debug/mnist-tool --data /tmp 36 | ``` 37 | -------------------------------------------------------------------------------- /Libraries/SentencePiece/SentencePiece.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import Foundation 4 | 5 | public typealias TokenId = Int32 6 | 7 | /// Swift wrapper on `sentencepiece` processor API. 8 | /// 9 | /// See https://github.com/google/sentencepiece 10 | public class SentencePiece { 11 | 12 | private let impl: SentencePieceImpl 13 | private let separator = "▁" 14 | 15 | public init(model: URL) throws { 16 | precondition(model.isFileURL) 17 | self.impl = try SentencePieceImpl(model: model) 18 | } 19 | 20 | public func encode(_ string: String) throws -> [TokenId] { 21 | try [bosId] + impl.encode(string).map { $0.int32Value } 22 | } 23 | 24 | public func decode(_ ids: [TokenId]) throws -> String { 25 | let result = try impl.decode(ids.map { $0 as NSNumber }) 26 | 27 | // add a leading space if needed 28 | if try !ids.isEmpty && modelIdToPiece(ids[0]).hasPrefix(separator) { 29 | return " " + result 30 | } 31 | 32 | return result 33 | } 34 | 35 | public var bosId: TokenId { impl.bosId() } 36 | public var padId: TokenId { impl.padId() } 37 | public var eosId: TokenId { impl.eosId() } 38 | 39 | public func modelIdToPiece(_ modelId: TokenId) throws -> String { 40 | impl.modelId(toPiece: modelId) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Tools/llm-tool/README.md: -------------------------------------------------------------------------------- 1 | # llm-tool 2 | 3 | See various READMEs: 4 | 5 | - [Llama](../../Libraries/Llama/README.md) 6 | - [SentencePiece](../../Libraries/SentencePiece/README.md) 7 | 8 | ### Building 9 | 10 | `llm-tool` has a few requirements that must be installed first: 11 | 12 | ``` 13 | # install sentencepiece dependency 14 | brew install sentencepiece 15 | 16 | # Make sure you have git-lfs installed (https://git-lfs.com) 17 | git lfs install 18 | 19 | # get the model weights 20 | cd ~ 21 | git clone https://huggingface.co/mlx-community/Mistral-7B-v0.1-hf-4bit-mlx 22 | mlx-community/quantized-gemma-7b-it 23 | ``` 24 | 25 | Then build the `llm-tool` scheme in Xcode. 26 | 27 | ### Running (Xcode) 28 | 29 | To run this in Xcode simply press cmd-opt-r to set the scheme arguments. For example: 30 | 31 | ``` 32 | --model $(HOME)/Mistral-7B-v0.1-hf-4bit-mlx 33 | --prompt "I ponder cheese." 34 | --max-tokens 50 35 | ``` 36 | 37 | Then cmd-r to run. 38 | 39 | ### Running (Command Line) 40 | 41 | `llm-tool` can also be run from the command line if built from Xcode, but 42 | the `DYLD_FRAMEWORK_PATH` must be set so that the frameworks and bundles can be found: 43 | 44 | - [MLX troubleshooting](https://ml-explore.github.io/mlx-swift/MLX/documentation/mlx/troubleshooting) 45 | 46 | The easiest way to do this is drag the Products/llm-tool into Terminal to get the path: 47 | 48 | ``` 49 | DYLD_FRAMEWORK_PATH=~/Library/Developer/Xcode/DerivedData/mlx-examples-swift-ceuohnhzsownvsbbleukxoksddja/Build/Products/Debug ~/Library/Developer/Xcode/DerivedData/mlx-examples-swift-ceuohnhzsownvsbbleukxoksddja/Build/Products/Debug/llm-tool --model ~/Mistral-7B-v0.1-hf-4bit-mlx 50 | ``` 51 | 52 | -------------------------------------------------------------------------------- /MLXChat/Views/DotLoadingView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DotLoadingView.swift 3 | // XCAChatGPT 4 | // 5 | // Created by Alfian Losari on 02/02/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct DotLoadingView: View { 11 | 12 | @State private var showCircle1 = false 13 | @State private var showCircle2 = false 14 | @State private var showCircle3 = false 15 | 16 | var body: some View { 17 | HStack { 18 | Circle() 19 | .opacity(showCircle1 ? 1 : 0) 20 | Circle() 21 | .opacity(showCircle2 ? 1 : 0) 22 | Circle() 23 | .opacity(showCircle3 ? 1 : 0) 24 | } 25 | .foregroundColor(.gray.opacity(0.5)) 26 | .onAppear { performAnimation() } 27 | } 28 | 29 | func performAnimation() { 30 | let animation = Animation.easeInOut(duration: 0.4) 31 | withAnimation(animation) { 32 | self.showCircle1 = true 33 | self.showCircle3 = false 34 | } 35 | 36 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) { 37 | withAnimation(animation) { 38 | self.showCircle2 = true 39 | self.showCircle1 = false 40 | } 41 | } 42 | 43 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) { 44 | withAnimation(animation) { 45 | self.showCircle2 = false 46 | self.showCircle3 = true 47 | } 48 | } 49 | 50 | DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) { 51 | self.performAnimation() 52 | } 53 | } 54 | } 55 | 56 | struct DotLoadingView_Previews: PreviewProvider { 57 | static var previews: some View { 58 | DotLoadingView() 59 | } 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | apple: ml-explore/pr-approval@0.1.0 5 | 6 | parameters: 7 | nightly_build: 8 | type: boolean 9 | default: false 10 | weekly_build: 11 | type: boolean 12 | default: false 13 | 14 | jobs: 15 | 16 | mac_build_and_test: 17 | macos: 18 | xcode: 15.2.0 19 | resource_class: macos.m1.medium.gen1 20 | steps: 21 | - checkout 22 | - run: git submodule sync 23 | - run: git submodule update --init 24 | - run: 25 | name: Run style checks 26 | command: | 27 | pip install pre-commit 28 | brew install swift-format 29 | pre-commit run --all 30 | if ! git diff --quiet; then echo 'Style checks failed, please install pre-commit and run pre-commit run --all and push the change'; exit 1; fi 31 | - run: 32 | name: Build Examples 33 | command: | 34 | xcodebuild -version 35 | xcrun --show-sdk-build-version 36 | swift --version 37 | xcodebuild -skipPackagePluginValidation -scheme llm-tool 38 | xcodebuild -skipPackagePluginValidation -scheme mnist-tool 39 | 40 | workflows: 41 | build_and_test: 42 | when: 43 | and: 44 | - matches: 45 | pattern: "^(?!pull/)[-\\w]+$" 46 | value: << pipeline.git.branch >> 47 | - not: << pipeline.parameters.nightly_build >> 48 | - not: << pipeline.parameters.weekly_build >> 49 | jobs: 50 | - mac_build_and_test 51 | 52 | prb: 53 | when: 54 | matches: 55 | pattern: "^pull/\\d+(/head)?$" 56 | value: << pipeline.git.branch >> 57 | jobs: 58 | - hold: 59 | type: approval 60 | - apple/authenticate: 61 | context: pr-approval 62 | - mac_build_and_test: 63 | requires: [ hold ] 64 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "gzipswift", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/1024jp/GzipSwift", 7 | "state" : { 8 | "revision" : "731037f6cc2be2ec01562f6597c1d0aa3fe6fd05", 9 | "version" : "6.0.1" 10 | } 11 | }, 12 | { 13 | "identity" : "mlx-swift", 14 | "kind" : "remoteSourceControl", 15 | "location" : "https://github.com/ml-explore/mlx-swift", 16 | "state" : { 17 | "branch" : "main", 18 | "revision" : "537f9459d9e44ac7389b6a39d77ae512b34c7ec5" 19 | } 20 | }, 21 | { 22 | "identity" : "swift-argument-parser", 23 | "kind" : "remoteSourceControl", 24 | "location" : "https://github.com/apple/swift-argument-parser.git", 25 | "state" : { 26 | "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", 27 | "version" : "1.3.0" 28 | } 29 | }, 30 | { 31 | "identity" : "swift-async-algorithms", 32 | "kind" : "remoteSourceControl", 33 | "location" : "https://github.com/apple/swift-async-algorithms", 34 | "state" : { 35 | "revision" : "da4e36f86544cdf733a40d59b3a2267e3a7bbf36", 36 | "version" : "1.0.0" 37 | } 38 | }, 39 | { 40 | "identity" : "swift-collections", 41 | "kind" : "remoteSourceControl", 42 | "location" : "https://github.com/apple/swift-collections.git", 43 | "state" : { 44 | "revision" : "d029d9d39c87bed85b1c50adee7c41795261a192", 45 | "version" : "1.0.6" 46 | } 47 | }, 48 | { 49 | "identity" : "swift-numerics", 50 | "kind" : "remoteSourceControl", 51 | "location" : "https://github.com/apple/swift-numerics", 52 | "state" : { 53 | "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", 54 | "version" : "1.0.2" 55 | } 56 | } 57 | ], 58 | "version" : 2 59 | } 60 | -------------------------------------------------------------------------------- /Libraries/SentencePiece/SentencePieceImpl.mm: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | #import "SentencePieceImpl.h" 4 | 5 | #import 6 | 7 | static bool failed(sentencepiece::util::Status status, NSError **error) { 8 | if (!status.ok()) { 9 | NSString *reason = [NSString stringWithUTF8String:status.ToString().c_str()]; 10 | *error = [NSError errorWithDomain:@"SentencePiece" code:100 userInfo: @{ NSLocalizedDescriptionKey: reason }]; 11 | return YES; 12 | } else { 13 | return NO; 14 | } 15 | } 16 | 17 | @implementation SentencePieceImpl 18 | { 19 | sentencepiece::SentencePieceProcessor processor; 20 | } 21 | 22 | - (instancetype)initWithModel:(NSURL *)url error:(NSError **)error { 23 | self = [super init]; 24 | 25 | const auto status = processor.Load(url.path.UTF8String); 26 | if (failed(status, error)) { 27 | return nil; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | - (NSArray *)encode:(NSString *)string error:(NSError **)error { 34 | std::vector ids; 35 | 36 | const auto status = processor.Encode(string.UTF8String, &ids); 37 | if (failed(status, error)) { 38 | return nil; 39 | } 40 | 41 | NSMutableArray *result = [[NSMutableArray alloc] init]; 42 | 43 | for (auto id : ids) { 44 | [result addObject: @(id)]; 45 | } 46 | 47 | return result; 48 | } 49 | 50 | - (NSString *)decode:(NSArray *)ids error:(NSError **)error { 51 | std::vector v_ids; 52 | 53 | for (NSNumber *id : ids) { 54 | v_ids.push_back(id.intValue); 55 | } 56 | 57 | std::string result; 58 | const auto status = processor.Decode(v_ids, &result); 59 | if (failed(status, error)) { 60 | return nil; 61 | } 62 | 63 | return [NSString stringWithUTF8String:result.c_str()]; 64 | } 65 | 66 | - (int)bosId { 67 | return processor.bos_id(); 68 | } 69 | 70 | - (int)padId { 71 | return processor.pad_id(); 72 | } 73 | 74 | - (int)eosId { 75 | return processor.eos_id(); 76 | } 77 | 78 | - (NSString *)modelIdToPiece:(int)modelId { 79 | auto result = processor.IdToPiece(modelId); 80 | return [NSString stringWithUTF8String:result.c_str()]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /MLXChatXPCService/MLXChat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MLXChat.swift 3 | // MLXChatXPCService 4 | // 5 | // Created by Alfian Losari on 22/02/24. 6 | // 7 | 8 | import Foundation 9 | import Llama 10 | import MLX 11 | import MLXRandom 12 | 13 | class MLXChat { 14 | 15 | var maxTokens: Int 16 | var temperature: Float 17 | var seed: UInt64 18 | var isCancelled = false 19 | 20 | init(maxTokens: Int = 500, temperature: Float = 0.0, seed: UInt64 = 0) { 21 | self.maxTokens = maxTokens 22 | self.temperature = temperature 23 | self.seed = seed 24 | } 25 | 26 | func promptModel(text: String, model: String, callback: @escaping (String) -> ()) throws { 27 | MLXRandom.seed(seed) 28 | 29 | let (model, tokenizer ) = try load(modelDirectory: URL(filePath: model)) 30 | 31 | print("Starting generation ...") 32 | print(text, terminator: "") 33 | 34 | var start = Date.timeIntervalSinceReferenceDate 35 | var promptTime: TimeInterval = 0 36 | 37 | let prompt = try MLXArray(tokenizer.encode(text)) 38 | 39 | var ntok = 0 40 | for token in TokenIterator(prompt: prompt, model: model, temp: temperature) { 41 | if ntok == 0 { 42 | eval(token) 43 | let now = Date.timeIntervalSinceReferenceDate 44 | promptTime = now - start 45 | start = now 46 | } 47 | 48 | eval(token) 49 | let ids = [token.asType(TokenId.self).item(TokenId.self)] 50 | let s = try tokenizer.decode(ids) 51 | print(s, terminator: "") 52 | callback(s) 53 | fflush(stdout) 54 | 55 | ntok += ids.count 56 | if ntok == maxTokens || isCancelled { 57 | break 58 | } 59 | } 60 | 61 | print() 62 | print("------") 63 | let now = Date.timeIntervalSinceReferenceDate 64 | let generateTime = now - start 65 | 66 | print( 67 | """ 68 | Prompt Tokens per second: \((Double(prompt.size) / promptTime).formatted()) 69 | Generation tokens per second: \((Double(ntok - 1) / generateTime).formatted()) 70 | """) 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /Libraries/MNIST/MNIST.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import Foundation 4 | import MLX 5 | import MLXNN 6 | 7 | // based on https://github.com/ml-explore/mlx-examples/blob/main/mnist/main.py 8 | 9 | public class MLP: Module, UnaryLayer { 10 | 11 | @ModuleInfo var layers: [Linear] 12 | 13 | public init(layers: Int, inputDimensions: Int, hiddenDimensions: Int, outputDimensions: Int) { 14 | let layerSizes = 15 | [inputDimensions] + Array(repeating: hiddenDimensions, count: layers) + [ 16 | outputDimensions 17 | ] 18 | 19 | self.layers = zip(layerSizes.dropLast(), layerSizes.dropFirst()) 20 | .map { 21 | Linear($0, $1) 22 | } 23 | } 24 | 25 | public func callAsFunction(_ x: MLXArray) -> MLXArray { 26 | var x = x 27 | for l in layers.dropLast() { 28 | x = relu(l(x)) 29 | } 30 | return layers.last!(x) 31 | } 32 | } 33 | 34 | public func loss(model: MLP, x: MLXArray, y: MLXArray) -> MLXArray { 35 | crossEntropy(logits: model(x), targets: y, reduction: .mean) 36 | } 37 | 38 | public func eval(model: MLP, x: MLXArray, y: MLXArray) -> MLXArray { 39 | mean(argMax(model(x), axis: 1) .== y) 40 | } 41 | 42 | private struct BatchSequence: Sequence, IteratorProtocol { 43 | 44 | let batchSize: Int 45 | let x: MLXArray 46 | let y: MLXArray 47 | 48 | let indexes: MLXArray 49 | var index = 0 50 | 51 | init(batchSize: Int, x: MLXArray, y: MLXArray, using generator: inout any RandomNumberGenerator) 52 | { 53 | self.batchSize = batchSize 54 | self.x = x 55 | self.y = y 56 | self.indexes = MLXArray(Array(0 ..< y.size).shuffled(using: &generator)) 57 | } 58 | 59 | mutating func next() -> (MLXArray, MLXArray)? { 60 | guard index < y.size else { return nil } 61 | 62 | let range = index ..< Swift.min(index + batchSize, y.size) 63 | index += batchSize 64 | let ids = indexes[range] 65 | return (x[ids], y[ids]) 66 | } 67 | } 68 | 69 | public func iterateBatches( 70 | batchSize: Int, x: MLXArray, y: MLXArray, using generator: inout any RandomNumberGenerator 71 | ) -> some Sequence<(MLXArray, MLXArray)> { 72 | BatchSequence(batchSize: batchSize, x: x, y: y, using: &generator) 73 | } 74 | -------------------------------------------------------------------------------- /MLXChat/Views/PreferencePane.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PreferencePane.swift 3 | // MLXChat 4 | // 5 | // Created by Alfian Losari on 23/02/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct PreferencePane: View { 11 | 12 | @Binding var vm: ViewModel 13 | @State var importing = false 14 | 15 | var body: some View { 16 | TabView { 17 | Group { 18 | VStack { 19 | VStack { 20 | Button("Select MLX LLM Folder") { 21 | importing = true 22 | } 23 | .fileImporter( 24 | isPresented: $importing, 25 | allowedContentTypes: [.folder] 26 | ) { result in 27 | switch result { 28 | case .success(let url): 29 | vm.model = url 30 | case .failure(let error): 31 | print(error.localizedDescription) 32 | } 33 | } 34 | 35 | if let model = vm.model { 36 | Text(model.relativeString) 37 | } else { 38 | Text("No LLM Folder Selected") 39 | } 40 | } 41 | .padding(.bottom, 24) 42 | 43 | 44 | VStack(alignment: .leading) { 45 | Text("Max Tokens: \(Int(vm.maxTokens))") 46 | Slider(value: $vm.maxTokens, in: 50...1000) 47 | } 48 | 49 | VStack(alignment: .leading) { 50 | Text("Temperature: \(String(format: "%.1f", vm.temperature))") 51 | Slider(value: $vm.temperature, in: 0...1) 52 | } 53 | 54 | VStack(alignment: .leading) { 55 | Text("Seed: \(Int(vm.seed))") 56 | Slider(value: $vm.seed, in: 0...99999) 57 | } 58 | } 59 | .padding() 60 | } 61 | .tabItem { 62 | Label("LLM Settings", systemImage: "gearshape") 63 | } 64 | } 65 | .frame(width: 340, height: 280) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | .DS_Store 5 | /.build 6 | /Packages 7 | xcuserdata/ 8 | DerivedData/ 9 | .swiftpm/config/registries.json 10 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 11 | .netrc 12 | ## User settings 13 | xcuserdata/ 14 | 15 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 16 | *.xcscmblueprint 17 | *.xccheckout 18 | 19 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 20 | build/ 21 | DerivedData/ 22 | *.moved-aside 23 | *.pbxuser 24 | !default.pbxuser 25 | *.mode1v3 26 | !default.mode1v3 27 | *.mode2v3 28 | !default.mode2v3 29 | *.perspectivev3 30 | !default.perspectivev3 31 | 32 | ## Obj-C/Swift specific 33 | *.hmap 34 | 35 | ## App packaging 36 | *.ipa 37 | *.dSYM.zip 38 | *.dSYM 39 | 40 | ## Playgrounds 41 | timeline.xctimeline 42 | playground.xcworkspace 43 | 44 | # Swift Package Manager 45 | # 46 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 47 | # Packages/ 48 | # Package.pins 49 | # Package.resolved 50 | # *.xcodeproj 51 | # 52 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 53 | # hence it is not needed unless you have added a package configuration file to your project 54 | # .swiftpm 55 | 56 | .build/ 57 | 58 | # CocoaPods 59 | # 60 | # We recommend against adding the Pods directory to your .gitignore. However 61 | # you should judge for yourself, the pros and cons are mentioned at: 62 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 63 | # 64 | # Pods/ 65 | # 66 | # Add this line if you want to avoid checking in source code from the Xcode workspace 67 | # *.xcworkspace 68 | 69 | # Carthage 70 | # 71 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 72 | # Carthage/Checkouts 73 | 74 | Carthage/Build/ 75 | 76 | # Accio dependency management 77 | Dependencies/ 78 | .accio/ 79 | 80 | # fastlane 81 | # 82 | # It is recommended to not store the screenshots in the git repo. 83 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 84 | # For more information about the recommended setup visit: 85 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 86 | 87 | fastlane/report.xml 88 | fastlane/Preview.html 89 | fastlane/screenshots/**/*.png 90 | fastlane/test_output 91 | 92 | # Code Injection 93 | # 94 | # After new code Injection tools there's a generated folder /iOSInjectionProject 95 | # https://github.com/johnno1962/injectionforxcode 96 | 97 | iOSInjectionProject/ 98 | -------------------------------------------------------------------------------- /MLXChatXPCService/MLXChatXPCService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MLXChatXPCService.swift 3 | // MLXChatXPCService 4 | // 5 | // Created by Alfian Losari on 22/02/24. 6 | // 7 | 8 | import Foundation 9 | 10 | class MLXChatXPCService: NSObject, NSXPCListenerDelegate, MLXChatXPCServiceProtocol { 11 | 12 | let listener : NSXPCListener 13 | var connection : NSXPCConnection? 14 | var mlxChat: MLXChat? 15 | 16 | override init() { 17 | listener = NSXPCListener(machServiceName: xpcServiceLabel) 18 | super.init() 19 | listener.delegate = self 20 | } 21 | 22 | func start() { listener.resume() } 23 | func stop() { listener.suspend() } 24 | 25 | var clientApp : MLXChatClientProtocol { 26 | connection!.remoteObjectProxyWithErrorHandler { err in 27 | print(err) 28 | } as! MLXChatClientProtocol 29 | } 30 | 31 | // MARK: NSXPCListenerDelegate 32 | 33 | func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool { 34 | // Set the exported object of the new connection to be ourself 35 | newConnection.exportedObject = self 36 | 37 | // Specify the interface the exported object will conform to 38 | newConnection.exportedInterface = NSXPCInterface(with: MLXChatXPCServiceProtocol.self) 39 | 40 | // Set the XPC interface of the connection's remote object using the client app's protocol 41 | newConnection.remoteObjectInterface = NSXPCInterface(with: MLXChatClientProtocol.self) 42 | 43 | // New connection start in a suspended state and must be resumed 44 | newConnection.resume() 45 | 46 | // Retain a reference to the new connection for use later 47 | connection = newConnection 48 | 49 | // Always accept the incoming connection 50 | return true 51 | } 52 | 53 | @objc func prompt(text: String, model: String, maxTokens: Int, temperature: Float, seed: UInt64, completion: @escaping (Error?) -> Void) { 54 | Task { @MainActor [unowned self] in 55 | self.mlxChat = MLXChat(maxTokens: maxTokens, temperature: temperature, seed: seed) 56 | do { 57 | try self.mlxChat?.promptModel(text: text, model: model) { 58 | self.clientApp.tokenReceived(t: $0) 59 | } 60 | completion(nil) 61 | } catch { 62 | print(error.localizedDescription) 63 | completion(error) 64 | } 65 | exit(0) 66 | } 67 | } 68 | 69 | @objc func stopResponse() { 70 | self.mlxChat?.isCancelled = true 71 | } 72 | } 73 | 74 | extension String: Error {} 75 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/xcshareddata/xcschemes/Tutorial.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Libraries/MNIST/Files.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import Foundation 4 | import Gzip 5 | import MLX 6 | 7 | // based on https://github.com/ml-explore/mlx-examples/blob/main/mnist/mnist.py 8 | 9 | public enum Use: String, Hashable { 10 | case test 11 | case training 12 | } 13 | 14 | public enum DataKind: String, Hashable { 15 | case images 16 | case labels 17 | } 18 | 19 | public struct FileKind: Hashable, CustomStringConvertible { 20 | let use: Use 21 | let data: DataKind 22 | 23 | public init(_ use: Use, _ data: DataKind) { 24 | self.use = use 25 | self.data = data 26 | } 27 | 28 | public var description: String { 29 | "\(use.rawValue)-\(data.rawValue)" 30 | } 31 | } 32 | 33 | struct LoadInfo { 34 | let name: String 35 | let offset: Int 36 | let convert: (MLXArray) -> MLXArray 37 | } 38 | 39 | let baseURL = URL(string: "http://yann.lecun.com/exdb/mnist/")! 40 | 41 | let files = [ 42 | FileKind(.training, .images): LoadInfo( 43 | name: "train-images-idx3-ubyte.gz", 44 | offset: 16, 45 | convert: { 46 | $0.reshaped([-1, 28 * 28]).asType(.float32) / 255.0 47 | }), 48 | FileKind(.test, .images): LoadInfo( 49 | name: "t10k-images-idx3-ubyte.gz", 50 | offset: 16, 51 | convert: { 52 | $0.reshaped([-1, 28 * 28]).asType(.float32) / 255.0 53 | }), 54 | FileKind(.training, .labels): LoadInfo( 55 | name: "train-labels-idx1-ubyte.gz", 56 | offset: 8, 57 | convert: { 58 | $0.asType(.uint32) 59 | }), 60 | FileKind(.test, .labels): LoadInfo( 61 | name: "t10k-labels-idx1-ubyte.gz", 62 | offset: 8, 63 | convert: { 64 | $0.asType(.uint32) 65 | }), 66 | ] 67 | 68 | public func download(into: URL) async throws { 69 | for (_, info) in files { 70 | let fileURL = into.appending(component: info.name) 71 | if !FileManager.default.fileExists(atPath: fileURL.path()) { 72 | print("Download: \(info.name)") 73 | let url = baseURL.appending(component: info.name) 74 | let (data, response) = try await URLSession.shared.data(from: url) 75 | 76 | guard let httpResponse = response as? HTTPURLResponse else { 77 | fatalError("Unable to download \(url), not an http response: \(response)") 78 | } 79 | guard httpResponse.statusCode == 200 else { 80 | fatalError("Unable to download \(url): \(httpResponse)") 81 | } 82 | 83 | try data.write(to: fileURL) 84 | } 85 | } 86 | } 87 | 88 | public func load(from: URL) throws -> [FileKind: MLXArray] { 89 | var result = [FileKind: MLXArray]() 90 | 91 | for (key, info) in files { 92 | let fileURL = from.appending(component: info.name) 93 | let data = try Data(contentsOf: fileURL).gunzipped() 94 | 95 | let array = MLXArray( 96 | data.dropFirst(info.offset), [data.count - info.offset], type: UInt8.self) 97 | 98 | result[key] = info.convert(array) 99 | } 100 | 101 | return result 102 | } 103 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/xcshareddata/xcschemes/LinearModelTraining.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Tools/Tutorial/Tutorial.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import Foundation 4 | import MLX 5 | 6 | /// mlx-swift tutorial based on: 7 | /// https://github.com/ml-explore/mlx/blob/main/examples/cpp/tutorial.cpp 8 | @main 9 | struct Tutorial { 10 | 11 | static func scalarBasics() { 12 | // create a scalar array 13 | let x = MLXArray(1.0) 14 | 15 | // the datatype is .float32 16 | let dtype = x.dtype 17 | assert(dtype == .float32) 18 | 19 | // get the value 20 | let s = x.item(Float.self) 21 | assert(s == 1.0) 22 | 23 | // reading the value with a different type is a fatal error 24 | // let i = x.item(Int.self) 25 | 26 | // scalars have a size of 1 27 | let size = x.size 28 | assert(size == 1) 29 | 30 | // scalars have 0 dimensions 31 | let ndim = x.ndim 32 | assert(ndim == 0) 33 | 34 | // scalar shapes are empty arrays 35 | let shape = x.shape 36 | assert(shape == []) 37 | } 38 | 39 | static func arrayBasics() { 40 | // make a multidimensional array. 41 | // 42 | // Note: the argument is a [Double] array literal, which is not 43 | // a supported type, but we can explicitly convert it to [Float] 44 | // when we create the MLXArray. 45 | let x = MLXArray(converting: [1.0, 2.0, 3.0, 4.0], [2, 2]) 46 | 47 | // mlx is row-major by default so the first row of this array 48 | // is [1.0, 2.0] and the second row is [3.0, 4.0] 49 | print(x[0]) 50 | print(x[1]) 51 | 52 | // make an array of shape [2, 2] filled with ones 53 | let y = MLXArray.ones([2, 2]) 54 | 55 | // pointwise add x and y 56 | let z = x + y 57 | 58 | // mlx is lazy by default. At this point `z` only 59 | // has a shape and a type but no actual data 60 | assert(z.dtype == .float32) 61 | assert(z.shape == [2, 2]) 62 | 63 | // To actually run the computation you must evaluate `z`. 64 | // Under the hood, mlx records operations in a graph. 65 | // The variable `z` is a node in the graph which points to its operation 66 | // and inputs. When `eval` is called on an array (or arrays), the array and 67 | // all of its dependencies are recursively evaluated to produce the result. 68 | // Once an array is evaluated, it has data and is detached from its inputs. 69 | 70 | // Note: this is being called for demonstration purposes -- all reads 71 | // ensure the array is evaluated. 72 | z.eval() 73 | 74 | // this implicitly evaluates z before converting to a description 75 | print(z) 76 | } 77 | 78 | static func automaticDifferentiation() { 79 | func fn(_ x: MLXArray) -> MLXArray { 80 | x.square() 81 | } 82 | 83 | let gradFn = grad(fn) 84 | 85 | let x = MLXArray(1.5) 86 | let dfdx = gradFn(x) 87 | print(dfdx) 88 | 89 | assert(dfdx.item() == Float(2 * 1.5)) 90 | 91 | let df2dx2 = grad(grad(fn))(x) 92 | print(df2dx2) 93 | 94 | assert(df2dx2.item() == Float(2)) 95 | } 96 | 97 | static func main() { 98 | scalarBasics() 99 | arrayBasics() 100 | automaticDifferentiation() 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/xcshareddata/xcschemes/mnist-tool.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 43 | 45 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 66 | 68 | 74 | 75 | 76 | 77 | 79 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /Libraries/Llama/Util.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import AsyncAlgorithms 4 | import Foundation 5 | import MLX 6 | import MLXNN 7 | import MLXRandom 8 | @_exported import SentencePiece 9 | 10 | /// Load and return the model and tokenizer 11 | public func load(modelDirectory: URL) throws -> (Model, SentencePiece) { 12 | let tokenizer = try SentencePiece(model: modelDirectory.appending(component: "tokenizer.model")) 13 | 14 | // load the model parameters 15 | let configurationURL = modelDirectory.appending(component: "config.json") 16 | let configuration = try JSONDecoder().decode( 17 | Configuration.self, from: Data(contentsOf: configurationURL)) 18 | 19 | // set up the model 20 | let model = Model(configuration) 21 | if let quantization = configuration.quantization { 22 | QuantizedLinear.quantize( 23 | model: model, groupSize: quantization.groupSize, bits: quantization.bits) 24 | } 25 | 26 | // apply the loaded weights 27 | let weights = try loadArrays(url: modelDirectory.appending(component: "weights.00.safetensors")) 28 | let parameters = ModuleParameters.unflattened(weights) 29 | try model.update(parameters: parameters, verify: [.all]) 30 | eval(model.parameters()) 31 | 32 | return (model, tokenizer) 33 | } 34 | 35 | private func sample(logits: MLXArray, temp: Float) -> MLXArray { 36 | if temp == 0 { 37 | return argMax(logits, axis: -1) 38 | } else { 39 | return categorical(logits * (1 / temp)) 40 | } 41 | } 42 | 43 | /// Synchronous generator of tokens. 44 | /// 45 | /// Port of `generate_step()` from https://github.com/ml-explore/mlx-examples/blob/main/llms/mlx_lm/utils.py 46 | public struct TokenIterator: Sequence, IteratorProtocol { 47 | let model: Model 48 | let temp: Float 49 | 50 | var y: MLXArray 51 | var cache: [(MLXArray, MLXArray)] 52 | 53 | var first = true 54 | 55 | public init(prompt: MLXArray, model: Model, temp: Float = 0.0) { 56 | self.model = model 57 | self.temp = temp 58 | self.y = prompt 59 | self.cache = [] 60 | } 61 | 62 | mutating public func next() -> MLXArray? { 63 | var logits: MLXArray 64 | (logits, cache) = model(expandedDimensions(y, axis: 0), cache: cache.isEmpty ? nil : cache) 65 | y = sample(logits: logits[-1, axis: 1], temp: temp) 66 | 67 | return y 68 | } 69 | } 70 | 71 | /// Async generator of tokens. 72 | /// 73 | /// Port of `generate_step()` from https://github.com/ml-explore/mlx-examples/blob/main/llms/mlx_lm/utils.py. 74 | /// 75 | /// Note that because MLXArray is not thread safe this eval's the result and sends the TokenId back 76 | /// to the caller. 77 | public func generate(prompt: MLXArray, model: Model, temp: Float = 0.0) -> ( 78 | Task, AsyncBufferSequence> 79 | ) { 80 | let channel = AsyncChannel() 81 | let buffer = channel.buffer(policy: .bounded(10)) 82 | 83 | let task = Task { 84 | var y = prompt 85 | var cache = [(MLXArray, MLXArray)]() 86 | 87 | while !Task.isCancelled { 88 | var logits: MLXArray 89 | (logits, cache) = model( 90 | expandedDimensions(y, axis: 0), cache: cache.isEmpty ? nil : cache) 91 | y = sample(logits: logits[-1, axis: 1], temp: temp) 92 | eval(y) 93 | 94 | await channel.send(y.asType(TokenId.self).item()) 95 | } 96 | } 97 | 98 | return (task, buffer) 99 | } 100 | -------------------------------------------------------------------------------- /Tools/mnist-tool/MNISTTool.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import ArgumentParser 4 | import Foundation 5 | import MLX 6 | import MLXNN 7 | import MLXOptimizers 8 | import MLXRandom 9 | import MNIST 10 | 11 | @main 12 | struct MNISTTool: AsyncParsableCommand { 13 | static var configuration = CommandConfiguration( 14 | abstract: "Command line tool for training mnist models", 15 | subcommands: [Train.self], 16 | defaultSubcommand: Train.self) 17 | } 18 | 19 | extension MLX.DeviceType: ExpressibleByArgument { 20 | public init?(argument: String) { 21 | self.init(rawValue: argument) 22 | } 23 | } 24 | 25 | struct Train: AsyncParsableCommand { 26 | 27 | @Option(name: .long, help: "Directory with the training data") 28 | var data: String 29 | 30 | @Option(name: .long, help: "The PRNG seed") 31 | var seed: UInt64 = 0 32 | 33 | @Option var layers = 2 34 | @Option var hidden = 32 35 | @Option var batchSize = 256 36 | @Option var epochs = 20 37 | @Option var learningRate: Float = 1e-1 38 | 39 | @Option var classes = 10 40 | 41 | @Option var device = DeviceType.cpu 42 | 43 | @Flag var compile = false 44 | 45 | func run() async throws { 46 | Device.setDefault(device: Device(device)) 47 | 48 | MLXRandom.seed(seed) 49 | var generator: RandomNumberGenerator = SplitMix64(seed: seed) 50 | 51 | // load the data 52 | let url = URL(filePath: data) 53 | 54 | try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true) 55 | try await download(into: url) 56 | 57 | let data = try load(from: url) 58 | 59 | let trainImages = data[.init(.training, .images)]! 60 | let trainLabels = data[.init(.training, .labels)]! 61 | let testImages = data[.init(.test, .images)]! 62 | let testLabels = data[.init(.test, .labels)]! 63 | 64 | // create the model 65 | let model = MLP( 66 | layers: layers, inputDimensions: trainImages.dim(-1), hiddenDimensions: hidden, 67 | outputDimensions: classes) 68 | eval(model.parameters()) 69 | 70 | let lg = valueAndGrad(model: model, loss) 71 | let optimizer = SGD(learningRate: learningRate) 72 | 73 | func step(_ x: MLXArray, _ y: MLXArray) -> MLXArray { 74 | let (loss, grads) = lg(model, x, y) 75 | optimizer.update(model: model, gradients: grads) 76 | return loss 77 | } 78 | 79 | let resolvedStep = 80 | compile 81 | ? MLX.compile(inputs: [model, optimizer], outputs: [model, optimizer], step) : step 82 | 83 | for e in 0 ..< epochs { 84 | let start = Date.timeIntervalSinceReferenceDate 85 | 86 | for (x, y) in iterateBatches( 87 | batchSize: batchSize, x: trainImages, y: trainLabels, using: &generator) 88 | { 89 | _ = resolvedStep(x, y) 90 | 91 | // eval the parameters so the next iteration is independent 92 | eval(model, optimizer) 93 | } 94 | 95 | let accuracy = eval(model: model, x: testImages, y: testLabels) 96 | 97 | let end = Date.timeIntervalSinceReferenceDate 98 | 99 | print( 100 | """ 101 | Epoch \(e): test accuracy \(accuracy.item(Float.self).formatted()) 102 | Time: \((end - start).formatted()) 103 | 104 | """ 105 | ) 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/xcshareddata/xcschemes/llm-tool.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 43 | 45 | 51 | 52 | 53 | 54 | 57 | 58 | 61 | 62 | 65 | 66 | 67 | 68 | 74 | 76 | 82 | 83 | 84 | 85 | 87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /MLXChat/Views/MessageRowView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessageRowView.swift 3 | // XCAChatGPT 4 | // 5 | // Created by Alfian Losari on 02/02/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct MessageRowView: View { 11 | 12 | @Environment(\.colorScheme) private var colorScheme 13 | let message: MessageRow 14 | let retryCallback: (MessageRow) -> Void 15 | 16 | var imageSize: CGSize { 17 | CGSize(width: 25, height: 25) 18 | } 19 | 20 | var body: some View { 21 | VStack(spacing: 0) { 22 | messageRow(rowType: message.send, image: message.sendImage, bgColor: colorScheme == .light ? .white : Color(red: 52/255, green: 53/255, blue: 65/255, opacity: 0.5)) 23 | 24 | if let response = message.response { 25 | Divider() 26 | messageRow(rowType: response, image: message.responseImage, bgColor: colorScheme == .light ? .gray.opacity(0.1) : Color(red: 52/255, green: 53/255, blue: 65/255, opacity: 1), responseError: message.responseError, showDotLoading: message.isInteracting) 27 | Divider() 28 | } 29 | } 30 | } 31 | 32 | func messageRow(rowType: MessageRowType, image: String, bgColor: Color, responseError: String? = nil, showDotLoading: Bool = false) -> some View { 33 | HStack(alignment: .top, spacing: 24) { 34 | messageRowContent(rowType: rowType, image: image, responseError: responseError, showDotLoading: showDotLoading) 35 | } 36 | .padding(16) 37 | .frame(maxWidth: .infinity, alignment: .leading) 38 | .background(bgColor) 39 | } 40 | 41 | @ViewBuilder 42 | func messageRowContent(rowType: MessageRowType, image: String, responseError: String? = nil, showDotLoading: Bool = false) -> some View { 43 | if image.hasPrefix("http"), let url = URL(string: image) { 44 | AsyncImage(url: url) { image in 45 | image 46 | .resizable() 47 | .frame(width: imageSize.width, height: imageSize.height) 48 | } placeholder: { 49 | ProgressView() 50 | } 51 | 52 | } else { 53 | Image(image) 54 | .resizable() 55 | .frame(width: imageSize.width, height: imageSize.height) 56 | } 57 | 58 | VStack(alignment: .leading) { 59 | switch rowType { 60 | case .attributed(let attributedOutput): 61 | attributedView(results: attributedOutput.results) 62 | 63 | case .rawText(let text): 64 | if !text.isEmpty { 65 | Text(text) 66 | .multilineTextAlignment(.leading) 67 | .textSelection(.enabled) 68 | } 69 | } 70 | 71 | if let error = responseError { 72 | Text("Error: \(error)") 73 | .foregroundColor(.red) 74 | .multilineTextAlignment(.leading) 75 | 76 | Button("Regenerate response") { 77 | retryCallback(message) 78 | } 79 | .foregroundColor(.accentColor) 80 | .padding(.top) 81 | } 82 | 83 | if showDotLoading { 84 | DotLoadingView() 85 | .frame(width: 60, height: 30) 86 | } 87 | } 88 | } 89 | 90 | func attributedView(results: [ParserResult]) -> some View { 91 | VStack(alignment: .leading, spacing: 0) { 92 | ForEach(results) { parsed in 93 | Text(parsed.attributedString) 94 | .textSelection(.enabled) 95 | } 96 | } 97 | } 98 | 99 | 100 | } 101 | 102 | -------------------------------------------------------------------------------- /MLXChat/Views/ContentView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct ContentView: View { 4 | 5 | @Environment(\.colorScheme) var colorScheme 6 | @Binding var vm: ViewModel 7 | @FocusState var isTextFieldFocused: Bool 8 | 9 | var body: some View { 10 | chatListView 11 | } 12 | 13 | var chatListView: some View { 14 | ScrollViewReader { proxy in 15 | VStack(spacing: 0) { 16 | ScrollView { 17 | LazyVStack(spacing: 0) { 18 | ForEach(vm.messages) { message in 19 | MessageRowView(message: message) { 20 | vm.retry(message: $0) 21 | } 22 | } 23 | } 24 | .onTapGesture { 25 | isTextFieldFocused = false 26 | } 27 | } 28 | Divider() 29 | bottomView(image: "profile", proxy: proxy) 30 | Spacer() 31 | } 32 | .onChange(of: vm.messages.last?.responseText) { _ in scrollToBottom(proxy: proxy) 33 | } 34 | } 35 | .background(colorScheme == .light ? .white : Color(red: 52/255, green: 53/255, blue: 65/255, opacity: 0.5)) 36 | } 37 | 38 | func bottomView(image: String, proxy: ScrollViewProxy) -> some View { 39 | VStack { 40 | 41 | HStack(alignment: .top, spacing: 8) { 42 | if image.hasPrefix("http"), let url = URL(string: image) { 43 | AsyncImage(url: url) { image in 44 | image 45 | .resizable() 46 | .frame(width: 30, height: 30) 47 | } placeholder: { 48 | ProgressView() 49 | } 50 | 51 | } else { 52 | Image(image) 53 | .resizable() 54 | .frame(width: 30, height: 30) 55 | } 56 | 57 | TextField("Send message", text: $vm.inputMessage, axis: .vertical) 58 | .autocorrectionDisabled() 59 | .textFieldStyle(.roundedBorder) 60 | .focused($isTextFieldFocused) 61 | .disabled(vm.isPrompting) 62 | 63 | if vm.isPrompting { 64 | Button { 65 | vm.cancelStreamingResponse() 66 | } label: { 67 | Image(systemName: "stop.circle.fill") 68 | .font(.system(size: 30)) 69 | .symbolRenderingMode(.multicolor) 70 | .foregroundColor(.red) 71 | 72 | }.buttonStyle(.borderless) 73 | } else { 74 | Button { 75 | Task { @MainActor in 76 | isTextFieldFocused = false 77 | scrollToBottom(proxy: proxy) 78 | vm.sendTapped() 79 | } 80 | } label: { 81 | Image(systemName: "paperplane.circle.fill") 82 | .rotationEffect(.degrees(45)) 83 | .font(.system(size: 30)) 84 | } 85 | .padding(.top, -4) 86 | .buttonStyle(.borderless) 87 | .keyboardShortcut(.defaultAction) 88 | .foregroundColor(.accentColor) 89 | .disabled(vm.inputMessage.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty) 90 | } 91 | } 92 | } 93 | .padding(.horizontal, 16) 94 | .padding(.top, 12) 95 | } 96 | 97 | private func scrollToBottom(proxy: ScrollViewProxy) { 98 | guard let id = vm.messages.last?.id else { return } 99 | proxy.scrollTo(id, anchor: .bottomTrailing) 100 | } 101 | } 102 | 103 | -------------------------------------------------------------------------------- /Tools/LinearModelTraining/LinearModelTraining.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import ArgumentParser 4 | import Foundation 5 | import MLX 6 | import MLXNN 7 | import MLXOptimizers 8 | import MLXRandom 9 | 10 | extension MLX.DeviceType: ExpressibleByArgument { 11 | public init?(argument: String) { 12 | self.init(rawValue: argument) 13 | } 14 | } 15 | 16 | @main 17 | struct Train: AsyncParsableCommand { 18 | 19 | @Option var epochs = 20 20 | @Option var batchSize = 8 21 | 22 | @Option var m: Float = 0.25 23 | @Option var b: Float = 7 24 | 25 | @Flag var compile = false 26 | 27 | @Option var device = DeviceType.cpu 28 | 29 | func run() async throws { 30 | Device.setDefault(device: Device(device)) 31 | 32 | // A very simple model that implements the equation 33 | // for a linear function: y = mx + b. This can be trained 34 | // to match data -- in this case an unknown (to the model) 35 | // linear function. 36 | // 37 | // This is a nice example because most people know how 38 | // linear functions work and we can see how the slope 39 | // and intercept converge. 40 | class LinearFunctionModel: Module, UnaryLayer { 41 | let m = MLXRandom.uniform(low: -5.0, high: 5.0) 42 | let b = MLXRandom.uniform(low: -5.0, high: 5.0) 43 | 44 | func callAsFunction(_ x: MLXArray) -> MLXArray { 45 | m * x + b 46 | } 47 | } 48 | 49 | // measure the distance from the prediction (model(x)) and the 50 | // ground truth (y). this gives feedback on how close the 51 | // prediction is from matching the truth 52 | func loss(model: LinearFunctionModel, x: MLXArray, y: MLXArray) -> MLXArray { 53 | mseLoss(predictions: model(x), targets: y, reduction: .mean) 54 | } 55 | 56 | let model = LinearFunctionModel() 57 | eval(model.parameters()) 58 | 59 | let lg = valueAndGrad(model: model, loss) 60 | 61 | // the optimizer will use the gradients update the model parameters 62 | let optimizer = SGD(learningRate: 1e-1) 63 | 64 | // the function to train our model against -- it doesn't have 65 | // to be linear, but matching what the model models is easy 66 | // to understand 67 | func f(_ x: MLXArray) -> MLXArray { 68 | // these are the target parameters 69 | let m = self.m 70 | let b = self.b 71 | 72 | // our actual function 73 | return m * x + b 74 | } 75 | 76 | func step(_ x: MLXArray, _ y: MLXArray) -> MLXArray { 77 | let (loss, grads) = lg(model, x, y) 78 | optimizer.update(model: model, gradients: grads) 79 | return loss 80 | } 81 | 82 | let resolvedStep = 83 | self.compile 84 | ? MLX.compile(inputs: [model, optimizer], outputs: [model, optimizer], step) : step 85 | 86 | for _ in 0 ..< epochs { 87 | // we expect that the parameters will approach the targets 88 | print("target: b = \(b), m = \(m)") 89 | print("parameters: \(model.parameters())") 90 | 91 | // generate random training data along with the ground truth. 92 | // notice that the shape is [B, 1] where B is the batch 93 | // dimension -- this allows us to train on several samples simultaneously 94 | // 95 | // note: a very large batch size will take longer to converge because 96 | // the gradient will be representing too many samples down into 97 | // a single float parameter. 98 | let x = MLXRandom.uniform(low: -5.0, high: 5.0, [batchSize, 1]) 99 | let y = f(x) 100 | eval(x, y) 101 | 102 | // compute the loss and gradients. use the optimizer 103 | // to adjust the parameters closer to the target 104 | let loss = resolvedStep(x, y) 105 | 106 | eval(model, optimizer) 107 | 108 | // we should see this converge toward 0 109 | print("loss: \(loss)") 110 | } 111 | 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Libraries/Llama/Configuration.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import Foundation 4 | 5 | public enum StringOrNumber: Codable, Equatable { 6 | case string(String) 7 | case float(Float) 8 | 9 | public init(from decoder: Decoder) throws { 10 | let values = try decoder.singleValueContainer() 11 | 12 | if let v = try? values.decode(Float.self) { 13 | self = .float(v) 14 | } else { 15 | let v = try values.decode(String.self) 16 | self = .string(v) 17 | } 18 | } 19 | 20 | public func encode(to encoder: Encoder) throws { 21 | var container = encoder.singleValueContainer() 22 | switch self { 23 | case .string(let v): try container.encode(v) 24 | case .float(let v): try container.encode(v) 25 | } 26 | } 27 | } 28 | 29 | public struct Configuration: Codable { 30 | 31 | public struct Quantization: Codable { 32 | public init(groupSize: Int, bits: Int) { 33 | self.groupSize = groupSize 34 | self.bits = bits 35 | } 36 | 37 | let groupSize: Int 38 | let bits: Int 39 | 40 | enum CodingKeys: String, CodingKey { 41 | case groupSize = "group_size" 42 | case bits = "bits" 43 | } 44 | } 45 | 46 | var hiddenSize: Int 47 | var hiddenLayers: Int 48 | var intermediateSize: Int 49 | var attentionHeads: Int 50 | var rmsNormEps: Float 51 | var vocabularySize: Int 52 | var kvHeads: Int 53 | var ropeTheta: Float = 10_000 54 | var ropeTraditional: Bool = false 55 | var modelType: String? = nil 56 | var ropeScaling: [String: StringOrNumber]? = nil 57 | 58 | var quantization: Quantization? 59 | 60 | enum CodingKeys: String, CodingKey { 61 | case hiddenSize = "hidden_size" 62 | case hiddenLayers = "num_hidden_layers" 63 | case intermediateSize = "intermediate_size" 64 | case attentionHeads = "num_attention_heads" 65 | case rmsNormEps = "rms_norm_eps" 66 | case vocabularySize = "vocab_size" 67 | case kvHeads = "num_key_value_heads" 68 | case ropeTheta = "rope_theta" 69 | case ropeTraditional = "rope_traditional" 70 | case modelType = "model_type" 71 | case ropeScaling = "rope_scaling" 72 | case quantization 73 | } 74 | 75 | public init(from decoder: Decoder) throws { 76 | // custom implementation to handle optional keys with required values 77 | let container: KeyedDecodingContainer = try decoder.container( 78 | keyedBy: Configuration.CodingKeys.self) 79 | 80 | self.hiddenSize = try container.decode( 81 | Int.self, forKey: Configuration.CodingKeys.hiddenSize) 82 | self.hiddenLayers = try container.decode( 83 | Int.self, forKey: Configuration.CodingKeys.hiddenLayers) 84 | self.intermediateSize = try container.decode( 85 | Int.self, forKey: Configuration.CodingKeys.intermediateSize) 86 | self.attentionHeads = try container.decode( 87 | Int.self, forKey: Configuration.CodingKeys.attentionHeads) 88 | self.rmsNormEps = try container.decode( 89 | Float.self, forKey: Configuration.CodingKeys.rmsNormEps) 90 | self.vocabularySize = try container.decode( 91 | Int.self, forKey: Configuration.CodingKeys.vocabularySize) 92 | self.kvHeads = try container.decode(Int.self, forKey: Configuration.CodingKeys.kvHeads) 93 | self.ropeTheta = 94 | try container.decodeIfPresent(Float.self, forKey: Configuration.CodingKeys.ropeTheta) 95 | ?? 10_000 96 | self.ropeTraditional = 97 | try container.decodeIfPresent( 98 | Bool.self, forKey: Configuration.CodingKeys.ropeTraditional) ?? false 99 | self.modelType = try container.decodeIfPresent( 100 | String.self, forKey: Configuration.CodingKeys.modelType) 101 | self.ropeScaling = try container.decodeIfPresent( 102 | [String: StringOrNumber].self, forKey: Configuration.CodingKeys.ropeScaling) 103 | self.quantization = try container.decodeIfPresent( 104 | Configuration.Quantization.self, forKey: Configuration.CodingKeys.quantization) 105 | 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Tools/llm-tool/LLMTool.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import ArgumentParser 4 | import Foundation 5 | import Llama 6 | import MLX 7 | import MLXRandom 8 | 9 | struct LLMTool: AsyncParsableCommand { 10 | static var configuration = CommandConfiguration( 11 | abstract: "Command line tool for generating text using Llama models", 12 | subcommands: [SyncGenerator.self, AsyncGenerator.self], 13 | defaultSubcommand: SyncGenerator.self) 14 | } 15 | 16 | @main 17 | struct SyncGenerator: ParsableCommand { 18 | 19 | static var configuration = CommandConfiguration( 20 | commandName: "sync", 21 | abstract: "Synchronous generator" 22 | ) 23 | 24 | @Option(name: .long, help: "Path to the directory with the model and tokenizer weights") 25 | var model: String 26 | 27 | @Option(name: .shortAndLong, help: "The message to be processed by the model") 28 | var prompt = "hello" 29 | 30 | @Option(name: .shortAndLong, help: "Maximum number of tokens to generate") 31 | var maxTokens = 10000 32 | 33 | @Option(name: .shortAndLong, help: "The sampling temperature") 34 | var temperature: Float = 0.0 35 | 36 | @Option(name: .long, help: "The PRNG seed") 37 | var seed: UInt64 = 0 38 | 39 | func run() throws { 40 | MLXRandom.seed(seed) 41 | 42 | let (model, tokenizer) = try load(modelDirectory: URL(filePath: model)) 43 | 44 | print("Starting generation ...") 45 | print(prompt, terminator: "") 46 | 47 | var start = Date.timeIntervalSinceReferenceDate 48 | var promptTime: TimeInterval = 0 49 | 50 | let prompt = try MLXArray(tokenizer.encode(prompt)) 51 | 52 | var ntok = 0 53 | for token in TokenIterator(prompt: prompt, model: model, temp: temperature) { 54 | if ntok == 0 { 55 | eval(token) 56 | let now = Date.timeIntervalSinceReferenceDate 57 | promptTime = now - start 58 | start = now 59 | } 60 | 61 | eval(token) 62 | let ids = [token.asType(TokenId.self).item(TokenId.self)] 63 | let s = try tokenizer.decode(ids) 64 | print(s, terminator: "") 65 | fflush(stdout) 66 | 67 | ntok += ids.count 68 | if ntok == maxTokens { 69 | break 70 | } 71 | } 72 | 73 | print() 74 | print("------") 75 | let now = Date.timeIntervalSinceReferenceDate 76 | let generateTime = now - start 77 | 78 | print( 79 | """ 80 | Prompt Tokens per second: \((Double(prompt.size) / promptTime).formatted()) 81 | Generation tokens per second: \((Double(ntok - 1) / generateTime).formatted()) 82 | """) 83 | } 84 | } 85 | 86 | /// Example of an async generator. 87 | /// 88 | /// Note that all of the computation is done on another thread and TokenId (Int32) are sent 89 | /// rather than MLXArray. 90 | struct AsyncGenerator: AsyncParsableCommand { 91 | 92 | static var configuration = CommandConfiguration( 93 | commandName: "async", 94 | abstract: "async generator" 95 | ) 96 | 97 | @Option(name: .long, help: "Path to the directory with the model and tokenizer weights") 98 | var model: String 99 | 100 | @Option(name: .shortAndLong, help: "The message to be processed by the model") 101 | var prompt = "hello" 102 | 103 | @Option(name: .shortAndLong, help: "Maximum number of tokens to generate") 104 | var maxTokens = 100 105 | 106 | @Option(name: .shortAndLong, help: "The sampling temperature") 107 | var temperature: Float = 0.0 108 | 109 | @Option(name: .long, help: "The PRNG seed") 110 | var seed: UInt64 = 0 111 | 112 | func run() async throws { 113 | MLXRandom.seed(seed) 114 | 115 | let (model, tokenizer) = try load(modelDirectory: URL(filePath: model)) 116 | 117 | print("Starting generation ...") 118 | print(prompt, terminator: "") 119 | 120 | var start = Date.timeIntervalSinceReferenceDate 121 | var promptTime: TimeInterval = 0 122 | 123 | let prompt = try MLXArray(tokenizer.encode(prompt)) 124 | 125 | let (task, channel) = generate(prompt: prompt, model: model, temp: temperature) 126 | 127 | var ntok = 0 128 | for await token in channel { 129 | if ntok == 0 { 130 | let now = Date.timeIntervalSinceReferenceDate 131 | promptTime = now - start 132 | start = now 133 | } 134 | 135 | let s = try tokenizer.decode([token]) 136 | print(s, terminator: "") 137 | fflush(stdout) 138 | 139 | ntok += 1 140 | if ntok == maxTokens { 141 | break 142 | } 143 | } 144 | 145 | // tell the task to stop 146 | task.cancel() 147 | 148 | print() 149 | print("------") 150 | let now = Date.timeIntervalSinceReferenceDate 151 | let generateTime = now - start 152 | 153 | print( 154 | """ 155 | Prompt Tokens per second: \((Double(prompt.size) / promptTime).formatted()) 156 | Generation tokens per second: \((Double(ntok - 1) / generateTime).formatted()) 157 | """) 158 | 159 | // wait for the task to complete -- since it is running async, it might 160 | // be in the middle of running the model 161 | try? await Task.sleep(for: .milliseconds(500)) 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /MLXChat/ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectionVM.swift 3 | // MLXChat 4 | // 5 | // Created by Alfian Losari on 22/02/24. 6 | // 7 | 8 | import Observation 9 | import Foundation 10 | 11 | @Observable 12 | class ViewModel: NSObject, MLXChatClientProtocol { 13 | 14 | private var _connection: NSXPCConnection! 15 | var messages: [MessageRow] = [] 16 | var inputMessage = "" 17 | var isPrompting = false 18 | 19 | var model: URL? { 20 | didSet { 21 | if let model = model { 22 | UserDefaults.standard.setValue(model.absoluteString, forKey: "model") 23 | } else { 24 | UserDefaults.standard.setValue(nil, forKey: "model") 25 | } 26 | } 27 | } 28 | 29 | var maxTokens: Float = 250 { 30 | didSet { 31 | UserDefaults.standard.set(maxTokens, forKey: "maxTokens") 32 | } 33 | } 34 | 35 | var temperature = 0.5 { 36 | didSet { 37 | UserDefaults.standard.set(temperature, forKey: "temperature") 38 | } 39 | } 40 | 41 | var seed: Double = Double.random(in: 0...99999) { 42 | didSet { 43 | UserDefaults.standard.set(seed, forKey: "seed") 44 | } 45 | } 46 | 47 | override init() { 48 | if let model = UserDefaults.standard.value(forKey: "model") as? String, let url = URL(string: model) { 49 | self.model = url 50 | } 51 | 52 | self.maxTokens = UserDefaults.standard.value(forKey: "maxTokens") as? Float ?? 250 53 | self.temperature = UserDefaults.standard.value(forKey: "temperature") as? Double ?? 0.5 54 | self.seed = UserDefaults.standard.value(forKey: "seed") as? Double ?? Double.random(in: 0...99999) 55 | super.init() 56 | } 57 | 58 | // MARK: Methods 59 | 60 | func prompt(_ prompt: String) { 61 | let text = prompt.trimmingCharacters(in: .whitespacesAndNewlines) 62 | guard !text.isEmpty else { return } 63 | isPrompting = true 64 | self.inputMessage = "" 65 | 66 | 67 | var messageRow = MessageRow( 68 | isInteracting: true, 69 | sendImage: "profile", 70 | send: .rawText(text), 71 | responseImage: "bot", 72 | response: .rawText(""), 73 | responseError: nil) 74 | 75 | defer { self.messages.append(messageRow) } 76 | 77 | guard let model else { 78 | messageRow.isInteracting = false 79 | messageRow.responseError = "Please select a folder containing the LocalLLM model first. You can get it from https://huggingface.co/mlx-community" 80 | return 81 | } 82 | 83 | xpcService().prompt(text: text, model: model.absoluteString, maxTokens: Int(maxTokens), temperature: Float(temperature), seed: UInt64(seed)) { error in 84 | DispatchQueue.main.async { [unowned self] in 85 | self.updateLastMessageInList { message in 86 | message.isInteracting = false 87 | if let error = error { 88 | message.responseError = error.localizedDescription 89 | } else { 90 | message.response = .rawText(message.responseText?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "") 91 | } 92 | } 93 | self.isPrompting = false 94 | self.invalidateConnection() 95 | } 96 | } 97 | } 98 | 99 | func retry(message: MessageRow) { 100 | guard let index = messages.firstIndex(where: { $0.id == message.id }) else { 101 | return 102 | } 103 | self.messages.remove(at: index) 104 | self.prompt(message.sendText) 105 | } 106 | 107 | func tokenReceived(t: String) { 108 | DispatchQueue.main.async { [unowned self] in 109 | updateLastMessageInList { message in 110 | let text = message.responseText ?? "" 111 | message.response = .rawText(text + t) 112 | } 113 | } 114 | } 115 | 116 | func sendTapped() { 117 | prompt(self.inputMessage) 118 | } 119 | 120 | func clearMessages() { 121 | self.messages = [] 122 | } 123 | 124 | func cancelStreamingResponse() { 125 | self.xpcService().stopResponse() 126 | self.isPrompting = false 127 | updateLastMessageInList { message in 128 | message.responseError = "Cancelled" 129 | message.isInteracting = false 130 | } 131 | } 132 | 133 | func updateLastMessageInList(updateHandler: (inout MessageRow) -> Void) { 134 | var messageRow = messages[self.messages.count - 1] 135 | updateHandler(&messageRow) 136 | self.messages[self.messages.count - 1] = messageRow 137 | } 138 | 139 | // MARK: XPC 140 | private func establishConnection() -> Void { 141 | _connection = NSXPCConnection(serviceName: xpcServiceLabel) 142 | _connection.remoteObjectInterface = NSXPCInterface(with: MLXChatXPCServiceProtocol.self) 143 | 144 | _connection.exportedObject = self 145 | _connection.exportedInterface = NSXPCInterface(with: MLXChatClientProtocol.self) 146 | 147 | _connection.interruptionHandler = { 148 | NSLog("connection to XPC service has been interrupted") 149 | } 150 | _connection.invalidationHandler = { 151 | NSLog("connection to XPC service has been invalidated") 152 | self._connection = nil 153 | } 154 | _connection.resume() 155 | 156 | NSLog("successfully connected to XPC service") 157 | } 158 | 159 | private func xpcService() -> MLXChatXPCServiceProtocol { 160 | if _connection == nil { 161 | NSLog("no connection to XPC service") 162 | establishConnection() 163 | } 164 | 165 | return _connection.remoteObjectProxyWithErrorHandler { err in 166 | print(err) 167 | } as! MLXChatXPCServiceProtocol 168 | } 169 | 170 | private func invalidateConnection() -> Void { 171 | guard _connection != nil else { NSLog("no connection to invalidate"); return } 172 | _connection.invalidate() 173 | } 174 | 175 | } 176 | -------------------------------------------------------------------------------- /Libraries/Llama/Llama.swift: -------------------------------------------------------------------------------- 1 | // Copyright © 2024 Apple Inc. 2 | 3 | import Foundation 4 | import MLX 5 | import MLXNN 6 | 7 | // port of https://github.com/ml-explore/mlx-examples/blob/main/llms/mlx_lm/models/llama.py 8 | 9 | public class Attention: Module { 10 | 11 | let args: Configuration 12 | let repeats: Int 13 | let scale: Float 14 | 15 | @ModuleInfo(key: "q_proj") var wq: Linear 16 | @ModuleInfo(key: "k_proj") var wk: Linear 17 | @ModuleInfo(key: "v_proj") var wv: Linear 18 | @ModuleInfo(key: "o_proj") var wo: Linear 19 | 20 | let rope: RoPE 21 | 22 | public init(_ args: Configuration) { 23 | self.args = args 24 | 25 | let dim = args.hiddenSize 26 | let heads = args.attentionHeads 27 | let kvHeads = args.kvHeads 28 | 29 | self.repeats = heads / kvHeads 30 | 31 | let headDim = args.hiddenSize / heads 32 | self.scale = pow(Float(headDim), -0.5) 33 | 34 | self._wq.wrappedValue = Linear(dim, heads * headDim, bias: false) 35 | self._wk.wrappedValue = Linear(dim, kvHeads * headDim, bias: false) 36 | self._wv.wrappedValue = Linear(dim, kvHeads * headDim, bias: false) 37 | self._wo.wrappedValue = Linear(heads * headDim, dim, bias: false) 38 | 39 | let ropeScale: Float 40 | if let ropeScaling = args.ropeScaling, ropeScaling["type"] == .string("linear"), 41 | let factor = ropeScaling["factor"] 42 | { 43 | switch factor { 44 | case .string: 45 | fatalError("ropeScaling.factor must be a float") 46 | case .float(let v): 47 | ropeScale = 1 / v 48 | } 49 | } else { 50 | ropeScale = 1 51 | } 52 | 53 | self.rope = RoPE( 54 | dimensions: headDim, traditional: args.ropeTraditional, base: args.ropeTheta, 55 | scale: ropeScale) 56 | } 57 | 58 | public func callAsFunction( 59 | _ x: MLXArray, mask: MLXArray? = nil, cache: (MLXArray, MLXArray)? = nil 60 | ) -> (MLXArray, (MLXArray, MLXArray)) { 61 | let (B, L) = (x.dim(0), x.dim(1)) 62 | 63 | var queries = wq(x) 64 | var keys = wk(x) 65 | var values = wv(x) 66 | 67 | // prepare the queries, keys and values for the attention computation 68 | queries = queries.reshaped(B, L, args.attentionHeads, -1).transposed(0, 2, 1, 3) 69 | keys = keys.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3) 70 | values = values.reshaped(B, L, args.kvHeads, -1).transposed(0, 2, 1, 3) 71 | 72 | func repeated(_ a: MLXArray) -> MLXArray { 73 | let expanded = expandedDimensions(a, axis: 2) 74 | return concatenated(Array(repeating: expanded, count: self.repeats), axis: 2) 75 | .reshaped(B, args.attentionHeads, L, -1) 76 | } 77 | 78 | if repeats > 1 { 79 | keys = repeated(keys) 80 | values = repeated(values) 81 | } 82 | 83 | if let (keyCache, valueCache) = cache { 84 | queries = rope(queries, offset: keyCache.dim(2)) 85 | keys = rope(keys, offset: keyCache.dim(2)) 86 | keys = concatenated([keyCache, keys], axis: 2) 87 | values = concatenated([valueCache, values], axis: 2) 88 | } else { 89 | queries = rope(queries) 90 | keys = rope(keys) 91 | } 92 | 93 | var scores = (queries * self.scale).matmul(keys.transposed(0, 1, 3, 2)) 94 | if let mask { 95 | scores = scores + mask 96 | } 97 | 98 | scores = softMax(scores.asType(.float32), axis: -1).asType(scores.dtype) 99 | 100 | let output = matmul(scores, values).transposed(0, 2, 1, 3).reshaped(B, L, -1) 101 | 102 | return (wo(output), (keys, values)) 103 | } 104 | } 105 | 106 | public class MLP: Module, UnaryLayer { 107 | 108 | @ModuleInfo(key: "gate_proj") var gate: Linear 109 | @ModuleInfo(key: "down_proj") var down: Linear 110 | @ModuleInfo(key: "up_proj") var up: Linear 111 | 112 | public init(dimensions: Int, hiddenDimensions: Int) { 113 | self._gate.wrappedValue = Linear(dimensions, hiddenDimensions, bias: false) 114 | self._down.wrappedValue = Linear(hiddenDimensions, dimensions, bias: false) 115 | self._up.wrappedValue = Linear(dimensions, hiddenDimensions, bias: false) 116 | } 117 | 118 | public func callAsFunction(_ x: MLXArray) -> MLXArray { 119 | down(silu(gate(x)) * up(x)) 120 | } 121 | } 122 | 123 | public class TransformerBlock: Module { 124 | 125 | @ModuleInfo(key: "self_attn") var attention: Attention 126 | let mlp: MLP 127 | 128 | @ModuleInfo(key: "input_layernorm") var inputLayerNorm: RMSNorm 129 | @ModuleInfo(key: "post_attention_layernorm") var postAttentionLayerNorm: RMSNorm 130 | 131 | public init(_ args: Configuration) { 132 | self._attention.wrappedValue = Attention(args) 133 | self.mlp = MLP(dimensions: args.hiddenSize, hiddenDimensions: args.intermediateSize) 134 | self._inputLayerNorm.wrappedValue = RMSNorm( 135 | dimensions: args.hiddenSize, eps: args.rmsNormEps) 136 | self._postAttentionLayerNorm.wrappedValue = RMSNorm( 137 | dimensions: args.hiddenSize, eps: args.rmsNormEps) 138 | } 139 | 140 | public func callAsFunction( 141 | _ x: MLXArray, mask: MLXArray? = nil, cache: (MLXArray, MLXArray)? = nil 142 | ) -> (MLXArray, (MLXArray, MLXArray)) { 143 | var (r, cache) = attention(inputLayerNorm(x), mask: mask, cache: cache) 144 | let h = x + r 145 | r = mlp(postAttentionLayerNorm(h)) 146 | let out = h + r 147 | return (out, cache) 148 | } 149 | } 150 | 151 | public class LlamaModel: Module { 152 | 153 | @ModuleInfo(key: "embed_tokens") var embedTokens: Embedding 154 | 155 | let layers: [TransformerBlock] 156 | let norm: RMSNorm 157 | 158 | public init(_ args: Configuration) { 159 | precondition(args.vocabularySize > 0) 160 | 161 | self._embedTokens.wrappedValue = Embedding( 162 | embeddingCount: args.vocabularySize, dimensions: args.hiddenSize) 163 | 164 | self.layers = (0 ..< args.hiddenLayers) 165 | .map { _ in 166 | TransformerBlock(args) 167 | } 168 | self.norm = RMSNorm(dimensions: args.hiddenSize, eps: args.rmsNormEps) 169 | } 170 | 171 | public func callAsFunction(_ inputs: MLXArray, cache: [(MLXArray, MLXArray)]? = nil) -> ( 172 | MLXArray, [(MLXArray, MLXArray)] 173 | ) { 174 | var h = embedTokens(inputs) 175 | 176 | var mask: MLXArray? = nil 177 | if h.dim(1) > 1 { 178 | mask = MultiHeadAttention.createAdditiveCausalMask(h.dim(1)) 179 | mask = mask?.asType(h.dtype) 180 | } 181 | 182 | var newCache = [(MLXArray, MLXArray)]() 183 | 184 | for (i, layer) in layers.enumerated() { 185 | var cacheUpdate: (MLXArray, MLXArray) 186 | (h, cacheUpdate) = layer(h, mask: mask, cache: cache?[i]) 187 | newCache.append(cacheUpdate) 188 | } 189 | 190 | return (norm(h), newCache) 191 | } 192 | } 193 | 194 | public class Model: Module { 195 | 196 | let model: LlamaModel 197 | 198 | @ModuleInfo(key: "lm_head") var lmHead: Linear 199 | 200 | public init(_ args: Configuration) { 201 | self.model = LlamaModel(args) 202 | self._lmHead.wrappedValue = Linear(args.hiddenSize, args.vocabularySize, bias: false) 203 | } 204 | 205 | public func callAsFunction(_ inputs: MLXArray, cache: [(MLXArray, MLXArray)]? = nil) -> ( 206 | MLXArray, [(MLXArray, MLXArray)] 207 | ) { 208 | let (out, cache) = model(inputs, cache: cache) 209 | return (lmHead(out), cache) 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /mlx-examples-swift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8B58CB2E2B8959600078CEA4 /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B58CB2D2B8959600078CEA4 /* HeaderView.swift */; }; 11 | 8B7060802B877CA500B3284E /* MessageRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B70607F2B877CA500B3284E /* MessageRowView.swift */; }; 12 | 8B7060822B877CC700B3284E /* MessageRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B7060812B877CC700B3284E /* MessageRow.swift */; }; 13 | 8B7060842B877D0E00B3284E /* DotLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B7060832B877D0E00B3284E /* DotLoadingView.swift */; }; 14 | 8B7060882B877D4100B3284E /* ParserResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B7060872B877D4100B3284E /* ParserResult.swift */; }; 15 | 8B7A6B2D2B88411100CB45D5 /* PreferencePane.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B7A6B2C2B88411100CB45D5 /* PreferencePane.swift */; }; 16 | 8BD9A1032B863E9C00BB7769 /* MLXChatApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A1022B863E9C00BB7769 /* MLXChatApp.swift */; }; 17 | 8BD9A1052B863E9C00BB7769 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A1042B863E9C00BB7769 /* ContentView.swift */; }; 18 | 8BD9A1072B863E9D00BB7769 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8BD9A1062B863E9D00BB7769 /* Assets.xcassets */; }; 19 | 8BD9A10A2B863E9D00BB7769 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8BD9A1092B863E9D00BB7769 /* Preview Assets.xcassets */; }; 20 | 8BD9A1282B8760FA00BB7769 /* MLXChatXPCService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A1272B8760FA00BB7769 /* MLXChatXPCService.swift */; }; 21 | 8BD9A12A2B8760FA00BB7769 /* MLXChatXPCServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A1292B8760FA00BB7769 /* MLXChatXPCServiceProtocol.swift */; }; 22 | 8BD9A12C2B8760FA00BB7769 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A12B2B8760FA00BB7769 /* main.swift */; }; 23 | 8BD9A1312B8760FA00BB7769 /* MLXChatXPCService.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 8BD9A1252B8760FA00BB7769 /* MLXChatXPCService.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 24 | 8BD9A1372B8761C700BB7769 /* AsyncAlgorithms in Frameworks */ = {isa = PBXBuildFile; productRef = 8BD9A1362B8761C700BB7769 /* AsyncAlgorithms */; }; 25 | 8BD9A1382B8761C700BB7769 /* Llama.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39273D52B607A9C00368D5D /* Llama.framework */; }; 26 | 8BD9A1392B8761C700BB7769 /* Llama.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C39273D52B607A9C00368D5D /* Llama.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 27 | 8BD9A13C2B8761C700BB7769 /* SentencePiece.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39273882B606AB800368D5D /* SentencePiece.framework */; }; 28 | 8BD9A13D2B8761C700BB7769 /* SentencePiece.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C39273882B606AB800368D5D /* SentencePiece.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 29 | 8BD9A1422B8764DF00BB7769 /* MLXChat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A1412B8764DF00BB7769 /* MLXChat.swift */; }; 30 | 8BD9A1442B87661600BB7769 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A1432B87661600BB7769 /* ViewModel.swift */; }; 31 | 8BD9A1452B87666D00BB7769 /* MLXChatXPCServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9A1292B8760FA00BB7769 /* MLXChatXPCServiceProtocol.swift */; }; 32 | C3288D762B6D9313009FF608 /* LinearModelTraining.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3288D752B6D9313009FF608 /* LinearModelTraining.swift */; }; 33 | C3288D7B2B6D9339009FF608 /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = C3288D7A2B6D9339009FF608 /* ArgumentParser */; }; 34 | C34E48F02B696E6500FCB841 /* Util.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34E48ED2B696E6500FCB841 /* Util.swift */; }; 35 | C34E48F12B696E6500FCB841 /* Llama.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34E48EE2B696E6500FCB841 /* Llama.swift */; }; 36 | C34E48F22B696E6500FCB841 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34E48EF2B696E6500FCB841 /* Configuration.swift */; }; 37 | C34E48F52B696F0B00FCB841 /* LLMTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34E48F42B696F0B00FCB841 /* LLMTool.swift */; }; 38 | C34E49102B69A92900FCB841 /* MNIST.h in Headers */ = {isa = PBXBuildFile; fileRef = C34E490F2B69A92900FCB841 /* MNIST.h */; settings = {ATTRIBUTES = (Public, ); }; }; 39 | C34E49152B69C1E300FCB841 /* Files.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34E49142B69C1E300FCB841 /* Files.swift */; }; 40 | C34E491C2B69C43600FCB841 /* Gzip in Frameworks */ = {isa = PBXBuildFile; productRef = C34E491B2B69C43600FCB841 /* Gzip */; }; 41 | C34E49242B6A026F00FCB841 /* MNISTTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = C34E49232B6A026F00FCB841 /* MNISTTool.swift */; }; 42 | C34E49292B6A028100FCB841 /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = C34E49282B6A028100FCB841 /* ArgumentParser */; }; 43 | C34E492A2B6A028800FCB841 /* MNIST.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34E490D2B69A92900FCB841 /* MNIST.framework */; }; 44 | C34E492B2B6A028800FCB841 /* MNIST.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C34E490D2B69A92900FCB841 /* MNIST.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 45 | C382DE8A2B630889000F8F03 /* AsyncAlgorithms in Frameworks */ = {isa = PBXBuildFile; productRef = C382DE892B630889000F8F03 /* AsyncAlgorithms */; }; 46 | C382DE8C2B64138D000F8F03 /* AsyncAlgorithms in Frameworks */ = {isa = PBXBuildFile; productRef = C382DE8B2B64138D000F8F03 /* AsyncAlgorithms */; }; 47 | C392737D2B606A1D00368D5D /* Tutorial.swift in Sources */ = {isa = PBXBuildFile; fileRef = C392737C2B606A1D00368D5D /* Tutorial.swift */; }; 48 | C39273912B606AD100368D5D /* SentencePieceImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = C39273902B606AD100368D5D /* SentencePieceImpl.mm */; }; 49 | C39273932B606B6000368D5D /* SentencePieceImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = C39273922B606B5D00368D5D /* SentencePieceImpl.h */; }; 50 | C39273962B606C6200368D5D /* SentencePiece.swift in Sources */ = {isa = PBXBuildFile; fileRef = C39273952B606C6200368D5D /* SentencePiece.swift */; }; 51 | C39273E22B607AAA00368D5D /* SentencePiece.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39273882B606AB800368D5D /* SentencePiece.framework */; }; 52 | C39273E32B607AAA00368D5D /* SentencePiece.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C39273882B606AB800368D5D /* SentencePiece.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 53 | C3932D572B6A060B00A81055 /* MNIST.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3932D562B6A060B00A81055 /* MNIST.swift */; }; 54 | C3932D592B6A0BE400A81055 /* Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3932D582B6A0BE400A81055 /* Random.swift */; }; 55 | C397C5922B62C6BD004B084D /* Llama.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39273D52B607A9C00368D5D /* Llama.framework */; }; 56 | C397C5932B62C6BD004B084D /* Llama.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C39273D52B607A9C00368D5D /* Llama.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 57 | C397C5962B62C6BD004B084D /* SentencePiece.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39273882B606AB800368D5D /* SentencePiece.framework */; }; 58 | C397C5972B62C6BD004B084D /* SentencePiece.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C39273882B606AB800368D5D /* SentencePiece.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 59 | C397C59C2B62C6D0004B084D /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = C397C59B2B62C6D0004B084D /* ArgumentParser */; }; 60 | C3FBCB212B8520B80007E490 /* MLX in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB202B8520B80007E490 /* MLX */; }; 61 | C3FBCB232B8520C80007E490 /* MLX in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB222B8520C80007E490 /* MLX */; }; 62 | C3FBCB252B8520C80007E490 /* MLXNN in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB242B8520C80007E490 /* MLXNN */; }; 63 | C3FBCB272B8520C80007E490 /* MLXRandom in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB262B8520C80007E490 /* MLXRandom */; }; 64 | C3FBCB292B8520DA0007E490 /* MLX in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB282B8520DA0007E490 /* MLX */; }; 65 | C3FBCB2B2B8520DA0007E490 /* MLXNN in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB2A2B8520DA0007E490 /* MLXNN */; }; 66 | C3FBCB2D2B8520E80007E490 /* MLXOptimizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB2C2B8520E80007E490 /* MLXOptimizers */; }; 67 | C3FBCB2F2B8520F20007E490 /* MLX in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB2E2B8520F20007E490 /* MLX */; }; 68 | C3FBCB312B8520F20007E490 /* MLXNN in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB302B8520F20007E490 /* MLXNN */; }; 69 | C3FBCB332B8520F20007E490 /* MLXOptimizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB322B8520F20007E490 /* MLXOptimizers */; }; 70 | C3FBCB352B8520F20007E490 /* MLXRandom in Frameworks */ = {isa = PBXBuildFile; productRef = C3FBCB342B8520F20007E490 /* MLXRandom */; }; 71 | /* End PBXBuildFile section */ 72 | 73 | /* Begin PBXContainerItemProxy section */ 74 | 8BD9A12F2B8760FA00BB7769 /* PBXContainerItemProxy */ = { 75 | isa = PBXContainerItemProxy; 76 | containerPortal = C39273682B60697700368D5D /* Project object */; 77 | proxyType = 1; 78 | remoteGlobalIDString = 8BD9A1242B8760FA00BB7769; 79 | remoteInfo = MLXChatXPCService; 80 | }; 81 | 8BD9A13A2B8761C700BB7769 /* PBXContainerItemProxy */ = { 82 | isa = PBXContainerItemProxy; 83 | containerPortal = C39273682B60697700368D5D /* Project object */; 84 | proxyType = 1; 85 | remoteGlobalIDString = C39273D42B607A9C00368D5D; 86 | remoteInfo = Llama; 87 | }; 88 | 8BD9A13E2B8761C700BB7769 /* PBXContainerItemProxy */ = { 89 | isa = PBXContainerItemProxy; 90 | containerPortal = C39273682B60697700368D5D /* Project object */; 91 | proxyType = 1; 92 | remoteGlobalIDString = C39273872B606AB800368D5D; 93 | remoteInfo = SentencePiece; 94 | }; 95 | C34E492C2B6A028800FCB841 /* PBXContainerItemProxy */ = { 96 | isa = PBXContainerItemProxy; 97 | containerPortal = C39273682B60697700368D5D /* Project object */; 98 | proxyType = 1; 99 | remoteGlobalIDString = C34E490C2B69A92900FCB841; 100 | remoteInfo = MNIST; 101 | }; 102 | C39273E42B607AAA00368D5D /* PBXContainerItemProxy */ = { 103 | isa = PBXContainerItemProxy; 104 | containerPortal = C39273682B60697700368D5D /* Project object */; 105 | proxyType = 1; 106 | remoteGlobalIDString = C39273872B606AB800368D5D; 107 | remoteInfo = SentencePiece; 108 | }; 109 | C397C5942B62C6BD004B084D /* PBXContainerItemProxy */ = { 110 | isa = PBXContainerItemProxy; 111 | containerPortal = C39273682B60697700368D5D /* Project object */; 112 | proxyType = 1; 113 | remoteGlobalIDString = C39273D42B607A9C00368D5D; 114 | remoteInfo = Mistral; 115 | }; 116 | C397C5982B62C6BD004B084D /* PBXContainerItemProxy */ = { 117 | isa = PBXContainerItemProxy; 118 | containerPortal = C39273682B60697700368D5D /* Project object */; 119 | proxyType = 1; 120 | remoteGlobalIDString = C39273872B606AB800368D5D; 121 | remoteInfo = SentencePiece; 122 | }; 123 | /* End PBXContainerItemProxy section */ 124 | 125 | /* Begin PBXCopyFilesBuildPhase section */ 126 | 8BD9A1352B8760FA00BB7769 /* Embed XPC Services */ = { 127 | isa = PBXCopyFilesBuildPhase; 128 | buildActionMask = 2147483647; 129 | dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; 130 | dstSubfolderSpec = 16; 131 | files = ( 132 | 8BD9A1312B8760FA00BB7769 /* MLXChatXPCService.xpc in Embed XPC Services */, 133 | ); 134 | name = "Embed XPC Services"; 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | 8BD9A1402B8761C700BB7769 /* Embed Frameworks */ = { 138 | isa = PBXCopyFilesBuildPhase; 139 | buildActionMask = 2147483647; 140 | dstPath = ""; 141 | dstSubfolderSpec = 10; 142 | files = ( 143 | 8BD9A13D2B8761C700BB7769 /* SentencePiece.framework in Embed Frameworks */, 144 | 8BD9A1392B8761C700BB7769 /* Llama.framework in Embed Frameworks */, 145 | ); 146 | name = "Embed Frameworks"; 147 | runOnlyForDeploymentPostprocessing = 0; 148 | }; 149 | C3288D712B6D9313009FF608 /* CopyFiles */ = { 150 | isa = PBXCopyFilesBuildPhase; 151 | buildActionMask = 2147483647; 152 | dstPath = /usr/share/man/man1/; 153 | dstSubfolderSpec = 0; 154 | files = ( 155 | ); 156 | runOnlyForDeploymentPostprocessing = 1; 157 | }; 158 | C34E491F2B6A026F00FCB841 /* CopyFiles */ = { 159 | isa = PBXCopyFilesBuildPhase; 160 | buildActionMask = 2147483647; 161 | dstPath = /usr/share/man/man1/; 162 | dstSubfolderSpec = 0; 163 | files = ( 164 | ); 165 | runOnlyForDeploymentPostprocessing = 1; 166 | }; 167 | C34E492E2B6A028800FCB841 /* Embed Frameworks */ = { 168 | isa = PBXCopyFilesBuildPhase; 169 | buildActionMask = 2147483647; 170 | dstPath = ""; 171 | dstSubfolderSpec = 10; 172 | files = ( 173 | C34E492B2B6A028800FCB841 /* MNIST.framework in Embed Frameworks */, 174 | ); 175 | name = "Embed Frameworks"; 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | C39273722B606A0A00368D5D /* CopyFiles */ = { 179 | isa = PBXCopyFilesBuildPhase; 180 | buildActionMask = 2147483647; 181 | dstPath = /usr/share/man/man1/; 182 | dstSubfolderSpec = 0; 183 | files = ( 184 | ); 185 | runOnlyForDeploymentPostprocessing = 1; 186 | }; 187 | C39273E62B607AAA00368D5D /* Embed Frameworks */ = { 188 | isa = PBXCopyFilesBuildPhase; 189 | buildActionMask = 2147483647; 190 | dstPath = ""; 191 | dstSubfolderSpec = 10; 192 | files = ( 193 | C39273E32B607AAA00368D5D /* SentencePiece.framework in Embed Frameworks */, 194 | ); 195 | name = "Embed Frameworks"; 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | C397C5892B62C6A9004B084D /* CopyFiles */ = { 199 | isa = PBXCopyFilesBuildPhase; 200 | buildActionMask = 2147483647; 201 | dstPath = /usr/share/man/man1/; 202 | dstSubfolderSpec = 0; 203 | files = ( 204 | ); 205 | runOnlyForDeploymentPostprocessing = 1; 206 | }; 207 | C397C59A2B62C6BD004B084D /* Embed Frameworks */ = { 208 | isa = PBXCopyFilesBuildPhase; 209 | buildActionMask = 2147483647; 210 | dstPath = ""; 211 | dstSubfolderSpec = 10; 212 | files = ( 213 | C397C5972B62C6BD004B084D /* SentencePiece.framework in Embed Frameworks */, 214 | C397C5932B62C6BD004B084D /* Llama.framework in Embed Frameworks */, 215 | ); 216 | name = "Embed Frameworks"; 217 | runOnlyForDeploymentPostprocessing = 0; 218 | }; 219 | /* End PBXCopyFilesBuildPhase section */ 220 | 221 | /* Begin PBXFileReference section */ 222 | 8B58CB2D2B8959600078CEA4 /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = ""; }; 223 | 8B70607F2B877CA500B3284E /* MessageRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageRowView.swift; sourceTree = ""; }; 224 | 8B7060812B877CC700B3284E /* MessageRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageRow.swift; sourceTree = ""; }; 225 | 8B7060832B877D0E00B3284E /* DotLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DotLoadingView.swift; sourceTree = ""; }; 226 | 8B7060872B877D4100B3284E /* ParserResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParserResult.swift; sourceTree = ""; }; 227 | 8B7A6B2C2B88411100CB45D5 /* PreferencePane.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencePane.swift; sourceTree = ""; }; 228 | 8BD9A1002B863E9C00BB7769 /* XCA MLX Chat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "XCA MLX Chat.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 229 | 8BD9A1022B863E9C00BB7769 /* MLXChatApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MLXChatApp.swift; sourceTree = ""; }; 230 | 8BD9A1042B863E9C00BB7769 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 231 | 8BD9A1062B863E9D00BB7769 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 232 | 8BD9A1092B863E9D00BB7769 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 233 | 8BD9A10B2B863E9D00BB7769 /* MLXChat.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MLXChat.entitlements; sourceTree = ""; }; 234 | 8BD9A10F2B863EAD00BB7769 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 235 | 8BD9A1252B8760FA00BB7769 /* MLXChatXPCService.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = MLXChatXPCService.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; 236 | 8BD9A1272B8760FA00BB7769 /* MLXChatXPCService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MLXChatXPCService.swift; sourceTree = ""; }; 237 | 8BD9A1292B8760FA00BB7769 /* MLXChatXPCServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MLXChatXPCServiceProtocol.swift; sourceTree = ""; }; 238 | 8BD9A12B2B8760FA00BB7769 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 239 | 8BD9A12D2B8760FA00BB7769 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 240 | 8BD9A12E2B8760FA00BB7769 /* MLXChatXPCService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MLXChatXPCService.entitlements; sourceTree = ""; }; 241 | 8BD9A1412B8764DF00BB7769 /* MLXChat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MLXChat.swift; sourceTree = ""; }; 242 | 8BD9A1432B87661600BB7769 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = ""; }; 243 | C325DE3F2B648CDB00628871 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 244 | C3288D732B6D9313009FF608 /* LinearModelTraining */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = LinearModelTraining; sourceTree = BUILT_PRODUCTS_DIR; }; 245 | C3288D752B6D9313009FF608 /* LinearModelTraining.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinearModelTraining.swift; sourceTree = ""; }; 246 | C3288D842B6D94BD009FF608 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 247 | C34E48ED2B696E6500FCB841 /* Util.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Util.swift; sourceTree = ""; }; 248 | C34E48EE2B696E6500FCB841 /* Llama.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Llama.swift; sourceTree = ""; }; 249 | C34E48EF2B696E6500FCB841 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; 250 | C34E48F42B696F0B00FCB841 /* LLMTool.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LLMTool.swift; sourceTree = ""; }; 251 | C34E48F62B69832600FCB841 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 252 | C34E48F92B69930300FCB841 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 253 | C34E490D2B69A92900FCB841 /* MNIST.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MNIST.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 254 | C34E490F2B69A92900FCB841 /* MNIST.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MNIST.h; sourceTree = ""; }; 255 | C34E49142B69C1E300FCB841 /* Files.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Files.swift; sourceTree = ""; }; 256 | C34E49212B6A026F00FCB841 /* mnist-tool */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "mnist-tool"; sourceTree = BUILT_PRODUCTS_DIR; }; 257 | C34E49232B6A026F00FCB841 /* MNISTTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNISTTool.swift; sourceTree = ""; }; 258 | C39273742B606A0A00368D5D /* Tutorial */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Tutorial; sourceTree = BUILT_PRODUCTS_DIR; }; 259 | C392737C2B606A1D00368D5D /* Tutorial.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tutorial.swift; sourceTree = ""; }; 260 | C39273882B606AB800368D5D /* SentencePiece.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SentencePiece.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 261 | C39273902B606AD100368D5D /* SentencePieceImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SentencePieceImpl.mm; sourceTree = ""; }; 262 | C39273922B606B5D00368D5D /* SentencePieceImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentencePieceImpl.h; sourceTree = ""; }; 263 | C39273942B606BB800368D5D /* SentencePiece.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SentencePiece.xcconfig; sourceTree = ""; }; 264 | C39273952B606C6200368D5D /* SentencePiece.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentencePiece.swift; sourceTree = ""; }; 265 | C39273992B606D9B00368D5D /* SentencePiece-Bridging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentencePiece-Bridging.h"; sourceTree = ""; }; 266 | C392739C2B606F8400368D5D /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 267 | C39273D52B607A9C00368D5D /* Llama.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Llama.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 268 | C3932D562B6A060B00A81055 /* MNIST.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNIST.swift; sourceTree = ""; }; 269 | C3932D582B6A0BE400A81055 /* Random.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Random.swift; sourceTree = ""; }; 270 | C397C58B2B62C6A9004B084D /* llm-tool */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "llm-tool"; sourceTree = BUILT_PRODUCTS_DIR; }; 271 | C3C3240B2B6CA689007D2D9A /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 272 | C3C3240C2B6CA792007D2D9A /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 273 | /* End PBXFileReference section */ 274 | 275 | /* Begin PBXFrameworksBuildPhase section */ 276 | 8BD9A0FD2B863E9C00BB7769 /* Frameworks */ = { 277 | isa = PBXFrameworksBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 8BD9A1222B8760FA00BB7769 /* Frameworks */ = { 284 | isa = PBXFrameworksBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 8BD9A13C2B8761C700BB7769 /* SentencePiece.framework in Frameworks */, 288 | 8BD9A1382B8761C700BB7769 /* Llama.framework in Frameworks */, 289 | 8BD9A1372B8761C700BB7769 /* AsyncAlgorithms in Frameworks */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | C3288D702B6D9313009FF608 /* Frameworks */ = { 294 | isa = PBXFrameworksBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | C3FBCB332B8520F20007E490 /* MLXOptimizers in Frameworks */, 298 | C3FBCB312B8520F20007E490 /* MLXNN in Frameworks */, 299 | C3FBCB2F2B8520F20007E490 /* MLX in Frameworks */, 300 | C3FBCB352B8520F20007E490 /* MLXRandom in Frameworks */, 301 | C3288D7B2B6D9339009FF608 /* ArgumentParser in Frameworks */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | C34E490A2B69A92900FCB841 /* Frameworks */ = { 306 | isa = PBXFrameworksBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | C3FBCB2B2B8520DA0007E490 /* MLXNN in Frameworks */, 310 | C3FBCB292B8520DA0007E490 /* MLX in Frameworks */, 311 | C34E491C2B69C43600FCB841 /* Gzip in Frameworks */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | C34E491E2B6A026F00FCB841 /* Frameworks */ = { 316 | isa = PBXFrameworksBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | C3FBCB2D2B8520E80007E490 /* MLXOptimizers in Frameworks */, 320 | C34E492A2B6A028800FCB841 /* MNIST.framework in Frameworks */, 321 | C34E49292B6A028100FCB841 /* ArgumentParser in Frameworks */, 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | }; 325 | C39273712B606A0A00368D5D /* Frameworks */ = { 326 | isa = PBXFrameworksBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | C3FBCB212B8520B80007E490 /* MLX in Frameworks */, 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | C39273852B606AB800368D5D /* Frameworks */ = { 334 | isa = PBXFrameworksBuildPhase; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | ); 338 | runOnlyForDeploymentPostprocessing = 0; 339 | }; 340 | C39273D22B607A9C00368D5D /* Frameworks */ = { 341 | isa = PBXFrameworksBuildPhase; 342 | buildActionMask = 2147483647; 343 | files = ( 344 | C3FBCB232B8520C80007E490 /* MLX in Frameworks */, 345 | C39273E22B607AAA00368D5D /* SentencePiece.framework in Frameworks */, 346 | C3FBCB252B8520C80007E490 /* MLXNN in Frameworks */, 347 | C3FBCB272B8520C80007E490 /* MLXRandom in Frameworks */, 348 | C382DE8C2B64138D000F8F03 /* AsyncAlgorithms in Frameworks */, 349 | ); 350 | runOnlyForDeploymentPostprocessing = 0; 351 | }; 352 | C397C5882B62C6A9004B084D /* Frameworks */ = { 353 | isa = PBXFrameworksBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | C397C59C2B62C6D0004B084D /* ArgumentParser in Frameworks */, 357 | C397C5962B62C6BD004B084D /* SentencePiece.framework in Frameworks */, 358 | C397C5922B62C6BD004B084D /* Llama.framework in Frameworks */, 359 | C382DE8A2B630889000F8F03 /* AsyncAlgorithms in Frameworks */, 360 | ); 361 | runOnlyForDeploymentPostprocessing = 0; 362 | }; 363 | /* End PBXFrameworksBuildPhase section */ 364 | 365 | /* Begin PBXGroup section */ 366 | 8B7A6B2A2B87A1AB00CB45D5 /* Views */ = { 367 | isa = PBXGroup; 368 | children = ( 369 | 8BD9A1042B863E9C00BB7769 /* ContentView.swift */, 370 | 8B7A6B2C2B88411100CB45D5 /* PreferencePane.swift */, 371 | 8B70607F2B877CA500B3284E /* MessageRowView.swift */, 372 | 8B7060832B877D0E00B3284E /* DotLoadingView.swift */, 373 | 8B58CB2D2B8959600078CEA4 /* HeaderView.swift */, 374 | ); 375 | path = Views; 376 | sourceTree = ""; 377 | }; 378 | 8B7A6B2B2B87A1BC00CB45D5 /* Models */ = { 379 | isa = PBXGroup; 380 | children = ( 381 | 8B7060812B877CC700B3284E /* MessageRow.swift */, 382 | 8B7060872B877D4100B3284E /* ParserResult.swift */, 383 | ); 384 | path = Models; 385 | sourceTree = ""; 386 | }; 387 | 8BD9A1012B863E9C00BB7769 /* MLXChat */ = { 388 | isa = PBXGroup; 389 | children = ( 390 | 8BD9A10F2B863EAD00BB7769 /* Info.plist */, 391 | 8BD9A1022B863E9C00BB7769 /* MLXChatApp.swift */, 392 | 8BD9A1432B87661600BB7769 /* ViewModel.swift */, 393 | 8B7A6B2B2B87A1BC00CB45D5 /* Models */, 394 | 8B7A6B2A2B87A1AB00CB45D5 /* Views */, 395 | 8BD9A1062B863E9D00BB7769 /* Assets.xcassets */, 396 | 8BD9A10B2B863E9D00BB7769 /* MLXChat.entitlements */, 397 | 8BD9A1082B863E9D00BB7769 /* Preview Content */, 398 | ); 399 | path = MLXChat; 400 | sourceTree = ""; 401 | }; 402 | 8BD9A1082B863E9D00BB7769 /* Preview Content */ = { 403 | isa = PBXGroup; 404 | children = ( 405 | 8BD9A1092B863E9D00BB7769 /* Preview Assets.xcassets */, 406 | ); 407 | path = "Preview Content"; 408 | sourceTree = ""; 409 | }; 410 | 8BD9A1262B8760FA00BB7769 /* MLXChatXPCService */ = { 411 | isa = PBXGroup; 412 | children = ( 413 | 8BD9A1272B8760FA00BB7769 /* MLXChatXPCService.swift */, 414 | 8BD9A1292B8760FA00BB7769 /* MLXChatXPCServiceProtocol.swift */, 415 | 8BD9A1412B8764DF00BB7769 /* MLXChat.swift */, 416 | 8BD9A12B2B8760FA00BB7769 /* main.swift */, 417 | 8BD9A12D2B8760FA00BB7769 /* Info.plist */, 418 | 8BD9A12E2B8760FA00BB7769 /* MLXChatXPCService.entitlements */, 419 | ); 420 | path = MLXChatXPCService; 421 | sourceTree = ""; 422 | }; 423 | C3288D742B6D9313009FF608 /* LinearModelTraining */ = { 424 | isa = PBXGroup; 425 | children = ( 426 | C3288D752B6D9313009FF608 /* LinearModelTraining.swift */, 427 | C3288D842B6D94BD009FF608 /* README.md */, 428 | ); 429 | path = LinearModelTraining; 430 | sourceTree = ""; 431 | }; 432 | C34E48EC2B696E6500FCB841 /* Llama */ = { 433 | isa = PBXGroup; 434 | children = ( 435 | C34E48ED2B696E6500FCB841 /* Util.swift */, 436 | C34E48EE2B696E6500FCB841 /* Llama.swift */, 437 | C34E48EF2B696E6500FCB841 /* Configuration.swift */, 438 | C34E48F62B69832600FCB841 /* README.md */, 439 | ); 440 | path = Llama; 441 | sourceTree = ""; 442 | }; 443 | C34E48F32B696F0B00FCB841 /* llm-tool */ = { 444 | isa = PBXGroup; 445 | children = ( 446 | C34E48F42B696F0B00FCB841 /* LLMTool.swift */, 447 | C34E48F92B69930300FCB841 /* README.md */, 448 | ); 449 | path = "llm-tool"; 450 | sourceTree = ""; 451 | }; 452 | C34E490E2B69A92900FCB841 /* MNIST */ = { 453 | isa = PBXGroup; 454 | children = ( 455 | C34E490F2B69A92900FCB841 /* MNIST.h */, 456 | C34E49142B69C1E300FCB841 /* Files.swift */, 457 | C3932D562B6A060B00A81055 /* MNIST.swift */, 458 | C3932D582B6A0BE400A81055 /* Random.swift */, 459 | C3C3240C2B6CA792007D2D9A /* README.md */, 460 | ); 461 | path = MNIST; 462 | sourceTree = ""; 463 | }; 464 | C34E49222B6A026F00FCB841 /* mnist-tool */ = { 465 | isa = PBXGroup; 466 | children = ( 467 | C34E49232B6A026F00FCB841 /* MNISTTool.swift */, 468 | C3C3240B2B6CA689007D2D9A /* README.md */, 469 | ); 470 | path = "mnist-tool"; 471 | sourceTree = ""; 472 | }; 473 | C39273672B60697700368D5D = { 474 | isa = PBXGroup; 475 | children = ( 476 | C325DE3F2B648CDB00628871 /* README.md */, 477 | C39273822B606A9200368D5D /* Libraries */, 478 | C39273812B606A7400368D5D /* Tools */, 479 | 8BD9A1012B863E9C00BB7769 /* MLXChat */, 480 | 8BD9A1262B8760FA00BB7769 /* MLXChatXPCService */, 481 | C39273752B606A0A00368D5D /* Products */, 482 | C392737E2B606A2C00368D5D /* Frameworks */, 483 | ); 484 | sourceTree = ""; 485 | }; 486 | C39273752B606A0A00368D5D /* Products */ = { 487 | isa = PBXGroup; 488 | children = ( 489 | C39273742B606A0A00368D5D /* Tutorial */, 490 | C39273882B606AB800368D5D /* SentencePiece.framework */, 491 | C39273D52B607A9C00368D5D /* Llama.framework */, 492 | C397C58B2B62C6A9004B084D /* llm-tool */, 493 | C34E490D2B69A92900FCB841 /* MNIST.framework */, 494 | C34E49212B6A026F00FCB841 /* mnist-tool */, 495 | C3288D732B6D9313009FF608 /* LinearModelTraining */, 496 | 8BD9A1002B863E9C00BB7769 /* XCA MLX Chat.app */, 497 | 8BD9A1252B8760FA00BB7769 /* MLXChatXPCService.xpc */, 498 | ); 499 | name = Products; 500 | sourceTree = ""; 501 | }; 502 | C39273762B606A0A00368D5D /* Tutorial */ = { 503 | isa = PBXGroup; 504 | children = ( 505 | C392737C2B606A1D00368D5D /* Tutorial.swift */, 506 | ); 507 | path = Tutorial; 508 | sourceTree = ""; 509 | }; 510 | C392737E2B606A2C00368D5D /* Frameworks */ = { 511 | isa = PBXGroup; 512 | children = ( 513 | ); 514 | name = Frameworks; 515 | sourceTree = ""; 516 | }; 517 | C39273812B606A7400368D5D /* Tools */ = { 518 | isa = PBXGroup; 519 | children = ( 520 | C3288D742B6D9313009FF608 /* LinearModelTraining */, 521 | C34E49222B6A026F00FCB841 /* mnist-tool */, 522 | C34E48F32B696F0B00FCB841 /* llm-tool */, 523 | C39273762B606A0A00368D5D /* Tutorial */, 524 | ); 525 | path = Tools; 526 | sourceTree = ""; 527 | }; 528 | C39273822B606A9200368D5D /* Libraries */ = { 529 | isa = PBXGroup; 530 | children = ( 531 | C34E490E2B69A92900FCB841 /* MNIST */, 532 | C34E48EC2B696E6500FCB841 /* Llama */, 533 | C392738F2B606AD100368D5D /* SentencePiece */, 534 | ); 535 | path = Libraries; 536 | sourceTree = ""; 537 | }; 538 | C392738F2B606AD100368D5D /* SentencePiece */ = { 539 | isa = PBXGroup; 540 | children = ( 541 | C39273902B606AD100368D5D /* SentencePieceImpl.mm */, 542 | C39273922B606B5D00368D5D /* SentencePieceImpl.h */, 543 | C39273942B606BB800368D5D /* SentencePiece.xcconfig */, 544 | C39273952B606C6200368D5D /* SentencePiece.swift */, 545 | C39273992B606D9B00368D5D /* SentencePiece-Bridging.h */, 546 | C392739C2B606F8400368D5D /* README.md */, 547 | ); 548 | path = SentencePiece; 549 | sourceTree = ""; 550 | }; 551 | /* End PBXGroup section */ 552 | 553 | /* Begin PBXHeadersBuildPhase section */ 554 | C34E49082B69A92900FCB841 /* Headers */ = { 555 | isa = PBXHeadersBuildPhase; 556 | buildActionMask = 2147483647; 557 | files = ( 558 | C34E49102B69A92900FCB841 /* MNIST.h in Headers */, 559 | ); 560 | runOnlyForDeploymentPostprocessing = 0; 561 | }; 562 | C39273832B606AB800368D5D /* Headers */ = { 563 | isa = PBXHeadersBuildPhase; 564 | buildActionMask = 2147483647; 565 | files = ( 566 | C39273932B606B6000368D5D /* SentencePieceImpl.h in Headers */, 567 | ); 568 | runOnlyForDeploymentPostprocessing = 0; 569 | }; 570 | C39273D02B607A9C00368D5D /* Headers */ = { 571 | isa = PBXHeadersBuildPhase; 572 | buildActionMask = 2147483647; 573 | files = ( 574 | ); 575 | runOnlyForDeploymentPostprocessing = 0; 576 | }; 577 | /* End PBXHeadersBuildPhase section */ 578 | 579 | /* Begin PBXNativeTarget section */ 580 | 8BD9A0FF2B863E9C00BB7769 /* MLXChat */ = { 581 | isa = PBXNativeTarget; 582 | buildConfigurationList = 8BD9A10E2B863E9D00BB7769 /* Build configuration list for PBXNativeTarget "MLXChat" */; 583 | buildPhases = ( 584 | 8BD9A0FC2B863E9C00BB7769 /* Sources */, 585 | 8BD9A0FD2B863E9C00BB7769 /* Frameworks */, 586 | 8BD9A0FE2B863E9C00BB7769 /* Resources */, 587 | 8BD9A1352B8760FA00BB7769 /* Embed XPC Services */, 588 | ); 589 | buildRules = ( 590 | ); 591 | dependencies = ( 592 | 8BD9A1302B8760FA00BB7769 /* PBXTargetDependency */, 593 | ); 594 | name = MLXChat; 595 | packageProductDependencies = ( 596 | ); 597 | productName = MLXChat; 598 | productReference = 8BD9A1002B863E9C00BB7769 /* XCA MLX Chat.app */; 599 | productType = "com.apple.product-type.application"; 600 | }; 601 | 8BD9A1242B8760FA00BB7769 /* MLXChatXPCService */ = { 602 | isa = PBXNativeTarget; 603 | buildConfigurationList = 8BD9A1322B8760FA00BB7769 /* Build configuration list for PBXNativeTarget "MLXChatXPCService" */; 604 | buildPhases = ( 605 | 8BD9A1212B8760FA00BB7769 /* Sources */, 606 | 8BD9A1222B8760FA00BB7769 /* Frameworks */, 607 | 8BD9A1232B8760FA00BB7769 /* Resources */, 608 | 8BD9A1402B8761C700BB7769 /* Embed Frameworks */, 609 | ); 610 | buildRules = ( 611 | ); 612 | dependencies = ( 613 | 8BD9A13B2B8761C700BB7769 /* PBXTargetDependency */, 614 | 8BD9A13F2B8761C700BB7769 /* PBXTargetDependency */, 615 | ); 616 | name = MLXChatXPCService; 617 | packageProductDependencies = ( 618 | 8BD9A1362B8761C700BB7769 /* AsyncAlgorithms */, 619 | ); 620 | productName = MLXChatXPCService; 621 | productReference = 8BD9A1252B8760FA00BB7769 /* MLXChatXPCService.xpc */; 622 | productType = "com.apple.product-type.xpc-service"; 623 | }; 624 | C3288D722B6D9313009FF608 /* LinearModelTraining */ = { 625 | isa = PBXNativeTarget; 626 | buildConfigurationList = C3288D792B6D9313009FF608 /* Build configuration list for PBXNativeTarget "LinearModelTraining" */; 627 | buildPhases = ( 628 | C3288D6F2B6D9313009FF608 /* Sources */, 629 | C3288D702B6D9313009FF608 /* Frameworks */, 630 | C3288D712B6D9313009FF608 /* CopyFiles */, 631 | ); 632 | buildRules = ( 633 | ); 634 | dependencies = ( 635 | ); 636 | name = LinearModelTraining; 637 | packageProductDependencies = ( 638 | C3288D7A2B6D9339009FF608 /* ArgumentParser */, 639 | C3FBCB2E2B8520F20007E490 /* MLX */, 640 | C3FBCB302B8520F20007E490 /* MLXNN */, 641 | C3FBCB322B8520F20007E490 /* MLXOptimizers */, 642 | C3FBCB342B8520F20007E490 /* MLXRandom */, 643 | ); 644 | productName = LinearFunctionModelTraining; 645 | productReference = C3288D732B6D9313009FF608 /* LinearModelTraining */; 646 | productType = "com.apple.product-type.tool"; 647 | }; 648 | C34E490C2B69A92900FCB841 /* MNIST */ = { 649 | isa = PBXNativeTarget; 650 | buildConfigurationList = C34E49112B69A92900FCB841 /* Build configuration list for PBXNativeTarget "MNIST" */; 651 | buildPhases = ( 652 | C34E49082B69A92900FCB841 /* Headers */, 653 | C34E49092B69A92900FCB841 /* Sources */, 654 | C34E490A2B69A92900FCB841 /* Frameworks */, 655 | C34E490B2B69A92900FCB841 /* Resources */, 656 | ); 657 | buildRules = ( 658 | ); 659 | dependencies = ( 660 | ); 661 | name = MNIST; 662 | packageProductDependencies = ( 663 | C34E491B2B69C43600FCB841 /* Gzip */, 664 | C3FBCB282B8520DA0007E490 /* MLX */, 665 | C3FBCB2A2B8520DA0007E490 /* MLXNN */, 666 | ); 667 | productName = MNIST; 668 | productReference = C34E490D2B69A92900FCB841 /* MNIST.framework */; 669 | productType = "com.apple.product-type.framework"; 670 | }; 671 | C34E49202B6A026F00FCB841 /* mnist-tool */ = { 672 | isa = PBXNativeTarget; 673 | buildConfigurationList = C34E49252B6A026F00FCB841 /* Build configuration list for PBXNativeTarget "mnist-tool" */; 674 | buildPhases = ( 675 | C34E491D2B6A026F00FCB841 /* Sources */, 676 | C34E491E2B6A026F00FCB841 /* Frameworks */, 677 | C34E491F2B6A026F00FCB841 /* CopyFiles */, 678 | C34E492E2B6A028800FCB841 /* Embed Frameworks */, 679 | ); 680 | buildRules = ( 681 | ); 682 | dependencies = ( 683 | C34E492D2B6A028800FCB841 /* PBXTargetDependency */, 684 | ); 685 | name = "mnist-tool"; 686 | packageProductDependencies = ( 687 | C34E49282B6A028100FCB841 /* ArgumentParser */, 688 | C3FBCB2C2B8520E80007E490 /* MLXOptimizers */, 689 | ); 690 | productName = "mnist-tool"; 691 | productReference = C34E49212B6A026F00FCB841 /* mnist-tool */; 692 | productType = "com.apple.product-type.tool"; 693 | }; 694 | C39273732B606A0A00368D5D /* Tutorial */ = { 695 | isa = PBXNativeTarget; 696 | buildConfigurationList = C39273792B606A0A00368D5D /* Build configuration list for PBXNativeTarget "Tutorial" */; 697 | buildPhases = ( 698 | C39273702B606A0A00368D5D /* Sources */, 699 | C39273712B606A0A00368D5D /* Frameworks */, 700 | C39273722B606A0A00368D5D /* CopyFiles */, 701 | ); 702 | buildRules = ( 703 | ); 704 | dependencies = ( 705 | ); 706 | name = Tutorial; 707 | packageProductDependencies = ( 708 | C3FBCB202B8520B80007E490 /* MLX */, 709 | ); 710 | productName = Tutorial; 711 | productReference = C39273742B606A0A00368D5D /* Tutorial */; 712 | productType = "com.apple.product-type.tool"; 713 | }; 714 | C39273872B606AB800368D5D /* SentencePiece */ = { 715 | isa = PBXNativeTarget; 716 | buildConfigurationList = C392738C2B606AB800368D5D /* Build configuration list for PBXNativeTarget "SentencePiece" */; 717 | buildPhases = ( 718 | C39273832B606AB800368D5D /* Headers */, 719 | C39273842B606AB800368D5D /* Sources */, 720 | C39273852B606AB800368D5D /* Frameworks */, 721 | C39273862B606AB800368D5D /* Resources */, 722 | ); 723 | buildRules = ( 724 | ); 725 | dependencies = ( 726 | ); 727 | name = SentencePiece; 728 | productName = SentencePiece; 729 | productReference = C39273882B606AB800368D5D /* SentencePiece.framework */; 730 | productType = "com.apple.product-type.framework"; 731 | }; 732 | C39273D42B607A9C00368D5D /* Llama */ = { 733 | isa = PBXNativeTarget; 734 | buildConfigurationList = C39273D92B607A9C00368D5D /* Build configuration list for PBXNativeTarget "Llama" */; 735 | buildPhases = ( 736 | C39273D02B607A9C00368D5D /* Headers */, 737 | C39273D12B607A9C00368D5D /* Sources */, 738 | C39273D22B607A9C00368D5D /* Frameworks */, 739 | C39273D32B607A9C00368D5D /* Resources */, 740 | C39273E62B607AAA00368D5D /* Embed Frameworks */, 741 | ); 742 | buildRules = ( 743 | ); 744 | dependencies = ( 745 | C39273E52B607AAA00368D5D /* PBXTargetDependency */, 746 | ); 747 | name = Llama; 748 | packageProductDependencies = ( 749 | C382DE8B2B64138D000F8F03 /* AsyncAlgorithms */, 750 | C3FBCB222B8520C80007E490 /* MLX */, 751 | C3FBCB242B8520C80007E490 /* MLXNN */, 752 | C3FBCB262B8520C80007E490 /* MLXRandom */, 753 | ); 754 | productName = Mistral; 755 | productReference = C39273D52B607A9C00368D5D /* Llama.framework */; 756 | productType = "com.apple.product-type.framework"; 757 | }; 758 | C397C58A2B62C6A9004B084D /* llm-tool */ = { 759 | isa = PBXNativeTarget; 760 | buildConfigurationList = C397C58F2B62C6A9004B084D /* Build configuration list for PBXNativeTarget "llm-tool" */; 761 | buildPhases = ( 762 | C397C5872B62C6A9004B084D /* Sources */, 763 | C397C5882B62C6A9004B084D /* Frameworks */, 764 | C397C5892B62C6A9004B084D /* CopyFiles */, 765 | C397C59A2B62C6BD004B084D /* Embed Frameworks */, 766 | ); 767 | buildRules = ( 768 | ); 769 | dependencies = ( 770 | C397C5952B62C6BD004B084D /* PBXTargetDependency */, 771 | C397C5992B62C6BD004B084D /* PBXTargetDependency */, 772 | ); 773 | name = "llm-tool"; 774 | packageProductDependencies = ( 775 | C397C59B2B62C6D0004B084D /* ArgumentParser */, 776 | C382DE892B630889000F8F03 /* AsyncAlgorithms */, 777 | ); 778 | productName = "mistral-tool"; 779 | productReference = C397C58B2B62C6A9004B084D /* llm-tool */; 780 | productType = "com.apple.product-type.tool"; 781 | }; 782 | /* End PBXNativeTarget section */ 783 | 784 | /* Begin PBXProject section */ 785 | C39273682B60697700368D5D /* Project object */ = { 786 | isa = PBXProject; 787 | attributes = { 788 | BuildIndependentTargetsInParallel = 1; 789 | LastSwiftUpdateCheck = 1520; 790 | LastUpgradeCheck = 1500; 791 | TargetAttributes = { 792 | 8BD9A0FF2B863E9C00BB7769 = { 793 | CreatedOnToolsVersion = 15.2; 794 | }; 795 | 8BD9A1242B8760FA00BB7769 = { 796 | CreatedOnToolsVersion = 15.2; 797 | }; 798 | C3288D722B6D9313009FF608 = { 799 | CreatedOnToolsVersion = 15.0.1; 800 | }; 801 | C34E490C2B69A92900FCB841 = { 802 | CreatedOnToolsVersion = 15.0.1; 803 | LastSwiftMigration = 1500; 804 | }; 805 | C34E49202B6A026F00FCB841 = { 806 | CreatedOnToolsVersion = 15.0.1; 807 | }; 808 | C39273732B606A0A00368D5D = { 809 | CreatedOnToolsVersion = 15.0.1; 810 | }; 811 | C39273872B606AB800368D5D = { 812 | CreatedOnToolsVersion = 15.0.1; 813 | LastSwiftMigration = 1500; 814 | }; 815 | C39273D42B607A9C00368D5D = { 816 | CreatedOnToolsVersion = 15.0.1; 817 | LastSwiftMigration = 1500; 818 | }; 819 | C397C58A2B62C6A9004B084D = { 820 | CreatedOnToolsVersion = 15.0.1; 821 | }; 822 | }; 823 | }; 824 | buildConfigurationList = C392736B2B60697700368D5D /* Build configuration list for PBXProject "mlx-examples-swift" */; 825 | compatibilityVersion = "Xcode 14.0"; 826 | developmentRegion = en; 827 | hasScannedForEncodings = 0; 828 | knownRegions = ( 829 | en, 830 | Base, 831 | ); 832 | mainGroup = C39273672B60697700368D5D; 833 | packageReferences = ( 834 | C392736E2B60699100368D5D /* XCRemoteSwiftPackageReference "swift-argument-parser" */, 835 | C382DE882B630889000F8F03 /* XCRemoteSwiftPackageReference "swift-async-algorithms" */, 836 | C34E491A2B69C43600FCB841 /* XCRemoteSwiftPackageReference "GzipSwift" */, 837 | C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */, 838 | ); 839 | productRefGroup = C39273752B606A0A00368D5D /* Products */; 840 | projectDirPath = ""; 841 | projectRoot = ""; 842 | targets = ( 843 | C39273732B606A0A00368D5D /* Tutorial */, 844 | C39273872B606AB800368D5D /* SentencePiece */, 845 | C39273D42B607A9C00368D5D /* Llama */, 846 | C397C58A2B62C6A9004B084D /* llm-tool */, 847 | C34E490C2B69A92900FCB841 /* MNIST */, 848 | C34E49202B6A026F00FCB841 /* mnist-tool */, 849 | C3288D722B6D9313009FF608 /* LinearModelTraining */, 850 | 8BD9A0FF2B863E9C00BB7769 /* MLXChat */, 851 | 8BD9A1242B8760FA00BB7769 /* MLXChatXPCService */, 852 | ); 853 | }; 854 | /* End PBXProject section */ 855 | 856 | /* Begin PBXResourcesBuildPhase section */ 857 | 8BD9A0FE2B863E9C00BB7769 /* Resources */ = { 858 | isa = PBXResourcesBuildPhase; 859 | buildActionMask = 2147483647; 860 | files = ( 861 | 8BD9A10A2B863E9D00BB7769 /* Preview Assets.xcassets in Resources */, 862 | 8BD9A1072B863E9D00BB7769 /* Assets.xcassets in Resources */, 863 | ); 864 | runOnlyForDeploymentPostprocessing = 0; 865 | }; 866 | 8BD9A1232B8760FA00BB7769 /* Resources */ = { 867 | isa = PBXResourcesBuildPhase; 868 | buildActionMask = 2147483647; 869 | files = ( 870 | ); 871 | runOnlyForDeploymentPostprocessing = 0; 872 | }; 873 | C34E490B2B69A92900FCB841 /* Resources */ = { 874 | isa = PBXResourcesBuildPhase; 875 | buildActionMask = 2147483647; 876 | files = ( 877 | ); 878 | runOnlyForDeploymentPostprocessing = 0; 879 | }; 880 | C39273862B606AB800368D5D /* Resources */ = { 881 | isa = PBXResourcesBuildPhase; 882 | buildActionMask = 2147483647; 883 | files = ( 884 | ); 885 | runOnlyForDeploymentPostprocessing = 0; 886 | }; 887 | C39273D32B607A9C00368D5D /* Resources */ = { 888 | isa = PBXResourcesBuildPhase; 889 | buildActionMask = 2147483647; 890 | files = ( 891 | ); 892 | runOnlyForDeploymentPostprocessing = 0; 893 | }; 894 | /* End PBXResourcesBuildPhase section */ 895 | 896 | /* Begin PBXSourcesBuildPhase section */ 897 | 8BD9A0FC2B863E9C00BB7769 /* Sources */ = { 898 | isa = PBXSourcesBuildPhase; 899 | buildActionMask = 2147483647; 900 | files = ( 901 | 8BD9A1052B863E9C00BB7769 /* ContentView.swift in Sources */, 902 | 8BD9A1032B863E9C00BB7769 /* MLXChatApp.swift in Sources */, 903 | 8B7060882B877D4100B3284E /* ParserResult.swift in Sources */, 904 | 8B7060802B877CA500B3284E /* MessageRowView.swift in Sources */, 905 | 8B7060822B877CC700B3284E /* MessageRow.swift in Sources */, 906 | 8B58CB2E2B8959600078CEA4 /* HeaderView.swift in Sources */, 907 | 8BD9A1452B87666D00BB7769 /* MLXChatXPCServiceProtocol.swift in Sources */, 908 | 8BD9A1442B87661600BB7769 /* ViewModel.swift in Sources */, 909 | 8B7A6B2D2B88411100CB45D5 /* PreferencePane.swift in Sources */, 910 | 8B7060842B877D0E00B3284E /* DotLoadingView.swift in Sources */, 911 | ); 912 | runOnlyForDeploymentPostprocessing = 0; 913 | }; 914 | 8BD9A1212B8760FA00BB7769 /* Sources */ = { 915 | isa = PBXSourcesBuildPhase; 916 | buildActionMask = 2147483647; 917 | files = ( 918 | 8BD9A1282B8760FA00BB7769 /* MLXChatXPCService.swift in Sources */, 919 | 8BD9A1422B8764DF00BB7769 /* MLXChat.swift in Sources */, 920 | 8BD9A12A2B8760FA00BB7769 /* MLXChatXPCServiceProtocol.swift in Sources */, 921 | 8BD9A12C2B8760FA00BB7769 /* main.swift in Sources */, 922 | ); 923 | runOnlyForDeploymentPostprocessing = 0; 924 | }; 925 | C3288D6F2B6D9313009FF608 /* Sources */ = { 926 | isa = PBXSourcesBuildPhase; 927 | buildActionMask = 2147483647; 928 | files = ( 929 | C3288D762B6D9313009FF608 /* LinearModelTraining.swift in Sources */, 930 | ); 931 | runOnlyForDeploymentPostprocessing = 0; 932 | }; 933 | C34E49092B69A92900FCB841 /* Sources */ = { 934 | isa = PBXSourcesBuildPhase; 935 | buildActionMask = 2147483647; 936 | files = ( 937 | C34E49152B69C1E300FCB841 /* Files.swift in Sources */, 938 | C3932D572B6A060B00A81055 /* MNIST.swift in Sources */, 939 | C3932D592B6A0BE400A81055 /* Random.swift in Sources */, 940 | ); 941 | runOnlyForDeploymentPostprocessing = 0; 942 | }; 943 | C34E491D2B6A026F00FCB841 /* Sources */ = { 944 | isa = PBXSourcesBuildPhase; 945 | buildActionMask = 2147483647; 946 | files = ( 947 | C34E49242B6A026F00FCB841 /* MNISTTool.swift in Sources */, 948 | ); 949 | runOnlyForDeploymentPostprocessing = 0; 950 | }; 951 | C39273702B606A0A00368D5D /* Sources */ = { 952 | isa = PBXSourcesBuildPhase; 953 | buildActionMask = 2147483647; 954 | files = ( 955 | C392737D2B606A1D00368D5D /* Tutorial.swift in Sources */, 956 | ); 957 | runOnlyForDeploymentPostprocessing = 0; 958 | }; 959 | C39273842B606AB800368D5D /* Sources */ = { 960 | isa = PBXSourcesBuildPhase; 961 | buildActionMask = 2147483647; 962 | files = ( 963 | C39273912B606AD100368D5D /* SentencePieceImpl.mm in Sources */, 964 | C39273962B606C6200368D5D /* SentencePiece.swift in Sources */, 965 | ); 966 | runOnlyForDeploymentPostprocessing = 0; 967 | }; 968 | C39273D12B607A9C00368D5D /* Sources */ = { 969 | isa = PBXSourcesBuildPhase; 970 | buildActionMask = 2147483647; 971 | files = ( 972 | C34E48F22B696E6500FCB841 /* Configuration.swift in Sources */, 973 | C34E48F02B696E6500FCB841 /* Util.swift in Sources */, 974 | C34E48F12B696E6500FCB841 /* Llama.swift in Sources */, 975 | ); 976 | runOnlyForDeploymentPostprocessing = 0; 977 | }; 978 | C397C5872B62C6A9004B084D /* Sources */ = { 979 | isa = PBXSourcesBuildPhase; 980 | buildActionMask = 2147483647; 981 | files = ( 982 | C34E48F52B696F0B00FCB841 /* LLMTool.swift in Sources */, 983 | ); 984 | runOnlyForDeploymentPostprocessing = 0; 985 | }; 986 | /* End PBXSourcesBuildPhase section */ 987 | 988 | /* Begin PBXTargetDependency section */ 989 | 8BD9A1302B8760FA00BB7769 /* PBXTargetDependency */ = { 990 | isa = PBXTargetDependency; 991 | target = 8BD9A1242B8760FA00BB7769 /* MLXChatXPCService */; 992 | targetProxy = 8BD9A12F2B8760FA00BB7769 /* PBXContainerItemProxy */; 993 | }; 994 | 8BD9A13B2B8761C700BB7769 /* PBXTargetDependency */ = { 995 | isa = PBXTargetDependency; 996 | target = C39273D42B607A9C00368D5D /* Llama */; 997 | targetProxy = 8BD9A13A2B8761C700BB7769 /* PBXContainerItemProxy */; 998 | }; 999 | 8BD9A13F2B8761C700BB7769 /* PBXTargetDependency */ = { 1000 | isa = PBXTargetDependency; 1001 | target = C39273872B606AB800368D5D /* SentencePiece */; 1002 | targetProxy = 8BD9A13E2B8761C700BB7769 /* PBXContainerItemProxy */; 1003 | }; 1004 | C34E492D2B6A028800FCB841 /* PBXTargetDependency */ = { 1005 | isa = PBXTargetDependency; 1006 | target = C34E490C2B69A92900FCB841 /* MNIST */; 1007 | targetProxy = C34E492C2B6A028800FCB841 /* PBXContainerItemProxy */; 1008 | }; 1009 | C39273E52B607AAA00368D5D /* PBXTargetDependency */ = { 1010 | isa = PBXTargetDependency; 1011 | target = C39273872B606AB800368D5D /* SentencePiece */; 1012 | targetProxy = C39273E42B607AAA00368D5D /* PBXContainerItemProxy */; 1013 | }; 1014 | C397C5952B62C6BD004B084D /* PBXTargetDependency */ = { 1015 | isa = PBXTargetDependency; 1016 | target = C39273D42B607A9C00368D5D /* Llama */; 1017 | targetProxy = C397C5942B62C6BD004B084D /* PBXContainerItemProxy */; 1018 | }; 1019 | C397C5992B62C6BD004B084D /* PBXTargetDependency */ = { 1020 | isa = PBXTargetDependency; 1021 | target = C39273872B606AB800368D5D /* SentencePiece */; 1022 | targetProxy = C397C5982B62C6BD004B084D /* PBXContainerItemProxy */; 1023 | }; 1024 | /* End PBXTargetDependency section */ 1025 | 1026 | /* Begin XCBuildConfiguration section */ 1027 | 8BD9A10C2B863E9D00BB7769 /* Debug */ = { 1028 | isa = XCBuildConfiguration; 1029 | buildSettings = { 1030 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 1031 | ALWAYS_SEARCH_USER_PATHS = NO; 1032 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1033 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1034 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 1035 | CLANG_ANALYZER_NONNULL = YES; 1036 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1037 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1038 | CLANG_ENABLE_MODULES = YES; 1039 | CLANG_ENABLE_OBJC_ARC = YES; 1040 | CLANG_ENABLE_OBJC_WEAK = YES; 1041 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1042 | CLANG_WARN_BOOL_CONVERSION = YES; 1043 | CLANG_WARN_COMMA = YES; 1044 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1045 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1046 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1047 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1048 | CLANG_WARN_EMPTY_BODY = YES; 1049 | CLANG_WARN_ENUM_CONVERSION = YES; 1050 | CLANG_WARN_INFINITE_RECURSION = YES; 1051 | CLANG_WARN_INT_CONVERSION = YES; 1052 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1053 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1054 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1055 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1056 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1057 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1058 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1059 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1060 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1061 | CLANG_WARN_UNREACHABLE_CODE = YES; 1062 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1063 | CODE_SIGN_ENTITLEMENTS = MLXChat/MLXChat.entitlements; 1064 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; 1065 | CODE_SIGN_STYLE = Manual; 1066 | COMBINE_HIDPI_IMAGES = YES; 1067 | COPY_PHASE_STRIP = NO; 1068 | CURRENT_PROJECT_VERSION = 1; 1069 | DEBUG_INFORMATION_FORMAT = dwarf; 1070 | DEVELOPMENT_ASSET_PATHS = "\"MLXChat/Preview Content\""; 1071 | DEVELOPMENT_TEAM = ""; 1072 | ENABLE_HARDENED_RUNTIME = NO; 1073 | ENABLE_PREVIEWS = YES; 1074 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1075 | ENABLE_TESTABILITY = YES; 1076 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1077 | GCC_C_LANGUAGE_STANDARD = gnu17; 1078 | GCC_DYNAMIC_NO_PIC = NO; 1079 | GCC_NO_COMMON_BLOCKS = YES; 1080 | GCC_OPTIMIZATION_LEVEL = 0; 1081 | GCC_PREPROCESSOR_DEFINITIONS = ( 1082 | "DEBUG=1", 1083 | "$(inherited)", 1084 | ); 1085 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1086 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1087 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1088 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1089 | GCC_WARN_UNUSED_FUNCTION = YES; 1090 | GCC_WARN_UNUSED_VARIABLE = YES; 1091 | GENERATE_INFOPLIST_FILE = YES; 1092 | INFOPLIST_FILE = MLXChat/Info.plist; 1093 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 1094 | LD_RUNPATH_SEARCH_PATHS = ( 1095 | "$(inherited)", 1096 | "@executable_path/../Frameworks", 1097 | ); 1098 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1099 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1100 | MARKETING_VERSION = 1.0; 1101 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1102 | MTL_FAST_MATH = YES; 1103 | PRODUCT_BUNDLE_IDENTIFIER = com.alfianlosari.MLXChat; 1104 | PRODUCT_NAME = "XCA MLX Chat"; 1105 | PROVISIONING_PROFILE_SPECIFIER = ""; 1106 | SDKROOT = macosx; 1107 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 1108 | SWIFT_EMIT_LOC_STRINGS = YES; 1109 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1110 | SWIFT_VERSION = 5.0; 1111 | }; 1112 | name = Debug; 1113 | }; 1114 | 8BD9A10D2B863E9D00BB7769 /* Release */ = { 1115 | isa = XCBuildConfiguration; 1116 | buildSettings = { 1117 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 1118 | ALWAYS_SEARCH_USER_PATHS = NO; 1119 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1120 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1121 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 1122 | CLANG_ANALYZER_NONNULL = YES; 1123 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1124 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1125 | CLANG_ENABLE_MODULES = YES; 1126 | CLANG_ENABLE_OBJC_ARC = YES; 1127 | CLANG_ENABLE_OBJC_WEAK = YES; 1128 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1129 | CLANG_WARN_BOOL_CONVERSION = YES; 1130 | CLANG_WARN_COMMA = YES; 1131 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1132 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1133 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1134 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1135 | CLANG_WARN_EMPTY_BODY = YES; 1136 | CLANG_WARN_ENUM_CONVERSION = YES; 1137 | CLANG_WARN_INFINITE_RECURSION = YES; 1138 | CLANG_WARN_INT_CONVERSION = YES; 1139 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1140 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1141 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1142 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1143 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1144 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1145 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1146 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1147 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1148 | CLANG_WARN_UNREACHABLE_CODE = YES; 1149 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1150 | CODE_SIGN_ENTITLEMENTS = MLXChat/MLXChat.entitlements; 1151 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; 1152 | CODE_SIGN_STYLE = Manual; 1153 | COMBINE_HIDPI_IMAGES = YES; 1154 | COPY_PHASE_STRIP = NO; 1155 | CURRENT_PROJECT_VERSION = 1; 1156 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1157 | DEVELOPMENT_ASSET_PATHS = "\"MLXChat/Preview Content\""; 1158 | DEVELOPMENT_TEAM = ""; 1159 | ENABLE_HARDENED_RUNTIME = NO; 1160 | ENABLE_NS_ASSERTIONS = NO; 1161 | ENABLE_PREVIEWS = YES; 1162 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1163 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1164 | GCC_C_LANGUAGE_STANDARD = gnu17; 1165 | GCC_NO_COMMON_BLOCKS = YES; 1166 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1167 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1168 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1169 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1170 | GCC_WARN_UNUSED_FUNCTION = YES; 1171 | GCC_WARN_UNUSED_VARIABLE = YES; 1172 | GENERATE_INFOPLIST_FILE = YES; 1173 | INFOPLIST_FILE = MLXChat/Info.plist; 1174 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 1175 | LD_RUNPATH_SEARCH_PATHS = ( 1176 | "$(inherited)", 1177 | "@executable_path/../Frameworks", 1178 | ); 1179 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1180 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1181 | MARKETING_VERSION = 1.0; 1182 | MTL_ENABLE_DEBUG_INFO = NO; 1183 | MTL_FAST_MATH = YES; 1184 | PRODUCT_BUNDLE_IDENTIFIER = com.alfianlosari.MLXChat; 1185 | PRODUCT_NAME = "XCA MLX Chat"; 1186 | PROVISIONING_PROFILE_SPECIFIER = ""; 1187 | SDKROOT = macosx; 1188 | SWIFT_COMPILATION_MODE = wholemodule; 1189 | SWIFT_EMIT_LOC_STRINGS = YES; 1190 | SWIFT_VERSION = 5.0; 1191 | }; 1192 | name = Release; 1193 | }; 1194 | 8BD9A1332B8760FA00BB7769 /* Debug */ = { 1195 | isa = XCBuildConfiguration; 1196 | buildSettings = { 1197 | ALWAYS_SEARCH_USER_PATHS = NO; 1198 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1199 | CLANG_ANALYZER_NONNULL = YES; 1200 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1201 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1202 | CLANG_ENABLE_MODULES = YES; 1203 | CLANG_ENABLE_OBJC_ARC = YES; 1204 | CLANG_ENABLE_OBJC_WEAK = YES; 1205 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1206 | CLANG_WARN_BOOL_CONVERSION = YES; 1207 | CLANG_WARN_COMMA = YES; 1208 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1209 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1210 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1211 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1212 | CLANG_WARN_EMPTY_BODY = YES; 1213 | CLANG_WARN_ENUM_CONVERSION = YES; 1214 | CLANG_WARN_INFINITE_RECURSION = YES; 1215 | CLANG_WARN_INT_CONVERSION = YES; 1216 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1217 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1218 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1219 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1220 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1221 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1222 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1223 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1224 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1225 | CLANG_WARN_UNREACHABLE_CODE = YES; 1226 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1227 | CODE_SIGN_ENTITLEMENTS = MLXChatXPCService/MLXChatXPCService.entitlements; 1228 | CODE_SIGN_STYLE = Automatic; 1229 | COMBINE_HIDPI_IMAGES = YES; 1230 | COPY_PHASE_STRIP = NO; 1231 | CURRENT_PROJECT_VERSION = 1; 1232 | DEBUG_INFORMATION_FORMAT = dwarf; 1233 | DEVELOPMENT_TEAM = ""; 1234 | ENABLE_HARDENED_RUNTIME = NO; 1235 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1236 | ENABLE_TESTABILITY = YES; 1237 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1238 | GCC_C_LANGUAGE_STANDARD = gnu17; 1239 | GCC_DYNAMIC_NO_PIC = NO; 1240 | GCC_NO_COMMON_BLOCKS = YES; 1241 | GCC_OPTIMIZATION_LEVEL = 0; 1242 | GCC_PREPROCESSOR_DEFINITIONS = ( 1243 | "DEBUG=1", 1244 | "$(inherited)", 1245 | ); 1246 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1247 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1248 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1249 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1250 | GCC_WARN_UNUSED_FUNCTION = YES; 1251 | GCC_WARN_UNUSED_VARIABLE = YES; 1252 | GENERATE_INFOPLIST_FILE = YES; 1253 | INFOPLIST_FILE = MLXChatXPCService/Info.plist; 1254 | INFOPLIST_KEY_CFBundleDisplayName = MLXChatXPCService; 1255 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 1256 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1257 | MACOSX_DEPLOYMENT_TARGET = 14.2; 1258 | MARKETING_VERSION = 1.0; 1259 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1260 | MTL_FAST_MATH = YES; 1261 | PRODUCT_BUNDLE_IDENTIFIER = com.xca.MLXChatXPCService; 1262 | PRODUCT_NAME = "$(TARGET_NAME)"; 1263 | SDKROOT = macosx; 1264 | SKIP_INSTALL = YES; 1265 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 1266 | SWIFT_EMIT_LOC_STRINGS = YES; 1267 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1268 | SWIFT_VERSION = 5.0; 1269 | }; 1270 | name = Debug; 1271 | }; 1272 | 8BD9A1342B8760FA00BB7769 /* Release */ = { 1273 | isa = XCBuildConfiguration; 1274 | buildSettings = { 1275 | ALWAYS_SEARCH_USER_PATHS = NO; 1276 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1277 | CLANG_ANALYZER_NONNULL = YES; 1278 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1279 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1280 | CLANG_ENABLE_MODULES = YES; 1281 | CLANG_ENABLE_OBJC_ARC = YES; 1282 | CLANG_ENABLE_OBJC_WEAK = YES; 1283 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1284 | CLANG_WARN_BOOL_CONVERSION = YES; 1285 | CLANG_WARN_COMMA = YES; 1286 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1287 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1288 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1289 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1290 | CLANG_WARN_EMPTY_BODY = YES; 1291 | CLANG_WARN_ENUM_CONVERSION = YES; 1292 | CLANG_WARN_INFINITE_RECURSION = YES; 1293 | CLANG_WARN_INT_CONVERSION = YES; 1294 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1295 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1296 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1297 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1298 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1299 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1300 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1301 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1302 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1303 | CLANG_WARN_UNREACHABLE_CODE = YES; 1304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1305 | CODE_SIGN_ENTITLEMENTS = MLXChatXPCService/MLXChatXPCService.entitlements; 1306 | CODE_SIGN_STYLE = Automatic; 1307 | COMBINE_HIDPI_IMAGES = YES; 1308 | COPY_PHASE_STRIP = NO; 1309 | CURRENT_PROJECT_VERSION = 1; 1310 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1311 | DEVELOPMENT_TEAM = ""; 1312 | ENABLE_HARDENED_RUNTIME = NO; 1313 | ENABLE_NS_ASSERTIONS = NO; 1314 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1315 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1316 | GCC_C_LANGUAGE_STANDARD = gnu17; 1317 | GCC_NO_COMMON_BLOCKS = YES; 1318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1320 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1322 | GCC_WARN_UNUSED_FUNCTION = YES; 1323 | GCC_WARN_UNUSED_VARIABLE = YES; 1324 | GENERATE_INFOPLIST_FILE = YES; 1325 | INFOPLIST_FILE = MLXChatXPCService/Info.plist; 1326 | INFOPLIST_KEY_CFBundleDisplayName = MLXChatXPCService; 1327 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 1328 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1329 | MACOSX_DEPLOYMENT_TARGET = 14.2; 1330 | MARKETING_VERSION = 1.0; 1331 | MTL_ENABLE_DEBUG_INFO = NO; 1332 | MTL_FAST_MATH = YES; 1333 | PRODUCT_BUNDLE_IDENTIFIER = com.xca.MLXChatXPCService; 1334 | PRODUCT_NAME = "$(TARGET_NAME)"; 1335 | SDKROOT = macosx; 1336 | SKIP_INSTALL = YES; 1337 | SWIFT_COMPILATION_MODE = wholemodule; 1338 | SWIFT_EMIT_LOC_STRINGS = YES; 1339 | SWIFT_VERSION = 5.0; 1340 | }; 1341 | name = Release; 1342 | }; 1343 | C3288D772B6D9313009FF608 /* Debug */ = { 1344 | isa = XCBuildConfiguration; 1345 | buildSettings = { 1346 | ALWAYS_SEARCH_USER_PATHS = NO; 1347 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1348 | CLANG_ANALYZER_NONNULL = YES; 1349 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1350 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1351 | CLANG_ENABLE_MODULES = YES; 1352 | CLANG_ENABLE_OBJC_ARC = YES; 1353 | CLANG_ENABLE_OBJC_WEAK = YES; 1354 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1355 | CLANG_WARN_BOOL_CONVERSION = YES; 1356 | CLANG_WARN_COMMA = YES; 1357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1358 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1359 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1360 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1361 | CLANG_WARN_EMPTY_BODY = YES; 1362 | CLANG_WARN_ENUM_CONVERSION = YES; 1363 | CLANG_WARN_INFINITE_RECURSION = YES; 1364 | CLANG_WARN_INT_CONVERSION = YES; 1365 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1366 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1367 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1368 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1369 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1370 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1371 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1372 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1373 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1374 | CLANG_WARN_UNREACHABLE_CODE = YES; 1375 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1376 | CODE_SIGN_STYLE = Automatic; 1377 | COPY_PHASE_STRIP = NO; 1378 | DEBUG_INFORMATION_FORMAT = dwarf; 1379 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1380 | ENABLE_TESTABILITY = YES; 1381 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1382 | GCC_C_LANGUAGE_STANDARD = gnu17; 1383 | GCC_DYNAMIC_NO_PIC = NO; 1384 | GCC_NO_COMMON_BLOCKS = YES; 1385 | GCC_OPTIMIZATION_LEVEL = 0; 1386 | GCC_PREPROCESSOR_DEFINITIONS = ( 1387 | "DEBUG=1", 1388 | "$(inherited)", 1389 | ); 1390 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1391 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1392 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1393 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1394 | GCC_WARN_UNUSED_FUNCTION = YES; 1395 | GCC_WARN_UNUSED_VARIABLE = YES; 1396 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1397 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1398 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1399 | MTL_FAST_MATH = YES; 1400 | PRODUCT_NAME = "$(TARGET_NAME)"; 1401 | SDKROOT = macosx; 1402 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 1403 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1404 | SWIFT_VERSION = 5.0; 1405 | }; 1406 | name = Debug; 1407 | }; 1408 | C3288D782B6D9313009FF608 /* Release */ = { 1409 | isa = XCBuildConfiguration; 1410 | buildSettings = { 1411 | ALWAYS_SEARCH_USER_PATHS = NO; 1412 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1413 | CLANG_ANALYZER_NONNULL = YES; 1414 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1415 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1416 | CLANG_ENABLE_MODULES = YES; 1417 | CLANG_ENABLE_OBJC_ARC = YES; 1418 | CLANG_ENABLE_OBJC_WEAK = YES; 1419 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1420 | CLANG_WARN_BOOL_CONVERSION = YES; 1421 | CLANG_WARN_COMMA = YES; 1422 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1423 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1424 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1425 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1426 | CLANG_WARN_EMPTY_BODY = YES; 1427 | CLANG_WARN_ENUM_CONVERSION = YES; 1428 | CLANG_WARN_INFINITE_RECURSION = YES; 1429 | CLANG_WARN_INT_CONVERSION = YES; 1430 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1431 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1432 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1433 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1434 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1435 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1436 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1437 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1438 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1439 | CLANG_WARN_UNREACHABLE_CODE = YES; 1440 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1441 | CODE_SIGN_STYLE = Automatic; 1442 | COPY_PHASE_STRIP = NO; 1443 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1444 | ENABLE_NS_ASSERTIONS = NO; 1445 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1446 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1447 | GCC_C_LANGUAGE_STANDARD = gnu17; 1448 | GCC_NO_COMMON_BLOCKS = YES; 1449 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1450 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1451 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1452 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1453 | GCC_WARN_UNUSED_FUNCTION = YES; 1454 | GCC_WARN_UNUSED_VARIABLE = YES; 1455 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1456 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1457 | MTL_ENABLE_DEBUG_INFO = NO; 1458 | MTL_FAST_MATH = YES; 1459 | PRODUCT_NAME = "$(TARGET_NAME)"; 1460 | SDKROOT = macosx; 1461 | SWIFT_COMPILATION_MODE = wholemodule; 1462 | SWIFT_VERSION = 5.0; 1463 | }; 1464 | name = Release; 1465 | }; 1466 | C34E49122B69A92900FCB841 /* Debug */ = { 1467 | isa = XCBuildConfiguration; 1468 | buildSettings = { 1469 | ALWAYS_SEARCH_USER_PATHS = NO; 1470 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1471 | CLANG_ANALYZER_NONNULL = YES; 1472 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1473 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1474 | CLANG_ENABLE_MODULES = YES; 1475 | CLANG_ENABLE_OBJC_ARC = YES; 1476 | CLANG_ENABLE_OBJC_WEAK = YES; 1477 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1478 | CLANG_WARN_BOOL_CONVERSION = YES; 1479 | CLANG_WARN_COMMA = YES; 1480 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1481 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1482 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1483 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1484 | CLANG_WARN_EMPTY_BODY = YES; 1485 | CLANG_WARN_ENUM_CONVERSION = YES; 1486 | CLANG_WARN_INFINITE_RECURSION = YES; 1487 | CLANG_WARN_INT_CONVERSION = YES; 1488 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1489 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1490 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1491 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1492 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1493 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1494 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1495 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1496 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1497 | CLANG_WARN_UNREACHABLE_CODE = YES; 1498 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1499 | CODE_SIGN_STYLE = Automatic; 1500 | COMBINE_HIDPI_IMAGES = YES; 1501 | COPY_PHASE_STRIP = NO; 1502 | CURRENT_PROJECT_VERSION = 1; 1503 | DEBUG_INFORMATION_FORMAT = dwarf; 1504 | DEFINES_MODULE = YES; 1505 | DYLIB_COMPATIBILITY_VERSION = 1; 1506 | DYLIB_CURRENT_VERSION = 1; 1507 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1508 | ENABLE_MODULE_VERIFIER = YES; 1509 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1510 | ENABLE_TESTABILITY = YES; 1511 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1512 | GCC_C_LANGUAGE_STANDARD = gnu17; 1513 | GCC_DYNAMIC_NO_PIC = NO; 1514 | GCC_NO_COMMON_BLOCKS = YES; 1515 | GCC_OPTIMIZATION_LEVEL = 0; 1516 | GCC_PREPROCESSOR_DEFINITIONS = ( 1517 | "DEBUG=1", 1518 | "$(inherited)", 1519 | ); 1520 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1521 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1522 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1523 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1524 | GCC_WARN_UNUSED_FUNCTION = YES; 1525 | GCC_WARN_UNUSED_VARIABLE = YES; 1526 | GENERATE_INFOPLIST_FILE = YES; 1527 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 1528 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1529 | LD_RUNPATH_SEARCH_PATHS = ( 1530 | "$(inherited)", 1531 | "@executable_path/../Frameworks", 1532 | "@loader_path/Frameworks", 1533 | ); 1534 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1535 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1536 | MARKETING_VERSION = 1.0; 1537 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 1538 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; 1539 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1540 | MTL_FAST_MATH = YES; 1541 | PRODUCT_BUNDLE_IDENTIFIER = mlx.MNIST; 1542 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 1543 | SDKROOT = macosx; 1544 | SKIP_INSTALL = YES; 1545 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 1546 | SWIFT_EMIT_LOC_STRINGS = YES; 1547 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1548 | SWIFT_VERSION = 5.0; 1549 | VERSIONING_SYSTEM = "apple-generic"; 1550 | VERSION_INFO_PREFIX = ""; 1551 | }; 1552 | name = Debug; 1553 | }; 1554 | C34E49132B69A92900FCB841 /* Release */ = { 1555 | isa = XCBuildConfiguration; 1556 | buildSettings = { 1557 | ALWAYS_SEARCH_USER_PATHS = NO; 1558 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1559 | CLANG_ANALYZER_NONNULL = YES; 1560 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1561 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1562 | CLANG_ENABLE_MODULES = YES; 1563 | CLANG_ENABLE_OBJC_ARC = YES; 1564 | CLANG_ENABLE_OBJC_WEAK = YES; 1565 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1566 | CLANG_WARN_BOOL_CONVERSION = YES; 1567 | CLANG_WARN_COMMA = YES; 1568 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1569 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1570 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1571 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1572 | CLANG_WARN_EMPTY_BODY = YES; 1573 | CLANG_WARN_ENUM_CONVERSION = YES; 1574 | CLANG_WARN_INFINITE_RECURSION = YES; 1575 | CLANG_WARN_INT_CONVERSION = YES; 1576 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1577 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1578 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1579 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1580 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1581 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1582 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1583 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1584 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1585 | CLANG_WARN_UNREACHABLE_CODE = YES; 1586 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1587 | CODE_SIGN_STYLE = Automatic; 1588 | COMBINE_HIDPI_IMAGES = YES; 1589 | COPY_PHASE_STRIP = NO; 1590 | CURRENT_PROJECT_VERSION = 1; 1591 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1592 | DEFINES_MODULE = YES; 1593 | DYLIB_COMPATIBILITY_VERSION = 1; 1594 | DYLIB_CURRENT_VERSION = 1; 1595 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1596 | ENABLE_MODULE_VERIFIER = YES; 1597 | ENABLE_NS_ASSERTIONS = NO; 1598 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1599 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1600 | GCC_C_LANGUAGE_STANDARD = gnu17; 1601 | GCC_NO_COMMON_BLOCKS = YES; 1602 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1603 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1604 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1605 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1606 | GCC_WARN_UNUSED_FUNCTION = YES; 1607 | GCC_WARN_UNUSED_VARIABLE = YES; 1608 | GENERATE_INFOPLIST_FILE = YES; 1609 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 1610 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1611 | LD_RUNPATH_SEARCH_PATHS = ( 1612 | "$(inherited)", 1613 | "@executable_path/../Frameworks", 1614 | "@loader_path/Frameworks", 1615 | ); 1616 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1617 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1618 | MARKETING_VERSION = 1.0; 1619 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 1620 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; 1621 | MTL_ENABLE_DEBUG_INFO = NO; 1622 | MTL_FAST_MATH = YES; 1623 | PRODUCT_BUNDLE_IDENTIFIER = mlx.MNIST; 1624 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 1625 | SDKROOT = macosx; 1626 | SKIP_INSTALL = YES; 1627 | SWIFT_COMPILATION_MODE = wholemodule; 1628 | SWIFT_EMIT_LOC_STRINGS = YES; 1629 | SWIFT_VERSION = 5.0; 1630 | VERSIONING_SYSTEM = "apple-generic"; 1631 | VERSION_INFO_PREFIX = ""; 1632 | }; 1633 | name = Release; 1634 | }; 1635 | C34E49262B6A026F00FCB841 /* Debug */ = { 1636 | isa = XCBuildConfiguration; 1637 | buildSettings = { 1638 | ALWAYS_SEARCH_USER_PATHS = NO; 1639 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1640 | CLANG_ANALYZER_NONNULL = YES; 1641 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1642 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1643 | CLANG_ENABLE_MODULES = YES; 1644 | CLANG_ENABLE_OBJC_ARC = YES; 1645 | CLANG_ENABLE_OBJC_WEAK = YES; 1646 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1647 | CLANG_WARN_BOOL_CONVERSION = YES; 1648 | CLANG_WARN_COMMA = YES; 1649 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1650 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1651 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1652 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1653 | CLANG_WARN_EMPTY_BODY = YES; 1654 | CLANG_WARN_ENUM_CONVERSION = YES; 1655 | CLANG_WARN_INFINITE_RECURSION = YES; 1656 | CLANG_WARN_INT_CONVERSION = YES; 1657 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1658 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1659 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1660 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1661 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1662 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1663 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1664 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1665 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1666 | CLANG_WARN_UNREACHABLE_CODE = YES; 1667 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1668 | CODE_SIGN_STYLE = Automatic; 1669 | COPY_PHASE_STRIP = NO; 1670 | DEBUG_INFORMATION_FORMAT = dwarf; 1671 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1672 | ENABLE_TESTABILITY = YES; 1673 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1674 | GCC_C_LANGUAGE_STANDARD = gnu17; 1675 | GCC_DYNAMIC_NO_PIC = NO; 1676 | GCC_NO_COMMON_BLOCKS = YES; 1677 | GCC_OPTIMIZATION_LEVEL = 0; 1678 | GCC_PREPROCESSOR_DEFINITIONS = ( 1679 | "DEBUG=1", 1680 | "$(inherited)", 1681 | ); 1682 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1683 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1684 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1685 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1686 | GCC_WARN_UNUSED_FUNCTION = YES; 1687 | GCC_WARN_UNUSED_VARIABLE = YES; 1688 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1689 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1690 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1691 | MTL_FAST_MATH = YES; 1692 | PRODUCT_NAME = "$(TARGET_NAME)"; 1693 | SDKROOT = macosx; 1694 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 1695 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1696 | SWIFT_VERSION = 5.0; 1697 | }; 1698 | name = Debug; 1699 | }; 1700 | C34E49272B6A026F00FCB841 /* Release */ = { 1701 | isa = XCBuildConfiguration; 1702 | buildSettings = { 1703 | ALWAYS_SEARCH_USER_PATHS = NO; 1704 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1705 | CLANG_ANALYZER_NONNULL = YES; 1706 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1707 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1708 | CLANG_ENABLE_MODULES = YES; 1709 | CLANG_ENABLE_OBJC_ARC = YES; 1710 | CLANG_ENABLE_OBJC_WEAK = YES; 1711 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1712 | CLANG_WARN_BOOL_CONVERSION = YES; 1713 | CLANG_WARN_COMMA = YES; 1714 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1715 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1716 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1717 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1718 | CLANG_WARN_EMPTY_BODY = YES; 1719 | CLANG_WARN_ENUM_CONVERSION = YES; 1720 | CLANG_WARN_INFINITE_RECURSION = YES; 1721 | CLANG_WARN_INT_CONVERSION = YES; 1722 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1723 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1724 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1725 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1726 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1727 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1728 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1729 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1730 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1731 | CLANG_WARN_UNREACHABLE_CODE = YES; 1732 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1733 | CODE_SIGN_STYLE = Automatic; 1734 | COPY_PHASE_STRIP = NO; 1735 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1736 | ENABLE_NS_ASSERTIONS = NO; 1737 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1738 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1739 | GCC_C_LANGUAGE_STANDARD = gnu17; 1740 | GCC_NO_COMMON_BLOCKS = YES; 1741 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1742 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1743 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1744 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1745 | GCC_WARN_UNUSED_FUNCTION = YES; 1746 | GCC_WARN_UNUSED_VARIABLE = YES; 1747 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1748 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1749 | MTL_ENABLE_DEBUG_INFO = NO; 1750 | MTL_FAST_MATH = YES; 1751 | PRODUCT_NAME = "$(TARGET_NAME)"; 1752 | SDKROOT = macosx; 1753 | SWIFT_COMPILATION_MODE = wholemodule; 1754 | SWIFT_VERSION = 5.0; 1755 | }; 1756 | name = Release; 1757 | }; 1758 | C392736C2B60697700368D5D /* Debug */ = { 1759 | isa = XCBuildConfiguration; 1760 | buildSettings = { 1761 | ARCHS = "$(ARCHS_STANDARD)"; 1762 | EXCLUDED_ARCHS = x86_64; 1763 | ONLY_ACTIVE_ARCH = YES; 1764 | }; 1765 | name = Debug; 1766 | }; 1767 | C392736D2B60697700368D5D /* Release */ = { 1768 | isa = XCBuildConfiguration; 1769 | buildSettings = { 1770 | ARCHS = "$(ARCHS_STANDARD)"; 1771 | EXCLUDED_ARCHS = x86_64; 1772 | ONLY_ACTIVE_ARCH = YES; 1773 | }; 1774 | name = Release; 1775 | }; 1776 | C392737A2B606A0A00368D5D /* Debug */ = { 1777 | isa = XCBuildConfiguration; 1778 | buildSettings = { 1779 | ALWAYS_SEARCH_USER_PATHS = NO; 1780 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1781 | CLANG_ANALYZER_NONNULL = YES; 1782 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1783 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1784 | CLANG_ENABLE_MODULES = YES; 1785 | CLANG_ENABLE_OBJC_ARC = YES; 1786 | CLANG_ENABLE_OBJC_WEAK = YES; 1787 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1788 | CLANG_WARN_BOOL_CONVERSION = YES; 1789 | CLANG_WARN_COMMA = YES; 1790 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1791 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1792 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1793 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1794 | CLANG_WARN_EMPTY_BODY = YES; 1795 | CLANG_WARN_ENUM_CONVERSION = YES; 1796 | CLANG_WARN_INFINITE_RECURSION = YES; 1797 | CLANG_WARN_INT_CONVERSION = YES; 1798 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1799 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1800 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1801 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1802 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1803 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1804 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1805 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1806 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1807 | CLANG_WARN_UNREACHABLE_CODE = YES; 1808 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1809 | CODE_SIGN_STYLE = Automatic; 1810 | COPY_PHASE_STRIP = NO; 1811 | DEBUG_INFORMATION_FORMAT = dwarf; 1812 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1813 | ENABLE_TESTABILITY = YES; 1814 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1815 | GCC_C_LANGUAGE_STANDARD = gnu17; 1816 | GCC_DYNAMIC_NO_PIC = NO; 1817 | GCC_NO_COMMON_BLOCKS = YES; 1818 | GCC_OPTIMIZATION_LEVEL = 0; 1819 | GCC_PREPROCESSOR_DEFINITIONS = ( 1820 | "DEBUG=1", 1821 | "$(inherited)", 1822 | ); 1823 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1824 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1825 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1826 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1827 | GCC_WARN_UNUSED_FUNCTION = YES; 1828 | GCC_WARN_UNUSED_VARIABLE = YES; 1829 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1830 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1831 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1832 | MTL_FAST_MATH = YES; 1833 | ONLY_ACTIVE_ARCH = YES; 1834 | PRODUCT_NAME = "$(TARGET_NAME)"; 1835 | SDKROOT = macosx; 1836 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 1837 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1838 | SWIFT_VERSION = 5.0; 1839 | }; 1840 | name = Debug; 1841 | }; 1842 | C392737B2B606A0A00368D5D /* Release */ = { 1843 | isa = XCBuildConfiguration; 1844 | buildSettings = { 1845 | ALWAYS_SEARCH_USER_PATHS = NO; 1846 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1847 | CLANG_ANALYZER_NONNULL = YES; 1848 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1849 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1850 | CLANG_ENABLE_MODULES = YES; 1851 | CLANG_ENABLE_OBJC_ARC = YES; 1852 | CLANG_ENABLE_OBJC_WEAK = YES; 1853 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1854 | CLANG_WARN_BOOL_CONVERSION = YES; 1855 | CLANG_WARN_COMMA = YES; 1856 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1857 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1858 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1859 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1860 | CLANG_WARN_EMPTY_BODY = YES; 1861 | CLANG_WARN_ENUM_CONVERSION = YES; 1862 | CLANG_WARN_INFINITE_RECURSION = YES; 1863 | CLANG_WARN_INT_CONVERSION = YES; 1864 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1865 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1866 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1867 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1868 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1869 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1870 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1871 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1872 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1873 | CLANG_WARN_UNREACHABLE_CODE = YES; 1874 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1875 | CODE_SIGN_STYLE = Automatic; 1876 | COPY_PHASE_STRIP = NO; 1877 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1878 | ENABLE_NS_ASSERTIONS = NO; 1879 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1880 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1881 | GCC_C_LANGUAGE_STANDARD = gnu17; 1882 | GCC_NO_COMMON_BLOCKS = YES; 1883 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1884 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1885 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1886 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1887 | GCC_WARN_UNUSED_FUNCTION = YES; 1888 | GCC_WARN_UNUSED_VARIABLE = YES; 1889 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1890 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1891 | MTL_ENABLE_DEBUG_INFO = NO; 1892 | MTL_FAST_MATH = YES; 1893 | PRODUCT_NAME = "$(TARGET_NAME)"; 1894 | SDKROOT = macosx; 1895 | SWIFT_COMPILATION_MODE = wholemodule; 1896 | SWIFT_VERSION = 5.0; 1897 | }; 1898 | name = Release; 1899 | }; 1900 | C392738D2B606AB800368D5D /* Debug */ = { 1901 | isa = XCBuildConfiguration; 1902 | baseConfigurationReference = C39273942B606BB800368D5D /* SentencePiece.xcconfig */; 1903 | buildSettings = { 1904 | ALWAYS_SEARCH_USER_PATHS = NO; 1905 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 1906 | CLANG_ANALYZER_NONNULL = YES; 1907 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 1908 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 1909 | CLANG_ENABLE_MODULES = YES; 1910 | CLANG_ENABLE_OBJC_ARC = YES; 1911 | CLANG_ENABLE_OBJC_WEAK = YES; 1912 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1913 | CLANG_WARN_BOOL_CONVERSION = YES; 1914 | CLANG_WARN_COMMA = YES; 1915 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1916 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1917 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1918 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1919 | CLANG_WARN_EMPTY_BODY = YES; 1920 | CLANG_WARN_ENUM_CONVERSION = YES; 1921 | CLANG_WARN_INFINITE_RECURSION = YES; 1922 | CLANG_WARN_INT_CONVERSION = YES; 1923 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1924 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1925 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1926 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1927 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 1928 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1929 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1930 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1931 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 1932 | CLANG_WARN_UNREACHABLE_CODE = YES; 1933 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1934 | CODE_SIGN_IDENTITY = "Apple Development"; 1935 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; 1936 | CODE_SIGN_STYLE = Manual; 1937 | COMBINE_HIDPI_IMAGES = YES; 1938 | COPY_PHASE_STRIP = NO; 1939 | CURRENT_PROJECT_VERSION = 1; 1940 | DEBUG_INFORMATION_FORMAT = dwarf; 1941 | DEFINES_MODULE = YES; 1942 | DEVELOPMENT_TEAM = ""; 1943 | "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; 1944 | DYLIB_COMPATIBILITY_VERSION = 1; 1945 | DYLIB_CURRENT_VERSION = 1; 1946 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1947 | ENABLE_MODULE_VERIFIER = YES; 1948 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1949 | ENABLE_TESTABILITY = YES; 1950 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 1951 | GCC_C_LANGUAGE_STANDARD = gnu17; 1952 | GCC_DYNAMIC_NO_PIC = NO; 1953 | GCC_NO_COMMON_BLOCKS = YES; 1954 | GCC_OPTIMIZATION_LEVEL = 0; 1955 | GCC_PREPROCESSOR_DEFINITIONS = ( 1956 | "DEBUG=1", 1957 | "$(inherited)", 1958 | ); 1959 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1960 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1961 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1962 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1963 | GCC_WARN_UNUSED_FUNCTION = YES; 1964 | GCC_WARN_UNUSED_VARIABLE = YES; 1965 | GENERATE_INFOPLIST_FILE = YES; 1966 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 1967 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1968 | LD_RUNPATH_SEARCH_PATHS = ( 1969 | "$(inherited)", 1970 | "@executable_path/../Frameworks", 1971 | "@loader_path/Frameworks", 1972 | ); 1973 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 1974 | MACOSX_DEPLOYMENT_TARGET = 14.0; 1975 | MARKETING_VERSION = 1.0; 1976 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 1977 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; 1978 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 1979 | MTL_FAST_MATH = YES; 1980 | ONLY_ACTIVE_ARCH = YES; 1981 | PRODUCT_BUNDLE_IDENTIFIER = mlx.SentencePiece; 1982 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 1983 | PROVISIONING_PROFILE_SPECIFIER = ""; 1984 | SDKROOT = macosx; 1985 | SKIP_INSTALL = YES; 1986 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 1987 | SWIFT_EMIT_LOC_STRINGS = YES; 1988 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1989 | SWIFT_VERSION = 5.0; 1990 | VERSIONING_SYSTEM = "apple-generic"; 1991 | VERSION_INFO_PREFIX = ""; 1992 | }; 1993 | name = Debug; 1994 | }; 1995 | C392738E2B606AB800368D5D /* Release */ = { 1996 | isa = XCBuildConfiguration; 1997 | baseConfigurationReference = C39273942B606BB800368D5D /* SentencePiece.xcconfig */; 1998 | buildSettings = { 1999 | ALWAYS_SEARCH_USER_PATHS = NO; 2000 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 2001 | CLANG_ANALYZER_NONNULL = YES; 2002 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 2003 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 2004 | CLANG_ENABLE_MODULES = YES; 2005 | CLANG_ENABLE_OBJC_ARC = YES; 2006 | CLANG_ENABLE_OBJC_WEAK = YES; 2007 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 2008 | CLANG_WARN_BOOL_CONVERSION = YES; 2009 | CLANG_WARN_COMMA = YES; 2010 | CLANG_WARN_CONSTANT_CONVERSION = YES; 2011 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 2012 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 2013 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 2014 | CLANG_WARN_EMPTY_BODY = YES; 2015 | CLANG_WARN_ENUM_CONVERSION = YES; 2016 | CLANG_WARN_INFINITE_RECURSION = YES; 2017 | CLANG_WARN_INT_CONVERSION = YES; 2018 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 2019 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 2020 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 2021 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 2022 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 2023 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 2024 | CLANG_WARN_STRICT_PROTOTYPES = YES; 2025 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 2026 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 2027 | CLANG_WARN_UNREACHABLE_CODE = YES; 2028 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 2029 | CODE_SIGN_IDENTITY = "Apple Development"; 2030 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; 2031 | CODE_SIGN_STYLE = Manual; 2032 | COMBINE_HIDPI_IMAGES = YES; 2033 | COPY_PHASE_STRIP = NO; 2034 | CURRENT_PROJECT_VERSION = 1; 2035 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 2036 | DEFINES_MODULE = YES; 2037 | DEVELOPMENT_TEAM = ""; 2038 | "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; 2039 | DYLIB_COMPATIBILITY_VERSION = 1; 2040 | DYLIB_CURRENT_VERSION = 1; 2041 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 2042 | ENABLE_MODULE_VERIFIER = YES; 2043 | ENABLE_NS_ASSERTIONS = NO; 2044 | ENABLE_STRICT_OBJC_MSGSEND = YES; 2045 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 2046 | GCC_C_LANGUAGE_STANDARD = gnu17; 2047 | GCC_NO_COMMON_BLOCKS = YES; 2048 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 2049 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 2050 | GCC_WARN_UNDECLARED_SELECTOR = YES; 2051 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 2052 | GCC_WARN_UNUSED_FUNCTION = YES; 2053 | GCC_WARN_UNUSED_VARIABLE = YES; 2054 | GENERATE_INFOPLIST_FILE = YES; 2055 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 2056 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 2057 | LD_RUNPATH_SEARCH_PATHS = ( 2058 | "$(inherited)", 2059 | "@executable_path/../Frameworks", 2060 | "@loader_path/Frameworks", 2061 | ); 2062 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 2063 | MACOSX_DEPLOYMENT_TARGET = 14.0; 2064 | MARKETING_VERSION = 1.0; 2065 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 2066 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; 2067 | MTL_ENABLE_DEBUG_INFO = NO; 2068 | MTL_FAST_MATH = YES; 2069 | PRODUCT_BUNDLE_IDENTIFIER = mlx.SentencePiece; 2070 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 2071 | PROVISIONING_PROFILE_SPECIFIER = ""; 2072 | SDKROOT = macosx; 2073 | SKIP_INSTALL = YES; 2074 | SWIFT_COMPILATION_MODE = wholemodule; 2075 | SWIFT_EMIT_LOC_STRINGS = YES; 2076 | SWIFT_VERSION = 5.0; 2077 | VERSIONING_SYSTEM = "apple-generic"; 2078 | VERSION_INFO_PREFIX = ""; 2079 | }; 2080 | name = Release; 2081 | }; 2082 | C39273DA2B607A9C00368D5D /* Debug */ = { 2083 | isa = XCBuildConfiguration; 2084 | buildSettings = { 2085 | ALWAYS_SEARCH_USER_PATHS = NO; 2086 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 2087 | CLANG_ANALYZER_NONNULL = YES; 2088 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 2089 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 2090 | CLANG_ENABLE_MODULES = YES; 2091 | CLANG_ENABLE_OBJC_ARC = YES; 2092 | CLANG_ENABLE_OBJC_WEAK = YES; 2093 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 2094 | CLANG_WARN_BOOL_CONVERSION = YES; 2095 | CLANG_WARN_COMMA = YES; 2096 | CLANG_WARN_CONSTANT_CONVERSION = YES; 2097 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 2098 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 2099 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 2100 | CLANG_WARN_EMPTY_BODY = YES; 2101 | CLANG_WARN_ENUM_CONVERSION = YES; 2102 | CLANG_WARN_INFINITE_RECURSION = YES; 2103 | CLANG_WARN_INT_CONVERSION = YES; 2104 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 2105 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 2106 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 2107 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 2108 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 2109 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 2110 | CLANG_WARN_STRICT_PROTOTYPES = YES; 2111 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 2112 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 2113 | CLANG_WARN_UNREACHABLE_CODE = YES; 2114 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 2115 | CODE_SIGN_IDENTITY = "Apple Development"; 2116 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; 2117 | CODE_SIGN_STYLE = Manual; 2118 | COMBINE_HIDPI_IMAGES = YES; 2119 | COPY_PHASE_STRIP = NO; 2120 | CURRENT_PROJECT_VERSION = 1; 2121 | DEBUG_INFORMATION_FORMAT = dwarf; 2122 | DEFINES_MODULE = YES; 2123 | DEVELOPMENT_TEAM = ""; 2124 | "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; 2125 | DYLIB_COMPATIBILITY_VERSION = 1; 2126 | DYLIB_CURRENT_VERSION = 1; 2127 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 2128 | ENABLE_MODULE_VERIFIER = YES; 2129 | ENABLE_STRICT_OBJC_MSGSEND = YES; 2130 | ENABLE_TESTABILITY = YES; 2131 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 2132 | GCC_C_LANGUAGE_STANDARD = gnu17; 2133 | GCC_DYNAMIC_NO_PIC = NO; 2134 | GCC_NO_COMMON_BLOCKS = YES; 2135 | GCC_OPTIMIZATION_LEVEL = 0; 2136 | GCC_PREPROCESSOR_DEFINITIONS = ( 2137 | "DEBUG=1", 2138 | "$(inherited)", 2139 | ); 2140 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 2141 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 2142 | GCC_WARN_UNDECLARED_SELECTOR = YES; 2143 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 2144 | GCC_WARN_UNUSED_FUNCTION = YES; 2145 | GCC_WARN_UNUSED_VARIABLE = YES; 2146 | GENERATE_INFOPLIST_FILE = YES; 2147 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 2148 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 2149 | LD_RUNPATH_SEARCH_PATHS = ( 2150 | "$(inherited)", 2151 | "@executable_path/../Frameworks", 2152 | "@loader_path/Frameworks", 2153 | ); 2154 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 2155 | MACOSX_DEPLOYMENT_TARGET = 14.0; 2156 | MARKETING_VERSION = 1.0; 2157 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 2158 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; 2159 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 2160 | MTL_FAST_MATH = YES; 2161 | PRODUCT_BUNDLE_IDENTIFIER = mlx.Llama; 2162 | PRODUCT_NAME = Llama; 2163 | PROVISIONING_PROFILE_SPECIFIER = ""; 2164 | SDKROOT = macosx; 2165 | SKIP_INSTALL = YES; 2166 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 2167 | SWIFT_EMIT_LOC_STRINGS = YES; 2168 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 2169 | SWIFT_VERSION = 5.0; 2170 | VERSIONING_SYSTEM = "apple-generic"; 2171 | VERSION_INFO_PREFIX = ""; 2172 | }; 2173 | name = Debug; 2174 | }; 2175 | C39273DB2B607A9C00368D5D /* Release */ = { 2176 | isa = XCBuildConfiguration; 2177 | buildSettings = { 2178 | ALWAYS_SEARCH_USER_PATHS = NO; 2179 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 2180 | CLANG_ANALYZER_NONNULL = YES; 2181 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 2182 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 2183 | CLANG_ENABLE_MODULES = YES; 2184 | CLANG_ENABLE_OBJC_ARC = YES; 2185 | CLANG_ENABLE_OBJC_WEAK = YES; 2186 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 2187 | CLANG_WARN_BOOL_CONVERSION = YES; 2188 | CLANG_WARN_COMMA = YES; 2189 | CLANG_WARN_CONSTANT_CONVERSION = YES; 2190 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 2191 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 2192 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 2193 | CLANG_WARN_EMPTY_BODY = YES; 2194 | CLANG_WARN_ENUM_CONVERSION = YES; 2195 | CLANG_WARN_INFINITE_RECURSION = YES; 2196 | CLANG_WARN_INT_CONVERSION = YES; 2197 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 2198 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 2199 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 2200 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 2201 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 2202 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 2203 | CLANG_WARN_STRICT_PROTOTYPES = YES; 2204 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 2205 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 2206 | CLANG_WARN_UNREACHABLE_CODE = YES; 2207 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 2208 | CODE_SIGN_IDENTITY = "Apple Development"; 2209 | "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; 2210 | CODE_SIGN_STYLE = Manual; 2211 | COMBINE_HIDPI_IMAGES = YES; 2212 | COPY_PHASE_STRIP = NO; 2213 | CURRENT_PROJECT_VERSION = 1; 2214 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 2215 | DEFINES_MODULE = YES; 2216 | DEVELOPMENT_TEAM = ""; 2217 | "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; 2218 | DYLIB_COMPATIBILITY_VERSION = 1; 2219 | DYLIB_CURRENT_VERSION = 1; 2220 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 2221 | ENABLE_MODULE_VERIFIER = YES; 2222 | ENABLE_NS_ASSERTIONS = NO; 2223 | ENABLE_STRICT_OBJC_MSGSEND = YES; 2224 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 2225 | GCC_C_LANGUAGE_STANDARD = gnu17; 2226 | GCC_NO_COMMON_BLOCKS = YES; 2227 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 2228 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 2229 | GCC_WARN_UNDECLARED_SELECTOR = YES; 2230 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 2231 | GCC_WARN_UNUSED_FUNCTION = YES; 2232 | GCC_WARN_UNUSED_VARIABLE = YES; 2233 | GENERATE_INFOPLIST_FILE = YES; 2234 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 2235 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 2236 | LD_RUNPATH_SEARCH_PATHS = ( 2237 | "$(inherited)", 2238 | "@executable_path/../Frameworks", 2239 | "@loader_path/Frameworks", 2240 | ); 2241 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 2242 | MACOSX_DEPLOYMENT_TARGET = 14.0; 2243 | MARKETING_VERSION = 1.0; 2244 | MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; 2245 | MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; 2246 | MTL_ENABLE_DEBUG_INFO = NO; 2247 | MTL_FAST_MATH = YES; 2248 | PRODUCT_BUNDLE_IDENTIFIER = mlx.Llama; 2249 | PRODUCT_NAME = Llama; 2250 | PROVISIONING_PROFILE_SPECIFIER = ""; 2251 | SDKROOT = macosx; 2252 | SKIP_INSTALL = YES; 2253 | SWIFT_COMPILATION_MODE = wholemodule; 2254 | SWIFT_EMIT_LOC_STRINGS = YES; 2255 | SWIFT_VERSION = 5.0; 2256 | VERSIONING_SYSTEM = "apple-generic"; 2257 | VERSION_INFO_PREFIX = ""; 2258 | }; 2259 | name = Release; 2260 | }; 2261 | C397C5902B62C6A9004B084D /* Debug */ = { 2262 | isa = XCBuildConfiguration; 2263 | buildSettings = { 2264 | ALWAYS_SEARCH_USER_PATHS = NO; 2265 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 2266 | CLANG_ANALYZER_NONNULL = YES; 2267 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 2268 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 2269 | CLANG_ENABLE_MODULES = YES; 2270 | CLANG_ENABLE_OBJC_ARC = YES; 2271 | CLANG_ENABLE_OBJC_WEAK = YES; 2272 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 2273 | CLANG_WARN_BOOL_CONVERSION = YES; 2274 | CLANG_WARN_COMMA = YES; 2275 | CLANG_WARN_CONSTANT_CONVERSION = YES; 2276 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 2277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 2278 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 2279 | CLANG_WARN_EMPTY_BODY = YES; 2280 | CLANG_WARN_ENUM_CONVERSION = YES; 2281 | CLANG_WARN_INFINITE_RECURSION = YES; 2282 | CLANG_WARN_INT_CONVERSION = YES; 2283 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 2284 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 2285 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 2286 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 2287 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 2288 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 2289 | CLANG_WARN_STRICT_PROTOTYPES = YES; 2290 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 2291 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 2292 | CLANG_WARN_UNREACHABLE_CODE = YES; 2293 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 2294 | CODE_SIGN_STYLE = Automatic; 2295 | COPY_PHASE_STRIP = NO; 2296 | DEBUG_INFORMATION_FORMAT = dwarf; 2297 | ENABLE_STRICT_OBJC_MSGSEND = YES; 2298 | ENABLE_TESTABILITY = YES; 2299 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 2300 | GCC_C_LANGUAGE_STANDARD = gnu17; 2301 | GCC_DYNAMIC_NO_PIC = NO; 2302 | GCC_NO_COMMON_BLOCKS = YES; 2303 | GCC_OPTIMIZATION_LEVEL = 0; 2304 | GCC_PREPROCESSOR_DEFINITIONS = ( 2305 | "DEBUG=1", 2306 | "$(inherited)", 2307 | ); 2308 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 2309 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 2310 | GCC_WARN_UNDECLARED_SELECTOR = YES; 2311 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 2312 | GCC_WARN_UNUSED_FUNCTION = YES; 2313 | GCC_WARN_UNUSED_VARIABLE = YES; 2314 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 2315 | MACOSX_DEPLOYMENT_TARGET = 14.0; 2316 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 2317 | MTL_FAST_MATH = YES; 2318 | PRODUCT_NAME = "$(TARGET_NAME)"; 2319 | SDKROOT = macosx; 2320 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 2321 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 2322 | SWIFT_VERSION = 5.0; 2323 | }; 2324 | name = Debug; 2325 | }; 2326 | C397C5912B62C6A9004B084D /* Release */ = { 2327 | isa = XCBuildConfiguration; 2328 | buildSettings = { 2329 | ALWAYS_SEARCH_USER_PATHS = NO; 2330 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 2331 | CLANG_ANALYZER_NONNULL = YES; 2332 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 2333 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 2334 | CLANG_ENABLE_MODULES = YES; 2335 | CLANG_ENABLE_OBJC_ARC = YES; 2336 | CLANG_ENABLE_OBJC_WEAK = YES; 2337 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 2338 | CLANG_WARN_BOOL_CONVERSION = YES; 2339 | CLANG_WARN_COMMA = YES; 2340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 2341 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 2342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 2343 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 2344 | CLANG_WARN_EMPTY_BODY = YES; 2345 | CLANG_WARN_ENUM_CONVERSION = YES; 2346 | CLANG_WARN_INFINITE_RECURSION = YES; 2347 | CLANG_WARN_INT_CONVERSION = YES; 2348 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 2349 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 2350 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 2351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 2352 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 2353 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 2354 | CLANG_WARN_STRICT_PROTOTYPES = YES; 2355 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 2356 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 2357 | CLANG_WARN_UNREACHABLE_CODE = YES; 2358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 2359 | CODE_SIGN_STYLE = Automatic; 2360 | COPY_PHASE_STRIP = NO; 2361 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 2362 | ENABLE_NS_ASSERTIONS = NO; 2363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 2364 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 2365 | GCC_C_LANGUAGE_STANDARD = gnu17; 2366 | GCC_NO_COMMON_BLOCKS = YES; 2367 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 2368 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 2369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 2370 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 2371 | GCC_WARN_UNUSED_FUNCTION = YES; 2372 | GCC_WARN_UNUSED_VARIABLE = YES; 2373 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 2374 | MACOSX_DEPLOYMENT_TARGET = 14.0; 2375 | MTL_ENABLE_DEBUG_INFO = NO; 2376 | MTL_FAST_MATH = YES; 2377 | PRODUCT_NAME = "$(TARGET_NAME)"; 2378 | SDKROOT = macosx; 2379 | SWIFT_COMPILATION_MODE = wholemodule; 2380 | SWIFT_VERSION = 5.0; 2381 | }; 2382 | name = Release; 2383 | }; 2384 | /* End XCBuildConfiguration section */ 2385 | 2386 | /* Begin XCConfigurationList section */ 2387 | 8BD9A10E2B863E9D00BB7769 /* Build configuration list for PBXNativeTarget "MLXChat" */ = { 2388 | isa = XCConfigurationList; 2389 | buildConfigurations = ( 2390 | 8BD9A10C2B863E9D00BB7769 /* Debug */, 2391 | 8BD9A10D2B863E9D00BB7769 /* Release */, 2392 | ); 2393 | defaultConfigurationIsVisible = 0; 2394 | defaultConfigurationName = Release; 2395 | }; 2396 | 8BD9A1322B8760FA00BB7769 /* Build configuration list for PBXNativeTarget "MLXChatXPCService" */ = { 2397 | isa = XCConfigurationList; 2398 | buildConfigurations = ( 2399 | 8BD9A1332B8760FA00BB7769 /* Debug */, 2400 | 8BD9A1342B8760FA00BB7769 /* Release */, 2401 | ); 2402 | defaultConfigurationIsVisible = 0; 2403 | defaultConfigurationName = Release; 2404 | }; 2405 | C3288D792B6D9313009FF608 /* Build configuration list for PBXNativeTarget "LinearModelTraining" */ = { 2406 | isa = XCConfigurationList; 2407 | buildConfigurations = ( 2408 | C3288D772B6D9313009FF608 /* Debug */, 2409 | C3288D782B6D9313009FF608 /* Release */, 2410 | ); 2411 | defaultConfigurationIsVisible = 0; 2412 | defaultConfigurationName = Release; 2413 | }; 2414 | C34E49112B69A92900FCB841 /* Build configuration list for PBXNativeTarget "MNIST" */ = { 2415 | isa = XCConfigurationList; 2416 | buildConfigurations = ( 2417 | C34E49122B69A92900FCB841 /* Debug */, 2418 | C34E49132B69A92900FCB841 /* Release */, 2419 | ); 2420 | defaultConfigurationIsVisible = 0; 2421 | defaultConfigurationName = Release; 2422 | }; 2423 | C34E49252B6A026F00FCB841 /* Build configuration list for PBXNativeTarget "mnist-tool" */ = { 2424 | isa = XCConfigurationList; 2425 | buildConfigurations = ( 2426 | C34E49262B6A026F00FCB841 /* Debug */, 2427 | C34E49272B6A026F00FCB841 /* Release */, 2428 | ); 2429 | defaultConfigurationIsVisible = 0; 2430 | defaultConfigurationName = Release; 2431 | }; 2432 | C392736B2B60697700368D5D /* Build configuration list for PBXProject "mlx-examples-swift" */ = { 2433 | isa = XCConfigurationList; 2434 | buildConfigurations = ( 2435 | C392736C2B60697700368D5D /* Debug */, 2436 | C392736D2B60697700368D5D /* Release */, 2437 | ); 2438 | defaultConfigurationIsVisible = 0; 2439 | defaultConfigurationName = Release; 2440 | }; 2441 | C39273792B606A0A00368D5D /* Build configuration list for PBXNativeTarget "Tutorial" */ = { 2442 | isa = XCConfigurationList; 2443 | buildConfigurations = ( 2444 | C392737A2B606A0A00368D5D /* Debug */, 2445 | C392737B2B606A0A00368D5D /* Release */, 2446 | ); 2447 | defaultConfigurationIsVisible = 0; 2448 | defaultConfigurationName = Release; 2449 | }; 2450 | C392738C2B606AB800368D5D /* Build configuration list for PBXNativeTarget "SentencePiece" */ = { 2451 | isa = XCConfigurationList; 2452 | buildConfigurations = ( 2453 | C392738D2B606AB800368D5D /* Debug */, 2454 | C392738E2B606AB800368D5D /* Release */, 2455 | ); 2456 | defaultConfigurationIsVisible = 0; 2457 | defaultConfigurationName = Release; 2458 | }; 2459 | C39273D92B607A9C00368D5D /* Build configuration list for PBXNativeTarget "Llama" */ = { 2460 | isa = XCConfigurationList; 2461 | buildConfigurations = ( 2462 | C39273DA2B607A9C00368D5D /* Debug */, 2463 | C39273DB2B607A9C00368D5D /* Release */, 2464 | ); 2465 | defaultConfigurationIsVisible = 0; 2466 | defaultConfigurationName = Release; 2467 | }; 2468 | C397C58F2B62C6A9004B084D /* Build configuration list for PBXNativeTarget "llm-tool" */ = { 2469 | isa = XCConfigurationList; 2470 | buildConfigurations = ( 2471 | C397C5902B62C6A9004B084D /* Debug */, 2472 | C397C5912B62C6A9004B084D /* Release */, 2473 | ); 2474 | defaultConfigurationIsVisible = 0; 2475 | defaultConfigurationName = Release; 2476 | }; 2477 | /* End XCConfigurationList section */ 2478 | 2479 | /* Begin XCRemoteSwiftPackageReference section */ 2480 | C34E491A2B69C43600FCB841 /* XCRemoteSwiftPackageReference "GzipSwift" */ = { 2481 | isa = XCRemoteSwiftPackageReference; 2482 | repositoryURL = "https://github.com/1024jp/GzipSwift"; 2483 | requirement = { 2484 | kind = upToNextMajorVersion; 2485 | minimumVersion = 6.0.1; 2486 | }; 2487 | }; 2488 | C382DE882B630889000F8F03 /* XCRemoteSwiftPackageReference "swift-async-algorithms" */ = { 2489 | isa = XCRemoteSwiftPackageReference; 2490 | repositoryURL = "https://github.com/apple/swift-async-algorithms"; 2491 | requirement = { 2492 | kind = upToNextMajorVersion; 2493 | minimumVersion = 1.0.0; 2494 | }; 2495 | }; 2496 | C392736E2B60699100368D5D /* XCRemoteSwiftPackageReference "swift-argument-parser" */ = { 2497 | isa = XCRemoteSwiftPackageReference; 2498 | repositoryURL = "https://github.com/apple/swift-argument-parser.git"; 2499 | requirement = { 2500 | kind = upToNextMajorVersion; 2501 | minimumVersion = 1.3.0; 2502 | }; 2503 | }; 2504 | C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */ = { 2505 | isa = XCRemoteSwiftPackageReference; 2506 | repositoryURL = "https://github.com/ml-explore/mlx-swift"; 2507 | requirement = { 2508 | branch = main; 2509 | kind = branch; 2510 | }; 2511 | }; 2512 | /* End XCRemoteSwiftPackageReference section */ 2513 | 2514 | /* Begin XCSwiftPackageProductDependency section */ 2515 | 8BD9A1362B8761C700BB7769 /* AsyncAlgorithms */ = { 2516 | isa = XCSwiftPackageProductDependency; 2517 | package = C382DE882B630889000F8F03 /* XCRemoteSwiftPackageReference "swift-async-algorithms" */; 2518 | productName = AsyncAlgorithms; 2519 | }; 2520 | C3288D7A2B6D9339009FF608 /* ArgumentParser */ = { 2521 | isa = XCSwiftPackageProductDependency; 2522 | package = C392736E2B60699100368D5D /* XCRemoteSwiftPackageReference "swift-argument-parser" */; 2523 | productName = ArgumentParser; 2524 | }; 2525 | C34E491B2B69C43600FCB841 /* Gzip */ = { 2526 | isa = XCSwiftPackageProductDependency; 2527 | package = C34E491A2B69C43600FCB841 /* XCRemoteSwiftPackageReference "GzipSwift" */; 2528 | productName = Gzip; 2529 | }; 2530 | C34E49282B6A028100FCB841 /* ArgumentParser */ = { 2531 | isa = XCSwiftPackageProductDependency; 2532 | package = C392736E2B60699100368D5D /* XCRemoteSwiftPackageReference "swift-argument-parser" */; 2533 | productName = ArgumentParser; 2534 | }; 2535 | C382DE892B630889000F8F03 /* AsyncAlgorithms */ = { 2536 | isa = XCSwiftPackageProductDependency; 2537 | package = C382DE882B630889000F8F03 /* XCRemoteSwiftPackageReference "swift-async-algorithms" */; 2538 | productName = AsyncAlgorithms; 2539 | }; 2540 | C382DE8B2B64138D000F8F03 /* AsyncAlgorithms */ = { 2541 | isa = XCSwiftPackageProductDependency; 2542 | package = C382DE882B630889000F8F03 /* XCRemoteSwiftPackageReference "swift-async-algorithms" */; 2543 | productName = AsyncAlgorithms; 2544 | }; 2545 | C397C59B2B62C6D0004B084D /* ArgumentParser */ = { 2546 | isa = XCSwiftPackageProductDependency; 2547 | package = C392736E2B60699100368D5D /* XCRemoteSwiftPackageReference "swift-argument-parser" */; 2548 | productName = ArgumentParser; 2549 | }; 2550 | C3FBCB202B8520B80007E490 /* MLX */ = { 2551 | isa = XCSwiftPackageProductDependency; 2552 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2553 | productName = MLX; 2554 | }; 2555 | C3FBCB222B8520C80007E490 /* MLX */ = { 2556 | isa = XCSwiftPackageProductDependency; 2557 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2558 | productName = MLX; 2559 | }; 2560 | C3FBCB242B8520C80007E490 /* MLXNN */ = { 2561 | isa = XCSwiftPackageProductDependency; 2562 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2563 | productName = MLXNN; 2564 | }; 2565 | C3FBCB262B8520C80007E490 /* MLXRandom */ = { 2566 | isa = XCSwiftPackageProductDependency; 2567 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2568 | productName = MLXRandom; 2569 | }; 2570 | C3FBCB282B8520DA0007E490 /* MLX */ = { 2571 | isa = XCSwiftPackageProductDependency; 2572 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2573 | productName = MLX; 2574 | }; 2575 | C3FBCB2A2B8520DA0007E490 /* MLXNN */ = { 2576 | isa = XCSwiftPackageProductDependency; 2577 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2578 | productName = MLXNN; 2579 | }; 2580 | C3FBCB2C2B8520E80007E490 /* MLXOptimizers */ = { 2581 | isa = XCSwiftPackageProductDependency; 2582 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2583 | productName = MLXOptimizers; 2584 | }; 2585 | C3FBCB2E2B8520F20007E490 /* MLX */ = { 2586 | isa = XCSwiftPackageProductDependency; 2587 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2588 | productName = MLX; 2589 | }; 2590 | C3FBCB302B8520F20007E490 /* MLXNN */ = { 2591 | isa = XCSwiftPackageProductDependency; 2592 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2593 | productName = MLXNN; 2594 | }; 2595 | C3FBCB322B8520F20007E490 /* MLXOptimizers */ = { 2596 | isa = XCSwiftPackageProductDependency; 2597 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2598 | productName = MLXOptimizers; 2599 | }; 2600 | C3FBCB342B8520F20007E490 /* MLXRandom */ = { 2601 | isa = XCSwiftPackageProductDependency; 2602 | package = C3FBCB1F2B8520B00007E490 /* XCRemoteSwiftPackageReference "mlx-swift" */; 2603 | productName = MLXRandom; 2604 | }; 2605 | /* End XCSwiftPackageProductDependency section */ 2606 | }; 2607 | rootObject = C39273682B60697700368D5D /* Project object */; 2608 | } 2609 | --------------------------------------------------------------------------------