From: Daniel Bevenius Date: Fri, 4 Apr 2025 08:24:12 +0000 (+0200) Subject: docs : add XCFramework section to README.md [no ci] (#12746) X-Git-Tag: gguf-v0.16.1~107 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=348888e0dc469a476f9e9eccb394893c513daab8;p=pkg%2Fggml%2Fsources%2Fllama.cpp docs : add XCFramework section to README.md [no ci] (#12746) This commit adds a new section to the README.md file, detailing the usage of the XCFramework. The motivation for this is that it might not be immediately clear to users how to use the XCFramework in their projects and hopefully this will help. --- diff --git a/README.md b/README.md index f8ed423c..95a05e6e 100644 --- a/README.md +++ b/README.md @@ -530,6 +530,35 @@ If your issue is with model generation quality, then please at least scan the fo - [Aligning language models to follow instructions](https://openai.com/research/instruction-following) - [Training language models to follow instructions with human feedback](https://arxiv.org/abs/2203.02155) +## XCFramework +The XCFramework is a precompiled version of the library for iOS, visionOS, tvOS, +and macOS. It can be used in Swift projects without the need to compile the +library from source. For example: +```swift +// swift-tools-version: 5.10 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "MyLlamaPackage", + targets: [ + .executableTarget( + name: "MyLlamaPackage", + dependencies: [ + "LlamaFramework" + ]), + .binaryTarget( + name: "LlamaFramework", + url: "https://github.com/ggml-org/llama.cpp/releases/download/b5046/llama-b5046-xcframework.zip", + checksum: "c19be78b5f00d8d29a25da41042cb7afa094cbf6280a225abe614b03b20029ab" + ) + ] +) +``` +The above example is using an intermediate build `b5046` of the library. This can be modified +to use a different version by changing the URL and checksum. + ## Completions Command-line completion is available for some environments.