diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9c1f7e76..23d0529e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -95,7 +95,7 @@ jobs: xcrun --show-sdk-build-version swift --version rm -rf ~/Library/Developer/Xcode/DerivedData/* - xcodebuild build-for-testing -scheme mlx-libraries-Package -destination 'platform=macOS' + xcodebuild build-for-testing -scheme mlx-libraries-Package -destination 'platform=macOS' -skipMacroValidation - name: Build tools (Xcode, macOS) shell: sh @@ -107,6 +107,7 @@ jobs: xcrun --show-sdk-build-version swift --version find . -name Package.resolved -exec rm {} \; - xcodebuild -scheme llm-tool - xcodebuild -scheme image-tool - xcodebuild -scheme mnist-tool + xcodebuild -scheme llm-tool -skipMacroValidation + xcodebuild -scheme embedder-tool -skipMacroValidation + xcodebuild -scheme image-tool -skipMacroValidation + xcodebuild -scheme mnist-tool -skipMacroValidation diff --git a/Applications/LLMBasic/ChatModel.swift b/Applications/LLMBasic/ChatModel.swift index f657f824..5909e4d9 100644 --- a/Applications/LLMBasic/ChatModel.swift +++ b/Applications/LLMBasic/ChatModel.swift @@ -1,8 +1,11 @@ // Copyright © 2025 Apple Inc. +import HuggingFace +import MLXHuggingFace import MLXLLM import MLXLMCommon import SwiftUI +import Tokenizers /// which model to load private let modelConfiguration = LLMRegistry.gemma3_1B_qat_4bit @@ -40,7 +43,11 @@ private let generateParameters = GenerateParameters(temperature: 0.5) case .idle: let task = Task { // download and report progress - try await loadModelContainer(configuration: modelConfiguration) { value in + try await LLMModelFactory.shared.loadContainer( + from: #hubDownloader(), + using: #huggingFaceTokenizerLoader(), + configuration: modelConfiguration + ) { value in Task { @MainActor in self.progress = value.fractionCompleted } diff --git a/Applications/LLMEval/ViewModels/LLMEvaluator.swift b/Applications/LLMEval/ViewModels/LLMEvaluator.swift index ab4dcf77..2aacbd28 100644 --- a/Applications/LLMEval/ViewModels/LLMEvaluator.swift +++ b/Applications/LLMEval/ViewModels/LLMEvaluator.swift @@ -1,11 +1,14 @@ // Copyright © 2025 Apple Inc. import Hub +import HuggingFace import MLX +import MLXHuggingFace import MLXLLM import MLXLMCommon import Metal import SwiftUI +import Tokenizers @Observable @MainActor @@ -101,14 +104,11 @@ class LLMEvaluator { Memory.cacheLimit = 20 * 1024 * 1024 - let hub = HubApi( - downloadBase: FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first - ) - do { - let modelDirectory = try await downloadModel( - hub: hub, - configuration: modelConfiguration + let downloader = #hubDownloader() + + let resolved = try await resolve( + configuration: modelConfiguration, from: downloader, useLatest: false ) { [weak self] progress in Task { @MainActor in self?.updateDownloadProgress(progress) @@ -117,8 +117,9 @@ class LLMEvaluator { // Verify the download succeeded by checking for model files let fileManager = FileManager.default - let directoryExists = fileManager.fileExists(atPath: modelDirectory.path) - let contents = (try? fileManager.contentsOfDirectory(atPath: modelDirectory.path)) ?? [] + let directoryExists = fileManager.fileExists(atPath: resolved.modelDirectory.path) + let contents = + (try? fileManager.contentsOfDirectory(atPath: resolved.modelDirectory.path)) ?? [] let hasSafetensors = contents.contains { $0.hasSuffix(".safetensors") } if !directoryExists || !hasSafetensors { @@ -137,9 +138,8 @@ class LLMEvaluator { totalSize = nil let modelContainer = try await LLMModelFactory.shared.loadContainer( - hub: hub, - configuration: modelConfiguration - ) { _ in } + from: resolved.modelDirectory, + using: #huggingFaceTokenizerLoader()) let numParams = await modelContainer.perform { $0.model.numParameters() } diff --git a/Applications/LoRATrainingExample/ContentView.swift b/Applications/LoRATrainingExample/ContentView.swift index 97fdfe30..383d1859 100644 --- a/Applications/LoRATrainingExample/ContentView.swift +++ b/Applications/LoRATrainingExample/ContentView.swift @@ -1,6 +1,8 @@ // Copyright © 2024 Apple Inc. +import HuggingFace import MLX +import MLXHuggingFace import MLXLLM import MLXLMCommon import MLXNN @@ -141,7 +143,12 @@ class LoRAEvaluator { progress = .init(title: "Loading \(name)", current: 0, limit: 1) } + let downloader = #hubDownloader() + let loader = #huggingFaceTokenizerLoader() + let modelContainer = try await LLMModelFactory.shared.loadContainer( + from: downloader, + using: loader, configuration: modelConfiguration ) { progress in @@ -186,7 +193,7 @@ class LoRAEvaluator { let modelContainer = try await loadModel() // apply LoRA adapters and train - let modelAdapter = try await modelContainer.perform { context in + let _ = try await modelContainer.perform { context in try LoRAContainer.from( model: context.model, configuration: LoRAConfiguration(numLayers: loraLayers) @@ -263,22 +270,28 @@ class LoRAEvaluator { let modelContainer = try await loadModel() // evaluate - let result = try await modelContainer.perform { context in - let input = try await context.processor.prepare(input: .init(prompt: prompt)) - return try MLXLMCommon.generate( - input: input, parameters: generateParameters, context: context - ) { tokens in - if tokens.count % evaluateShowEvery == 0 { - let fullOutput = context.tokenizer.decode(tokens: tokens) - Task { @MainActor in - self.output = fullOutput - } + let input = try await modelContainer.processor.prepare(input: .init(prompt: prompt)) + + var count = 0 + var output = "" + for try await item in try await modelContainer.generate( + input: input, parameters: generateParameters + ) { + switch item { + case .chunk(let string): + count += 1 + output += string + + if count % evaluateShowEvery == 0 { + self.output = output } - return tokens.count >= maxTokens ? .stop : .more + + default: + break } } - self.output = result.output + self.output = output self.progress = nil } } diff --git a/Applications/MLXChatExample/Services/MLXService.swift b/Applications/MLXChatExample/Services/MLXService.swift index ac3db813..b73f7b81 100644 --- a/Applications/MLXChatExample/Services/MLXService.swift +++ b/Applications/MLXChatExample/Services/MLXService.swift @@ -6,10 +6,13 @@ // import Foundation +import HuggingFace import MLX +import MLXHuggingFace import MLXLLM import MLXLMCommon import MLXVLM +import Tokenizers /// A service class that manages machine learning models for text and vision-language tasks. /// This class handles model loading, caching, and text generation using various LLM and VLM models. @@ -63,9 +66,14 @@ class MLXService { VLMModelFactory.shared } + let downloader = #hubDownloader() + let loader = #huggingFaceTokenizerLoader() + // Load model and track download progress let container = try await factory.loadContainer( - hub: .default, configuration: model.configuration + from: downloader, + using: loader, + configuration: model.configuration ) { progress in Task { @MainActor in self.modelDownloadProgress = progress diff --git a/Package.resolved b/Package.resolved index 89fbe4dd..30b3e81a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,14 @@ { "pins" : [ + { + "identity" : "eventsource", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattt/EventSource.git", + "state" : { + "revision" : "a3a85a85214caf642abaa96ae664e4c772a59f6e", + "version" : "1.4.1" + } + }, { "identity" : "gzipswift", "kind" : "remoteSourceControl", @@ -14,8 +23,26 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ml-explore/mlx-swift", "state" : { - "revision" : "072b684acaae80b6a463abab3a103732f33774bf", - "version" : "0.29.1" + "revision" : "61b9e011e09a62b489f6bd647958f1555bdf2896", + "version" : "0.31.3" + } + }, + { + "identity" : "swift-asn1", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-asn1.git", + "state" : { + "revision" : "9f542610331815e29cc3821d3b6f488db8715517", + "version" : "1.6.0" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "b601256eab081c0f92f059e12818ac1d4f178ff7", + "version" : "1.3.0" } }, { @@ -27,6 +54,24 @@ "version" : "1.2.0" } }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "bb4ba815dab96d4edc1e0b86d7b9acf9ff973a84", + "version" : "4.3.1" + } + }, + { + "identity" : "swift-huggingface", + "kind" : "remoteSourceControl", + "location" : "https://github.com/huggingface/swift-huggingface.git", + "state" : { + "revision" : "b721959445b617d0bf03910b2b4aced345fd93bf", + "version" : "0.9.0" + } + }, { "identity" : "swift-jinja", "kind" : "remoteSourceControl", @@ -36,6 +81,15 @@ "version" : "2.1.0" } }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "558f24a4647193b5a0e2104031b71c55d31ff83a", + "version" : "2.97.1" + } + }, { "identity" : "swift-numerics", "kind" : "remoteSourceControl", @@ -45,13 +99,31 @@ "version" : "1.0.2" } }, + { + "identity" : "swift-system", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-system.git", + "state" : { + "revision" : "7c6ad0fc39d0763e0b699210e4124afd5041c5df", + "version" : "1.6.4" + } + }, { "identity" : "swift-transformers", "kind" : "remoteSourceControl", "location" : "https://github.com/huggingface/swift-transformers", "state" : { - "revision" : "94610577e4af9bbc267060af1e25e977604dd796", - "version" : "1.1.1" + "revision" : "b38443e44d93eca770f2eb68e2a4d0fa100f9aa2", + "version" : "1.3.0" + } + }, + { + "identity" : "yyjson", + "kind" : "remoteSourceControl", + "location" : "https://github.com/ibireme/yyjson.git", + "state" : { + "revision" : "8b4a38dc994a110abaec8a400615567bd996105f", + "version" : "0.12.0" } } ], diff --git a/Package.swift b/Package.swift index 7567ba68..1208ae3b 100644 --- a/Package.swift +++ b/Package.swift @@ -15,10 +15,12 @@ let package = Package( targets: ["StableDiffusion"]), ], dependencies: [ - .package(url: "https://github.com/ml-explore/mlx-swift", .upToNextMinor(from: "0.30.3")), + .package(url: "https://github.com/ml-explore/mlx-swift", .upToNextMinor(from: "0.31.3")), + + // Note: used by StableDiffusion library to download weights .package( url: "https://github.com/huggingface/swift-transformers", - .upToNextMinor(from: "1.1.0") + .upToNextMajor(from: "1.3.0") ), .package(url: "https://github.com/1024jp/GzipSwift", "6.0.1" ... "6.0.1"), // Only needed by MLXMNIST ], diff --git a/Tools/embedder-tool/EmbedderRuntime+Embedding.swift b/Tools/embedder-tool/EmbedderRuntime+Embedding.swift index 1a506b88..4c98fcaa 100644 --- a/Tools/embedder-tool/EmbedderRuntime+Embedding.swift +++ b/Tools/embedder-tool/EmbedderRuntime+Embedding.swift @@ -1,7 +1,7 @@ import Foundation import MLX import MLXEmbedders -import Tokenizers +import MLXLMCommon public struct RuntimeEmbeddingResult { public let embeddings: [(index: Int, vector: [Float])] @@ -26,9 +26,10 @@ extension EmbedderRuntime { embeddings: [], skippedIndices: [], fallbackDescription: nil) } - return try await container.perform { model, tokenizer, pooler in + return try await container.perform { context in var skippedIndices: [Int] = [] + let tokenizer = context.tokenizer let encoded = texts.enumerated().compactMap { index, text -> (Int, [Int])? in let tokens = tokenizer.encode(text: text, addSpecialTokens: true) guard !tokens.isEmpty else { @@ -58,14 +59,14 @@ extension EmbedderRuntime { let mask = (padded .!= padToken) let tokenTypes = MLXArray.zeros(like: padded) - let outputs = model( + let outputs = context.model( padded, positionIds: nil, tokenTypeIds: tokenTypes, attentionMask: mask ) - let poolingModule = resolvedPooler(for: pooler) + let poolingModule = resolvedPooler(for: context.pooling) let pooled = poolingModule( outputs, mask: mask, diff --git a/Tools/embedder-tool/EmbedderTool.swift b/Tools/embedder-tool/EmbedderTool.swift index 0efdecda..d6c85d64 100644 --- a/Tools/embedder-tool/EmbedderTool.swift +++ b/Tools/embedder-tool/EmbedderTool.swift @@ -5,6 +5,7 @@ import ArgumentParser import Foundation import MLX import MLXEmbedders +import MLXLMCommon import Tokenizers @main @@ -17,7 +18,7 @@ struct EmbedderTool: AsyncParsableCommand { ] ) - private static let defaultModelConfiguration = ModelConfiguration.nomic_text_v1_5 + private static let defaultModelConfiguration = EmbedderRegistry.nomic_text_v1_5 @OptionGroup var model: ModelArguments @OptionGroup var corpus: CorpusArguments @@ -42,9 +43,8 @@ struct EmbedderTool: AsyncParsableCommand { -> EmbedderRuntime { let loadedModel = try await model.load(default: defaultModelConfiguration) - let baseStrategy = await loadedModel.container.perform { _, _, pooler in - pooler.strategy - } + let baseStrategy = await loadedModel.container.poolingStrategy + return EmbedderRuntime( configuration: loadedModel.configuration, container: loadedModel.container, @@ -58,7 +58,7 @@ struct EmbedderTool: AsyncParsableCommand { struct EmbedderRuntime { let configuration: ModelConfiguration - let container: ModelContainer + let container: EmbedderModelContainer let baseStrategy: Pooling.Strategy let strategyOverride: Pooling.Strategy? let normalize: Bool diff --git a/Tools/embedder-tool/ListCommand.swift b/Tools/embedder-tool/ListCommand.swift index 272fb4fa..f3eccf55 100644 --- a/Tools/embedder-tool/ListCommand.swift +++ b/Tools/embedder-tool/ListCommand.swift @@ -1,6 +1,7 @@ import ArgumentParser import Foundation import MLXEmbedders +import MLXLMCommon struct ListCommand: AsyncParsableCommand { static let configuration = CommandConfiguration( @@ -12,13 +13,13 @@ struct ListCommand: AsyncParsableCommand { var includeDirectories = false func run() async throws { - let models = await MainActor.run { Array(ModelConfiguration.models) } + let models = await MainActor.run { Array(EmbedderRegistry.shared.models) } .sorted { $0.name.localizedCaseInsensitiveCompare($1.name) == .orderedAscending } for configuration in models { switch configuration.id { - case .id(let identifier): - print(identifier) + case .id(let id, let revision): + print("\(id)/\(revision)") case .directory(let url): if includeDirectories { print(url.path) diff --git a/Tools/embedder-tool/ModelArguments.swift b/Tools/embedder-tool/ModelArguments.swift index 894bee11..a25fa6d6 100644 --- a/Tools/embedder-tool/ModelArguments.swift +++ b/Tools/embedder-tool/ModelArguments.swift @@ -2,8 +2,11 @@ import ArgumentParser import Foundation -import Hub +import HuggingFace import MLXEmbedders +import MLXHuggingFace +import MLXLMCommon +import Tokenizers struct ModelArguments: ParsableArguments { @@ -25,7 +28,7 @@ struct ModelArguments: ParsableArguments { return localConfiguration } - return ModelConfiguration.configuration(id: model) + return ModelConfiguration(id: model) } var downloadURL: URL? { @@ -35,7 +38,7 @@ struct ModelArguments: ParsableArguments { struct LoadedEmbedderModel { let configuration: ModelConfiguration - let container: ModelContainer + let container: EmbedderModelContainer } extension ModelArguments { @@ -43,12 +46,14 @@ extension ModelArguments { func load(default defaultConfiguration: ModelConfiguration) async throws -> LoadedEmbedderModel { let configuration = await configuration(default: defaultConfiguration) - let hub = makeHub() + let hub = #hubDownloader + let loader = #huggingFaceTokenizerLoader print("Loading model \(configuration.name)...") - let container = try await MLXEmbedders.loadModelContainer( - hub: hub, + let container = try await EmbedderModelFactory.shared.loadContainer( + from: hub, + using: loader, configuration: configuration, progressHandler: { progress in let percentage = Int(progress.fractionCompleted * 100) @@ -63,12 +68,15 @@ extension ModelArguments { return LoadedEmbedderModel(configuration: configuration, container: container) } - private func makeHub() -> HubApi { - if let downloadURL { - return HubApi(downloadBase: downloadURL) - } - - return HubApi() + var downloader: any Downloader { + let client = + if let download { + HubClient(cache: HubCache(cacheDirectory: download)) + } else { + HubClient() + } + let downloader = #hubDownloader(client) + return downloader } } diff --git a/Tools/llm-tool/LLMTool.swift b/Tools/llm-tool/LLMTool.swift index 2001c20f..9c95e335 100644 --- a/Tools/llm-tool/LLMTool.swift +++ b/Tools/llm-tool/LLMTool.swift @@ -3,8 +3,9 @@ import ArgumentParser import CoreImage import Foundation -import Hub +import HuggingFace import MLX +import MLXHuggingFace import MLXLLM import MLXLMCommon import MLXVLM @@ -30,8 +31,19 @@ struct ModelArguments: ParsableArguments, Sendable { @Option(help: "Hub download directory") var download: URL? + var downloader: any Downloader { + let client = + if let download { + HubClient(cache: HubCache(cacheDirectory: download)) + } else { + HubClient() + } + let downloader = #hubDownloader(client) + return downloader + } + @Sendable - func load(defaultModel: String, modelFactory: ModelFactory) async throws -> ModelContainer { + func load(defaultModel: String, modelFactory: any ModelFactory) async throws -> ModelContainer { let modelConfiguration: ModelConfiguration let modelName = self.model ?? defaultModel @@ -46,14 +58,10 @@ struct ModelArguments: ParsableArguments, Sendable { modelConfiguration = modelFactory.configuration(id: modelName) } - let hub = - if let download { - HubApi(downloadBase: download) - } else { - HubApi() - } - - return try await modelFactory.loadContainer(hub: hub, configuration: modelConfiguration) + return try await modelFactory.loadContainer( + from: self.downloader, + using: #huggingFaceTokenizerLoader(), + configuration: modelConfiguration) } } @@ -157,6 +165,9 @@ struct GenerateArguments: ParsableArguments, Sendable { @Flag(name: .shortAndLong, help: "If true only print the generated output") var quiet = false + @Flag(name: .customLong("tool-time"), help: "Enable time telling tool") + var useTimeTool = false + var generateParameters: GenerateParameters { GenerateParameters( maxTokens: maxTokens, @@ -167,6 +178,23 @@ struct GenerateArguments: ParsableArguments, Sendable { repetitionContextSize: repetitionContextSize) } + var toolSpecs: [MLXLMCommon.ToolSpec] { + var tools = [MLXLMCommon.ToolSpec]() + + if useTimeTool { + tools.append(timeTool.schema) + } + + return tools + } + + func call(toolCall: ToolCall) async throws -> String { + if useTimeTool && toolCall.function.name == timeTool.name { + return try await toolCall.execute(with: timeTool).toolResult + } + return "Unknown tool: \(toolCall.function.name)" + } + func prepare( _ context: inout ModelContext ) { @@ -188,7 +216,14 @@ struct GenerateArguments: ParsableArguments, Sendable { print(string, terminator: "") case .info(let info): return (info, output) - case .toolCall: + case .toolCall(let toolCall): + do { + // TODO maybe just use ChatSession here? + let x = try await call(toolCall: toolCall) + print("TOOL RESULT: \(x)") + } catch { + print("\nError executing tool: \(error.localizedDescription)") + } break } } @@ -285,7 +320,7 @@ struct EvaluateCommand: AsyncParsableCommand { @MainActor mutating func run() async throws { - let modelFactory: ModelFactory + let modelFactory: any ModelFactory let defaultModel: ModelConfiguration // Switch between LLM and VLM based on presence of media @@ -323,7 +358,8 @@ struct EvaluateCommand: AsyncParsableCommand { modelContainer, instructions: generate.system, generateParameters: generate.generateParameters, - processing: media.processing + processing: media.processing, + tools: generate.toolSpecs ) if !generate.quiet { diff --git a/Tools/llm-tool/LoraCommands.swift b/Tools/llm-tool/LoraCommands.swift index 05cccf18..c66b1e52 100644 --- a/Tools/llm-tool/LoraCommands.swift +++ b/Tools/llm-tool/LoraCommands.swift @@ -3,7 +3,9 @@ import ArgumentParser import Foundation import Hub +import HuggingFace import MLX +import MLXHuggingFace import MLXLLM import MLXLMCommon import MLXNN @@ -39,7 +41,7 @@ struct LoRAModelArguments: ParsableArguments, Sendable { /// This does not load the adapter weights as they may not exist yet. func load( defaultModel: String = defaultModel, - modelFactory: ModelFactory = LLMModelFactory.shared + modelFactory: any ModelFactory = LLMModelFactory.shared ) async throws -> (ModelContainer, ModelAdapter) { let modelContainer = try await args.load( defaultModel: defaultModel, modelFactory: modelFactory) @@ -185,8 +187,19 @@ struct LoRAFuseCommand: AsyncParsableCommand { if output.hasPrefix("/") { outputURL = URL(filePath: output) } else { - let repo = HubApi.Repo(id: output) - outputURL = HubApi().localRepoLocation(repo) + let cache = + if let download = args.args.download { + HubCache(cacheDirectory: download) + } else { + HubCache.default + } + + let parts = output.components(separatedBy: "/") + guard parts.count == 2 else { + fatalError("output must be org/name, e.g. mlx-community/mistral-lora: \(output)") + } + let repo = Repo.ID(namespace: parts[0], name: parts[1]) + outputURL = cache.repoDirectory(repo: repo, kind: .model) } let (modelContainer, modelAdapter) = try await args.load() @@ -196,9 +209,14 @@ struct LoRAFuseCommand: AsyncParsableCommand { try context.model.fuse(with: modelAdapter) } + let resolved = try await resolve( + configuration: modelContainer.configuration, + from: args.args.downloader, + useLatest: false, progressHandler: { _ in }) + // make the new directory and copy files from source model try FileManager.default.createDirectory(at: outputURL, withIntermediateDirectories: true) - let inputURL = await modelContainer.configuration.modelDirectory() + let inputURL = resolved.modelDirectory let enumerator = FileManager.default.enumerator( at: inputURL, includingPropertiesForKeys: nil)! for url in enumerator.allObjects.compactMap({ $0 as? URL }) { diff --git a/Tools/llm-tool/Tools.swift b/Tools/llm-tool/Tools.swift new file mode 100644 index 00000000..094e48e9 --- /dev/null +++ b/Tools/llm-tool/Tools.swift @@ -0,0 +1,21 @@ +// Copyright © 2026 Apple Inc. + +import Foundation +import MLXLMCommon + +// MARK: - Time Tool + +struct EmptyInput: Codable {} + +struct TimeOutput: Codable { + let time: String +} + +/// Simple tool integration for testing. +let timeTool = Tool( + name: "get_time", + description: "Get the current time", + parameters: [] +) { _ in + TimeOutput(time: Date.now.formatted()) +} diff --git a/mlx-swift-examples.xcodeproj/project.pbxproj b/mlx-swift-examples.xcodeproj/project.pbxproj index 3ebc192b..648e81c0 100644 --- a/mlx-swift-examples.xcodeproj/project.pbxproj +++ b/mlx-swift-examples.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 81695B412BA373D300F260D8 /* MarkdownUI in Frameworks */ = {isa = PBXBuildFile; productRef = 81695B402BA373D300F260D8 /* MarkdownUI */; }; C3132C2E2DFB317C00270E8E /* MLXVLM in Frameworks */ = {isa = PBXBuildFile; productRef = C3132C2D2DFB317C00270E8E /* MLXVLM */; }; C3132C302DFB317C00270E8E /* MLXLLM in Frameworks */ = {isa = PBXBuildFile; productRef = C3132C2F2DFB317C00270E8E /* MLXLLM */; }; - C314FFE42EF33D0900E5B73A /* MLXLLM in Frameworks */ = {isa = PBXBuildFile; productRef = C314FFE32EF33D0900E5B73A /* MLXLLM */; }; C3208E762DB1945D006AE6CA /* MLX in Frameworks */ = {isa = PBXBuildFile; productRef = C3208E752DB1945D006AE6CA /* MLX */; }; C3208E7A2DB1945D006AE6CA /* MLXNN in Frameworks */ = {isa = PBXBuildFile; productRef = C3208E792DB1945D006AE6CA /* MLXNN */; }; C3208E7B2DB194ED006AE6CA /* MLXLLM in Frameworks */ = {isa = PBXBuildFile; productRef = C32A17FC2CFFB98A0092A5B6 /* MLXLLM */; }; @@ -29,13 +28,33 @@ C32A18482D00E1540092A5B6 /* MLX in Frameworks */ = {isa = PBXBuildFile; productRef = C32A18472D00E1540092A5B6 /* MLX */; }; C32A184A2D00E1540092A5B6 /* MLXNN in Frameworks */ = {isa = PBXBuildFile; productRef = C32A18492D00E1540092A5B6 /* MLXNN */; }; C32A184C2D00E1540092A5B6 /* MLXOptimizers in Frameworks */ = {isa = PBXBuildFile; productRef = C32A184B2D00E1540092A5B6 /* MLXOptimizers */; }; - C32AA20C2EB977C4002914C6 /* MLXLLM in Frameworks */ = {isa = PBXBuildFile; productRef = C32AA20B2EB977C4002914C6 /* MLXLLM */; }; - C32AA20E2EB977C4002914C6 /* MLXVLM in Frameworks */ = {isa = PBXBuildFile; productRef = C32AA20D2EB977C4002914C6 /* MLXVLM */; }; + C33944F12F894F750054D57D /* MLXHuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C33944F02F894F750054D57D /* MLXHuggingFace */; }; + C33944F32F894F750054D57D /* MLXLLM in Frameworks */ = {isa = PBXBuildFile; productRef = C33944F22F894F750054D57D /* MLXLLM */; }; + C33944F52F894F750054D57D /* MLXLMCommon in Frameworks */ = {isa = PBXBuildFile; productRef = C33944F42F894F750054D57D /* MLXLMCommon */; }; + C33944F72F894F750054D57D /* MLXVLM in Frameworks */ = {isa = PBXBuildFile; productRef = C33944F62F894F750054D57D /* MLXVLM */; }; + C33944F92F895A6F0054D57D /* MLXHuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C33944F82F895A6F0054D57D /* MLXHuggingFace */; }; + C33944FB2F8970380054D57D /* MLXHuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C33944FA2F8970380054D57D /* MLXHuggingFace */; }; + C33944FD2F8970620054D57D /* MLXHuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C33944FC2F8970620054D57D /* MLXHuggingFace */; }; + C33944FF2F8970C30054D57D /* MLXHuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C33944FE2F8970C30054D57D /* MLXHuggingFace */; }; + C33945012F8971AE0054D57D /* MLXHuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C33945002F8971AE0054D57D /* MLXHuggingFace */; }; + C33945032F8971AE0054D57D /* MLXLLM in Frameworks */ = {isa = PBXBuildFile; productRef = C33945022F8971AE0054D57D /* MLXLLM */; }; C34E49292B6A028100FCB841 /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = C34E49282B6A028100FCB841 /* ArgumentParser */; }; C36BEFEF2BC329C5002D4AFE /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = C36BEFEE2BC329C5002D4AFE /* ArgumentParser */; }; C36BEFF22BC32A9A002D4AFE /* Progress in Frameworks */ = {isa = PBXBuildFile; productRef = C36BEFF12BC32A9A002D4AFE /* Progress */; }; C397C59C2B62C6D0004B084D /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = C397C59B2B62C6D0004B084D /* ArgumentParser */; }; C3E7D94D2CF6C9B20056C095 /* StableDiffusion in Frameworks */ = {isa = PBXBuildFile; productRef = C3E7D94C2CF6C9B20056C095 /* StableDiffusion */; }; + C3EA7F552F8432700054AEA3 /* HuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F542F8432700054AEA3 /* HuggingFace */; }; + C3EA7F572F8432700054AEA3 /* Tokenizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F562F8432700054AEA3 /* Tokenizers */; }; + C3EA7F5B2F843F520054AEA3 /* HuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F5A2F843F520054AEA3 /* HuggingFace */; }; + C3EA7F5D2F843F520054AEA3 /* Tokenizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F5C2F843F520054AEA3 /* Tokenizers */; }; + C3EA7F612F84413D0054AEA3 /* HuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F602F84413D0054AEA3 /* HuggingFace */; }; + C3EA7F632F84413D0054AEA3 /* Tokenizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F622F84413D0054AEA3 /* Tokenizers */; }; + C3EA7F672F84419A0054AEA3 /* HuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F662F84419A0054AEA3 /* HuggingFace */; }; + C3EA7F692F84419A0054AEA3 /* Tokenizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F682F84419A0054AEA3 /* Tokenizers */; }; + C3EA7F6D2F8444A00054AEA3 /* HuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F6C2F8444A00054AEA3 /* HuggingFace */; }; + C3EA7F6F2F8444A00054AEA3 /* Tokenizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F6E2F8444A00054AEA3 /* Tokenizers */; }; + C3EA7F732F8445EE0054AEA3 /* HuggingFace in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F722F8445EE0054AEA3 /* HuggingFace */; }; + C3EA7F752F8445EE0054AEA3 /* Tokenizers in Frameworks */ = {isa = PBXBuildFile; productRef = C3EA7F742F8445EE0054AEA3 /* Tokenizers */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -220,6 +239,7 @@ "llm-tool/ListCommands.swift", "llm-tool/LLMTool.swift", "llm-tool/LoraCommands.swift", + "llm-tool/Tools.swift", ); target = C397C58A2B62C6A9004B084D /* llm-tool */; }; @@ -374,8 +394,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C33944F92F895A6F0054D57D /* MLXHuggingFace in Frameworks */, 0A979D132E9743D800635D67 /* MLXEmbedders in Frameworks */, 0A979CD92E9717C500635D67 /* ArgumentParser in Frameworks */, + C3EA7F5B2F843F520054AEA3 /* HuggingFace in Frameworks */, + C3EA7F5D2F843F520054AEA3 /* Tokenizers in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -383,8 +406,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C33944FD2F8970620054D57D /* MLXHuggingFace in Frameworks */, 0F5AD8012DB70E6300745C06 /* MLXVLM in Frameworks */, 0F5AD8002DB70E6300745C06 /* MLXLLM in Frameworks */, + C3EA7F732F8445EE0054AEA3 /* HuggingFace in Frameworks */, + C3EA7F752F8445EE0054AEA3 /* Tokenizers in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -392,7 +418,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C3EA7F6F2F8444A00054AEA3 /* Tokenizers in Frameworks */, C32A18072CFFD1AA0092A5B6 /* MLXLLM in Frameworks */, + C3EA7F6D2F8444A00054AEA3 /* HuggingFace in Frameworks */, + C33944FB2F8970380054D57D /* MLXHuggingFace in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -409,7 +438,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C314FFE42EF33D0900E5B73A /* MLXLLM in Frameworks */, + C33945032F8971AE0054D57D /* MLXLLM in Frameworks */, + C3EA7F632F84413D0054AEA3 /* Tokenizers in Frameworks */, + C3EA7F612F84413D0054AEA3 /* HuggingFace in Frameworks */, + C33945012F8971AE0054D57D /* MLXHuggingFace in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -474,9 +506,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C32AA20C2EB977C4002914C6 /* MLXLLM in Frameworks */, + C33944F32F894F750054D57D /* MLXLLM in Frameworks */, C397C59C2B62C6D0004B084D /* ArgumentParser in Frameworks */, - C32AA20E2EB977C4002914C6 /* MLXVLM in Frameworks */, + C3EA7F572F8432700054AEA3 /* Tokenizers in Frameworks */, + C33944F72F894F750054D57D /* MLXVLM in Frameworks */, + C3EA7F552F8432700054AEA3 /* HuggingFace in Frameworks */, + C33944F52F894F750054D57D /* MLXLMCommon in Frameworks */, + C33944F12F894F750054D57D /* MLXHuggingFace in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -492,8 +528,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C33944FF2F8970C30054D57D /* MLXHuggingFace in Frameworks */, C32A18052CFFD19F0092A5B6 /* MLXLLM in Frameworks */, 81695B412BA373D300F260D8 /* MarkdownUI in Frameworks */, + C3EA7F672F84419A0054AEA3 /* HuggingFace in Frameworks */, + C3EA7F692F84419A0054AEA3 /* Tokenizers in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -566,6 +605,9 @@ packageProductDependencies = ( 0A979CD82E9717C500635D67 /* ArgumentParser */, 0A979D122E9743D800635D67 /* MLXEmbedders */, + C3EA7F5A2F843F520054AEA3 /* HuggingFace */, + C3EA7F5C2F843F520054AEA3 /* Tokenizers */, + C33944F82F895A6F0054D57D /* MLXHuggingFace */, ); productName = "embedder-tool"; productReference = 0A979CD12E97175800635D67 /* embedder-tool */; @@ -587,6 +629,9 @@ packageProductDependencies = ( C32A17FC2CFFB98A0092A5B6 /* MLXLLM */, C32A17FE2CFFB98A0092A5B6 /* MLXVLM */, + C3EA7F722F8445EE0054AEA3 /* HuggingFace */, + C3EA7F742F8445EE0054AEA3 /* Tokenizers */, + C33944FC2F8970620054D57D /* MLXHuggingFace */, ); productName = MLXChatExample; productReference = 0F5AD7412DB70C0300745C06 /* MLXChatExample.app */; @@ -611,6 +656,9 @@ name = LoRATrainingExample; packageProductDependencies = ( C32A18062CFFD1AA0092A5B6 /* MLXLLM */, + C3EA7F6C2F8444A00054AEA3 /* HuggingFace */, + C3EA7F6E2F8444A00054AEA3 /* Tokenizers */, + C33944FA2F8970380054D57D /* MLXHuggingFace */, ); productName = LoRATrainingExample; productReference = C3056BAB2BCD97B700A31D04 /* LoRATrainingExample.app */; @@ -651,7 +699,10 @@ ); name = LLMBasic; packageProductDependencies = ( - C314FFE32EF33D0900E5B73A /* MLXLLM */, + C3EA7F602F84413D0054AEA3 /* HuggingFace */, + C3EA7F622F84413D0054AEA3 /* Tokenizers */, + C33945002F8971AE0054D57D /* MLXHuggingFace */, + C33945022F8971AE0054D57D /* MLXLLM */, ); productName = LLMBasic; productReference = C314FEDB2EF33B2F00E5B73A /* LLMBasic.app */; @@ -800,8 +851,12 @@ name = "llm-tool"; packageProductDependencies = ( C397C59B2B62C6D0004B084D /* ArgumentParser */, - C32AA20B2EB977C4002914C6 /* MLXLLM */, - C32AA20D2EB977C4002914C6 /* MLXVLM */, + C3EA7F542F8432700054AEA3 /* HuggingFace */, + C3EA7F562F8432700054AEA3 /* Tokenizers */, + C33944F02F894F750054D57D /* MLXHuggingFace */, + C33944F22F894F750054D57D /* MLXLLM */, + C33944F42F894F750054D57D /* MLXLMCommon */, + C33944F62F894F750054D57D /* MLXVLM */, ); productName = "mistral-tool"; productReference = C397C58B2B62C6A9004B084D /* llm-tool */; @@ -845,6 +900,9 @@ packageProductDependencies = ( 81695B402BA373D300F260D8 /* MarkdownUI */, C32A18042CFFD19F0092A5B6 /* MLXLLM */, + C3EA7F662F84419A0054AEA3 /* HuggingFace */, + C3EA7F682F84419A0054AEA3 /* Tokenizers */, + C33944FE2F8970C30054D57D /* MLXHuggingFace */, ); productName = LLMEval; productReference = C3A8B3DC2B92A29E0002EFB8 /* LLMEval.app */; @@ -917,7 +975,9 @@ C36BEFF02BC32A8C002D4AFE /* XCRemoteSwiftPackageReference "Progress" */, C397D8F22CD2F60B00B87EE2 /* XCLocalSwiftPackageReference "Libraries/.." */, C32A18442D00E13E0092A5B6 /* XCRemoteSwiftPackageReference "mlx-swift" */, - C32AA12E2EB97625002914C6 /* XCRemoteSwiftPackageReference "mlx-swift-lm" */, + C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */, + C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */, + C36941322F8F489800810A49 /* XCRemoteSwiftPackageReference "mlx-swift-lm" */, ); productRefGroup = C39273752B606A0A00368D5D /* Products */; projectDirPath = ""; @@ -2638,7 +2698,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_STRICT_CONCURRENCY = complete; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; }; name = Debug; }; @@ -2698,7 +2758,7 @@ SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_STRICT_CONCURRENCY = complete; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 6.0; }; name = Release; }; @@ -3223,15 +3283,7 @@ repositoryURL = "https://github.com/ml-explore/mlx-swift"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 0.29.1; - }; - }; - C32AA12E2EB97625002914C6 /* XCRemoteSwiftPackageReference "mlx-swift-lm" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/ml-explore/mlx-swift-lm"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 2.30.3; + minimumVersion = 0.31.3; }; }; C34E491A2B69C43600FCB841 /* XCRemoteSwiftPackageReference "GzipSwift" */ = { @@ -3242,6 +3294,14 @@ version = 6.0.1; }; }; + C36941322F8F489800810A49 /* XCRemoteSwiftPackageReference "mlx-swift-lm" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/ml-explore/mlx-swift-lm.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 3.31.3; + }; + }; C36BEFF02BC32A8C002D4AFE /* XCRemoteSwiftPackageReference "Progress" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/jkandzi/Progress.swift"; @@ -3258,6 +3318,26 @@ minimumVersion = 1.4.0; }; }; + C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/huggingface/swift-huggingface"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.9.0; + }; + traits = ( + ); + }; + C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/huggingface/swift-transformers"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.3.0; + }; + traits = ( + ); + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -3286,11 +3366,6 @@ package = C397D8F22CD2F60B00B87EE2 /* XCLocalSwiftPackageReference "Libraries/.." */; productName = MLXLLM; }; - C314FFE32EF33D0900E5B73A /* MLXLLM */ = { - isa = XCSwiftPackageProductDependency; - package = C32AA12E2EB97625002914C6 /* XCRemoteSwiftPackageReference "mlx-swift-lm" */; - productName = MLXLLM; - }; C3208E752DB1945D006AE6CA /* MLX */ = { isa = XCSwiftPackageProductDependency; package = C32A18442D00E13E0092A5B6 /* XCRemoteSwiftPackageReference "mlx-swift" */; @@ -3361,16 +3436,46 @@ package = C32A18442D00E13E0092A5B6 /* XCRemoteSwiftPackageReference "mlx-swift" */; productName = MLXOptimizers; }; - C32AA20B2EB977C4002914C6 /* MLXLLM */ = { + C33944F02F894F750054D57D /* MLXHuggingFace */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXHuggingFace; + }; + C33944F22F894F750054D57D /* MLXLLM */ = { isa = XCSwiftPackageProductDependency; - package = C32AA12E2EB97625002914C6 /* XCRemoteSwiftPackageReference "mlx-swift-lm" */; productName = MLXLLM; }; - C32AA20D2EB977C4002914C6 /* MLXVLM */ = { + C33944F42F894F750054D57D /* MLXLMCommon */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXLMCommon; + }; + C33944F62F894F750054D57D /* MLXVLM */ = { isa = XCSwiftPackageProductDependency; - package = C32AA12E2EB97625002914C6 /* XCRemoteSwiftPackageReference "mlx-swift-lm" */; productName = MLXVLM; }; + C33944F82F895A6F0054D57D /* MLXHuggingFace */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXHuggingFace; + }; + C33944FA2F8970380054D57D /* MLXHuggingFace */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXHuggingFace; + }; + C33944FC2F8970620054D57D /* MLXHuggingFace */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXHuggingFace; + }; + C33944FE2F8970C30054D57D /* MLXHuggingFace */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXHuggingFace; + }; + C33945002F8971AE0054D57D /* MLXHuggingFace */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXHuggingFace; + }; + C33945022F8971AE0054D57D /* MLXLLM */ = { + isa = XCSwiftPackageProductDependency; + productName = MLXLLM; + }; C34E49282B6A028100FCB841 /* ArgumentParser */ = { isa = XCSwiftPackageProductDependency; package = C392736E2B60699100368D5D /* XCRemoteSwiftPackageReference "swift-argument-parser" */; @@ -3396,6 +3501,66 @@ package = C397D8F22CD2F60B00B87EE2 /* XCLocalSwiftPackageReference "Libraries/.." */; productName = StableDiffusion; }; + C3EA7F542F8432700054AEA3 /* HuggingFace */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */; + productName = HuggingFace; + }; + C3EA7F562F8432700054AEA3 /* Tokenizers */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */; + productName = Tokenizers; + }; + C3EA7F5A2F843F520054AEA3 /* HuggingFace */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */; + productName = HuggingFace; + }; + C3EA7F5C2F843F520054AEA3 /* Tokenizers */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */; + productName = Tokenizers; + }; + C3EA7F602F84413D0054AEA3 /* HuggingFace */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */; + productName = HuggingFace; + }; + C3EA7F622F84413D0054AEA3 /* Tokenizers */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */; + productName = Tokenizers; + }; + C3EA7F662F84419A0054AEA3 /* HuggingFace */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */; + productName = HuggingFace; + }; + C3EA7F682F84419A0054AEA3 /* Tokenizers */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */; + productName = Tokenizers; + }; + C3EA7F6C2F8444A00054AEA3 /* HuggingFace */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */; + productName = HuggingFace; + }; + C3EA7F6E2F8444A00054AEA3 /* Tokenizers */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */; + productName = Tokenizers; + }; + C3EA7F722F8445EE0054AEA3 /* HuggingFace */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F522F8431BE0054AEA3 /* XCRemoteSwiftPackageReference "swift-huggingface" */; + productName = HuggingFace; + }; + C3EA7F742F8445EE0054AEA3 /* Tokenizers */ = { + isa = XCSwiftPackageProductDependency; + package = C3EA7F532F8432080054AEA3 /* XCRemoteSwiftPackageReference "swift-transformers" */; + productName = Tokenizers; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = C39273682B60697700368D5D /* Project object */; diff --git a/mlx-swift-examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/mlx-swift-examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 38977f03..c895efc9 100644 --- a/mlx-swift-examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/mlx-swift-examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,6 +1,15 @@ { - "originHash" : "b63947dc4e7cd2d22b1d663a82e277f552af0e8ad0add299d9dec61ceaf8fed0", + "originHash" : "e538f345418093ec944f6af6ff98e1b0c1e736fb7c1f52379fbcf33a8ac26084", "pins" : [ + { + "identity" : "eventsource", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattt/EventSource.git", + "state" : { + "revision" : "a3a85a85214caf642abaa96ae664e4c772a59f6e", + "version" : "1.4.1" + } + }, { "identity" : "gzipswift", "kind" : "remoteSourceControl", @@ -15,17 +24,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ml-explore/mlx-swift", "state" : { - "revision" : "4dccaeda1d83cf8697f235d2786c2d72ad4bb925", - "version" : "0.30.3" + "revision" : "61b9e011e09a62b489f6bd647958f1555bdf2896", + "version" : "0.31.3" } }, { "identity" : "mlx-swift-lm", "kind" : "remoteSourceControl", - "location" : "https://github.com/ml-explore/mlx-swift-lm", + "location" : "https://github.com/ml-explore/mlx-swift-lm.git", "state" : { - "revision" : "360c5052b81cc154b04ee0933597a4ad6db4b8ae", - "version" : "2.30.3" + "revision" : "1c05248bb0899e2a7a4962b84d319cf12f4e12aa", + "version" : "3.31.3" } }, { @@ -55,6 +64,24 @@ "version" : "1.6.2" } }, + { + "identity" : "swift-asn1", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-asn1.git", + "state" : { + "revision" : "9f542610331815e29cc3821d3b6f488db8715517", + "version" : "1.6.0" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "b601256eab081c0f92f059e12818ac1d4f178ff7", + "version" : "1.3.0" + } + }, { "identity" : "swift-cmark", "kind" : "remoteSourceControl", @@ -73,13 +100,31 @@ "version" : "1.3.0" } }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "fa308c07a6fa04a727212d793e761460e41049c3", + "version" : "4.3.0" + } + }, + { + "identity" : "swift-huggingface", + "kind" : "remoteSourceControl", + "location" : "https://github.com/huggingface/swift-huggingface.git", + "state" : { + "revision" : "b721959445b617d0bf03910b2b4aced345fd93bf", + "version" : "0.9.0" + } + }, { "identity" : "swift-jinja", "kind" : "remoteSourceControl", "location" : "https://github.com/huggingface/swift-jinja.git", "state" : { - "revision" : "06a511d5adab5a812852ff972e65702a24b8ce30", - "version" : "2.2.0" + "revision" : "d81197f35f41445bc10e94600795e68c6f5e94b0", + "version" : "2.3.1" } }, { @@ -91,6 +136,15 @@ "version" : "2.4.1" } }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "bdf004b44f77c56fca752cd1cf243c802f8469c9", + "version" : "2.97.0" + } + }, { "identity" : "swift-numerics", "kind" : "remoteSourceControl", @@ -100,13 +154,40 @@ "version" : "1.1.1" } }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-syntax.git", + "state" : { + "revision" : "0687f71944021d616d34d922343dcef086855920", + "version" : "600.0.1" + } + }, + { + "identity" : "swift-system", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-system.git", + "state" : { + "revision" : "7c6ad0fc39d0763e0b699210e4124afd5041c5df", + "version" : "1.6.4" + } + }, { "identity" : "swift-transformers", "kind" : "remoteSourceControl", "location" : "https://github.com/huggingface/swift-transformers", "state" : { - "revision" : "573e5c9036c2f136b3a8a071da8e8907322403d0", - "version" : "1.1.6" + "revision" : "b38443e44d93eca770f2eb68e2a4d0fa100f9aa2", + "version" : "1.3.0" + } + }, + { + "identity" : "yyjson", + "kind" : "remoteSourceControl", + "location" : "https://github.com/ibireme/yyjson.git", + "state" : { + "revision" : "8b4a38dc994a110abaec8a400615567bd996105f", + "version" : "0.12.0" } } ],