From eb47d383ad5db5509327f5236d7f55f51b5d62f7 Mon Sep 17 00:00:00 2001 From: mattt Date: Mon, 16 Nov 2026 05:52:04 -0800 Subject: [PATCH 1/3] Pass helper options when decoding image input --- Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift b/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift index e34ee8eb..4735eb3f 100644 --- a/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift +++ b/Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift @@ -2052,14 +2052,15 @@ import Foundation } } for imageData in images { - // Pinned to the current llama.swift signature. llama.cpp master adds a - // trailing options argument to this helper; update alongside the dependency. + // The options only configure video decoding, + // and video input is rejected below. let wrapper = imageData.withUnsafeBytes { raw -> mtmd_helper_bitmap_wrapper in mtmd_helper_bitmap_init_from_buf( mtmdContext, raw.bindMemory(to: UInt8.self).baseAddress, imageData.count, - false + false, + mtmd_helper_init_opt_default() ) } if let videoContext = wrapper.video_ctx { From a236e4f0643dab1e9a38ea09c9b7da05c19f782f Mon Sep 17 00:00:00 2001 From: mattt Date: Mon, 16 Nov 2026 06:02:11 -0800 Subject: [PATCH 2/3] Require llama.swift 3.0.0 for llama.cpp 1.0.0 --- Package.swift | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 5b9cbc4b..241cf195 100644 --- a/Package.swift +++ b/Package.swift @@ -40,7 +40,7 @@ let package = Package( ] ), .package(url: "https://github.com/mattt/JSONSchema", from: "1.3.0"), - .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "2.10549.0")), + .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "3.0.0")), .package(url: "https://github.com/ml-explore/mlx-swift-lm", .upToNextMinor(from: "3.32.3")), .package(url: "https://github.com/swiftlang/swift-syntax", from: "602.0.0"), .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.24.0"), diff --git a/README.md b/README.md index ab203758..92dd54c2 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ dependencies: [ > ), > .package(url: "https://github.com/huggingface/swift-transformers", from: "1.0.0"), // CoreML > .package(url: "https://github.com/ml-explore/mlx-swift-lm", .upToNextMinor(from: "3.32.3")), // MLX -> .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "2.10549.0")), // Llama +> .package(url: "https://github.com/mattt/llama.swift", .upToNextMajor(from: "3.0.0")), // Llama > ] > ``` > From 75c0184bd7bb0a22cea9bab35da2d52d8bf4a94c Mon Sep 17 00:00:00 2001 From: mattt Date: Wed, 18 Nov 2026 05:39:35 -0800 Subject: [PATCH 3/3] Remove cached Swift-imported modules in Swift 6.4 CI jobs --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dac6421b..10562bc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,12 +94,17 @@ jobs: - name: Lint run: swift format lint --strict --recursive . - - name: Remove cached build descriptions + - name: Remove cached build descriptions and Swift-imported modules # Descriptions contain Metal compiler paths # from the previous runner's temporary mount. - # Keep compiled outputs for incremental builds. + # A binary target's headers keep their release's timestamps, + # so Swift Build reuses a module built from an older release's headers. + # llama.swift isn't pinned, so this can happen with an exact cache hit. + # Keep the other compiled outputs for incremental builds. if: matrix.swift == '6.4' - run: rm -rf .build/out/Intermediates.noindex/XCBuildData/*.xcbuilddata + run: | + rm -rf .build/out/Intermediates.noindex/XCBuildData/*.xcbuilddata + rm -rf .build/out/Intermediates.noindex/SwiftExplicitPrecompiledModules # Nothing in these jobs reads the index store. # The Linux jobs keep it because test discovery on Linux reads it.