Update readme

keypair34 committed Apr 5, 2026 at 17:36 UTC 27bb19ce7ef1843cfe6c20441783abe769c42845
1 file changed +21 -9
README.md
+21 -9
@@ -2,7 +2,7 @@
2 <img src="https://raw.githubusercontent.com/ondeinference/onde/main/assets/onde-inference-logo.svg" alt="Onde Inference" width="96">
3 </p>
4
5 -<h1 align="center">Onde</h1>
5 +<h1 align="center">Onde Inference</h1>
6
7 <p align="center">
8 <strong>On-device LLM inference for Swift — optimized for <a href="https://en.wikipedia.org/wiki/Apple_silicon">Apple silicon</a>.</strong>
@@ -14,6 +14,10 @@
14 <a href="https://apps.apple.com/se/developer/splitfire-ab/id1831430993"><img src="https://img.shields.io/badge/App%20Store-live-235843?style=flat-square&labelColor=17211D" alt="App Store"></a>
15 </p>
16
17 +<p align="center">
18 + <a href="https://github.com/ondeinference/onde">Rust SDK</a> · <a href="https://pub.dev/packages/onde_inference">Flutter SDK</a> · <a href="https://ondeinference.com">Website</a>
19 +</p>
20 +
21 ---
22
23 ## Installation
@@ -96,30 +100,38 @@ let result = try await engine.generate(
100
101 ## Sandboxed App Setup
102
99 -On iOS and App Store macOS, configure the HuggingFace cache directory before any inference call:
103 +On iOS and App Store macOS, the default `~/.cache/huggingface` is outside the app sandbox. This helper seeds `HF_HOME` inside the App Group shared container (`group.com.ondeinference.apps`) so all Onde-powered apps share downloaded models. Call once at app launch before creating an `OndeChatEngine`.
104
105 ```swift
106 import Foundation
107
108 func setupInferenceEnvironment() {
105 - let appSupport = FileManager.default
106 - .urls(for: .applicationSupportDirectory, in: .userDomainMask)[0]
109 + guard let container = FileManager.default.containerURL(
110 + forSecurityApplicationGroupIdentifier: "group.com.ondeinference.apps"
111 + ) else {
112 + // Fall back to app-private Application Support if App Group is unavailable.
113 + let appSupport = FileManager.default
114 + .urls(for: .applicationSupportDirectory, in: .userDomainMask)[0]
115 + setupHfCache(at: appSupport)
116 + return
117 + }
118 + setupHfCache(at: container)
119 +}
120
108 - let hfHome = appSupport.appendingPathComponent("huggingface")
121 +private func setupHfCache(at base: URL) {
122 + let hfHome = base.appendingPathComponent("models")
123 let hfHub = hfHome.appendingPathComponent("hub")
124 try? FileManager.default.createDirectory(at: hfHub, withIntermediateDirectories: true)
125
126 setenv("HF_HOME", hfHome.path, 1)
127 setenv("HF_HUB_CACHE", hfHub.path, 1)
128
115 - let tmp = appSupport.appendingPathComponent("tmp")
129 + let tmp = base.appendingPathComponent("tmp")
130 try? FileManager.default.createDirectory(at: tmp, withIntermediateDirectories: true)
131 setenv("TMPDIR", tmp.path, 1)
132 }
133 ```
134
121 -Call this once at app launch, before creating an `OndeChatEngine`.
122 -
135 ## Documentation
136
137 - [Swift API Reference](https://ondeinference.com/docs/swift-package)
@@ -128,7 +140,7 @@ Call this once at app launch, before creating an `OndeChatEngine`.
140
141 ## License
142
131 -[MIT](LICENSE)
143 +MIT © [Splitfire AB](https://splitfire.se)
144
145 ---
146