Skip to content

Commit 348888e

Browse files
authored
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.
1 parent 74d4f5b commit 348888e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,35 @@ If your issue is with model generation quality, then please at least scan the fo
530530
- [Aligning language models to follow instructions](https://openai.com/research/instruction-following)
531531
- [Training language models to follow instructions with human feedback](https://arxiv.org/abs/2203.02155)
532532
533+
## XCFramework
534+
The XCFramework is a precompiled version of the library for iOS, visionOS, tvOS,
535+
and macOS. It can be used in Swift projects without the need to compile the
536+
library from source. For example:
537+
```swift
538+
// swift-tools-version: 5.10
539+
// The swift-tools-version declares the minimum version of Swift required to build this package.
540+
541+
import PackageDescription
542+
543+
let package = Package(
544+
name: "MyLlamaPackage",
545+
targets: [
546+
.executableTarget(
547+
name: "MyLlamaPackage",
548+
dependencies: [
549+
"LlamaFramework"
550+
]),
551+
.binaryTarget(
552+
name: "LlamaFramework",
553+
url: "https://github.com/ggml-org/llama.cpp/releases/download/b5046/llama-b5046-xcframework.zip",
554+
checksum: "c19be78b5f00d8d29a25da41042cb7afa094cbf6280a225abe614b03b20029ab"
555+
)
556+
]
557+
)
558+
```
559+
The above example is using an intermediate build `b5046` of the library. This can be modified
560+
to use a different version by changing the URL and checksum.
561+
533562
## Completions
534563
Command-line completion is available for some environments.
535564

0 commit comments

Comments
 (0)