@ondeinference / onde / commits / 279861d

Add visionOS support: Metal, CI, and XCFramework slices

- Add Apple visionOS and visionOS simulator targets to build-swift-xcframework.sh - Add visionOS device and simulator jobs to GitHub Actions CI - Add visionOS target dependencies (hf-hub, mistralrs, mistralrs-core) to Cargo.toml - Update build.rs to include visionOS for the ___chkstk_darwin stub - Add visionOS to all relevant #[cfg(...)] blocks for Apple platforms in Rust sources - Update Cargo.lock for dependency changes and new mistralrs commit

Seto Elkahfi committed Apr 9, 2026 at 20:33 UTC 279861dc6c603c07aca79100bf924d5d7269ef30
9 files changed +145 -47
.github/scripts/build-swift-xcframework.sh
+13 -1
@@ -23,6 +23,8 @@ cargo +1.92.0 rustc --target aarch64-apple-ios-sim --release --lib --crate-type
23 cargo +1.92.0 rustc --target aarch64-apple-darwin --release --lib --crate-type staticlib
24 cargo +nightly rustc -Z build-std --target aarch64-apple-tvos --release --lib --crate-type staticlib
25 cargo +nightly rustc -Z build-std --target aarch64-apple-tvos-sim --release --lib --crate-type staticlib
26 +cargo +nightly rustc -Z build-std --target aarch64-apple-visionos --release --lib --crate-type staticlib
27 +cargo +nightly rustc -Z build-std --target aarch64-apple-visionos-sim --release --lib --crate-type staticlib
28
29 "$BINDGEN" generate "$ROOT_DIR/target/aarch64-apple-ios/release/libonde.a" --language swift --out-dir "$PACKAGE_DIR/Sources/Onde"
30
@@ -33,9 +35,19 @@ cp "$ROOT_DIR/target/aarch64-apple-ios-sim/release/libonde.a" "$DIST_DIR/libonde
35
36 cp "$ROOT_DIR/target/aarch64-apple-tvos-sim/release/libonde.a" "$DIST_DIR/libonde-tvos-sim.a"
37
38 +cp "$ROOT_DIR/target/aarch64-apple-visionos-sim/release/libonde.a" "$DIST_DIR/libonde-visionos-sim.a"
39 +
40 cp "$ROOT_DIR/target/aarch64-apple-darwin/release/libonde.a" "$DIST_DIR/libonde-macos.a"
41
38 -xcodebuild -create-xcframework -library "$ROOT_DIR/target/aarch64-apple-ios/release/libonde.a" -headers "$HEADERS_DIR" -library "$DIST_DIR/libonde-ios-sim.a" -headers "$HEADERS_DIR" -library "$ROOT_DIR/target/aarch64-apple-tvos/release/libonde.a" -headers "$HEADERS_DIR" -library "$DIST_DIR/libonde-tvos-sim.a" -headers "$HEADERS_DIR" -library "$DIST_DIR/libonde-macos.a" -headers "$HEADERS_DIR" -output "$FRAMEWORK_DIR"
42 +xcodebuild -create-xcframework \
43 + -library "$ROOT_DIR/target/aarch64-apple-ios/release/libonde.a" -headers "$HEADERS_DIR" \
44 + -library "$DIST_DIR/libonde-ios-sim.a" -headers "$HEADERS_DIR" \
45 + -library "$ROOT_DIR/target/aarch64-apple-tvos/release/libonde.a" -headers "$HEADERS_DIR" \
46 + -library "$DIST_DIR/libonde-tvos-sim.a" -headers "$HEADERS_DIR" \
47 + -library "$ROOT_DIR/target/aarch64-apple-visionos/release/libonde.a" -headers "$HEADERS_DIR" \
48 + -library "$DIST_DIR/libonde-visionos-sim.a" -headers "$HEADERS_DIR" \
49 + -library "$DIST_DIR/libonde-macos.a" -headers "$HEADERS_DIR" \
50 + -output "$FRAMEWORK_DIR"
51
52 export FRAMEWORK_DIR ZIP_PATH
53 python3 - <<'ZIP'
.github/workflows/ci.yml
+26
@@ -100,3 +100,29 @@ jobs:
100 with:
101 key: tvos-sim
102 - run: cargo +nightly check -Z build-std --target aarch64-apple-tvos-sim
103 +
104 + check-visionos:
105 + name: Check (visionOS device)
106 + runs-on: macos-15
107 + steps:
108 + - uses: actions/checkout@v6
109 + - uses: dtolnay/rust-toolchain@nightly
110 + with:
111 + components: rust-src
112 + - uses: Swatinem/rust-cache@v2
113 + with:
114 + key: visionos
115 + - run: cargo +nightly check -Z build-std --target aarch64-apple-visionos
116 +
117 + check-visionos-sim:
118 + name: Check (visionOS simulator)
119 + runs-on: macos-15
120 + steps:
121 + - uses: actions/checkout@v6
122 + - uses: dtolnay/rust-toolchain@nightly
123 + with:
124 + components: rust-src
125 + - uses: Swatinem/rust-cache@v2
126 + with:
127 + key: visionos-sim
128 + - run: cargo +nightly check -Z build-std --target aarch64-apple-visionos-sim
Cargo.lock
+47 -41
@@ -885,6 +885,15 @@ dependencies = [
885 "unicode-segmentation",
886 ]
887
888 +[[package]]
889 +name = "convert_case"
890 +version = "0.10.0"
891 +source = "registry+https://github.com/rust-lang/crates.io-index"
892 +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9"
893 +dependencies = [
894 + "unicode-segmentation",
895 +]
896 +
897 [[package]]
898 name = "core-foundation"
899 version = "0.9.4"
@@ -976,15 +985,17 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
985
986 [[package]]
987 name = "crossterm"
979 -version = "0.25.0"
988 +version = "0.29.0"
989 source = "registry+https://github.com/rust-lang/crates.io-index"
981 -checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67"
990 +checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b"
991 dependencies = [
983 - "bitflags 1.3.2",
992 + "bitflags 2.11.0",
993 "crossterm_winapi",
985 - "libc",
986 - "mio 0.8.11",
994 + "derive_more",
995 + "document-features",
996 + "mio",
997 "parking_lot",
998 + "rustix",
999 "signal-hook",
1000 "signal-hook-mio",
1001 "winapi",
@@ -1251,6 +1262,7 @@ version = "2.1.1"
1262 source = "registry+https://github.com/rust-lang/crates.io-index"
1263 checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"
1264 dependencies = [
1265 + "convert_case 0.10.0",
1266 "proc-macro2",
1267 "quote",
1268 "rustc_version",
@@ -1336,6 +1348,15 @@ version = "1.1.1"
1348 source = "registry+https://github.com/rust-lang/crates.io-index"
1349 checksum = "c2db04e74f0a9a93103b50e90b96024c9b2bdca8bce6a632ec71b88736d3d359"
1350
1351 +[[package]]
1352 +name = "document-features"
1353 +version = "0.2.12"
1354 +source = "registry+https://github.com/rust-lang/crates.io-index"
1355 +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61"
1356 +dependencies = [
1357 + "litrs",
1358 +]
1359 +
1360 [[package]]
1361 name = "dtoa"
1362 version = "1.0.11"
@@ -2621,9 +2642,9 @@ dependencies = [
2642
2643 [[package]]
2644 name = "interprocess"
2624 -version = "2.4.0"
2645 +version = "2.2.3"
2646 source = "registry+https://github.com/rust-lang/crates.io-index"
2626 -checksum = "6be5e5c847dbdb44564bd85294740d031f4f8aeb3464e5375ef7141f7538db69"
2647 +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d"
2648 dependencies = [
2649 "doctest-file",
2650 "libc",
@@ -2806,6 +2827,12 @@ version = "0.8.2"
2827 source = "registry+https://github.com/rust-lang/crates.io-index"
2828 checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
2829
2830 +[[package]]
2831 +name = "litrs"
2832 +version = "1.0.0"
2833 +source = "registry+https://github.com/rust-lang/crates.io-index"
2834 +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"
2835 +
2836 [[package]]
2837 name = "llguidance"
2838 version = "1.7.0"
@@ -3051,18 +3078,6 @@ dependencies = [
3078 "simd-adler32",
3079 ]
3080
3054 -[[package]]
3055 -name = "mio"
3056 -version = "0.8.11"
3057 -source = "registry+https://github.com/rust-lang/crates.io-index"
3058 -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
3059 -dependencies = [
3060 - "libc",
3061 - "log",
3062 - "wasi",
3063 - "windows-sys 0.48.0",
3064 -]
3065 -
3081 [[package]]
3082 name = "mio"
3083 version = "1.2.0"
@@ -3070,6 +3085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
3085 checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"
3086 dependencies = [
3087 "libc",
3088 + "log",
3089 "wasi",
3090 "windows-sys 0.61.2",
3091 ]
@@ -3077,7 +3093,7 @@ dependencies = [
3093 [[package]]
3094 name = "mistralrs"
3095 version = "0.8.1"
3080 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3096 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3097 dependencies = [
3098 "anyhow",
3099 "candle-core",
@@ -3104,7 +3120,7 @@ dependencies = [
3120 [[package]]
3121 name = "mistralrs-audio"
3122 version = "0.8.1"
3107 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3123 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3124 dependencies = [
3125 "anyhow",
3126 "apodize",
@@ -3115,7 +3131,7 @@ dependencies = [
3131 [[package]]
3132 name = "mistralrs-core"
3133 version = "0.8.1"
3118 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3134 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3135 dependencies = [
3136 "ahash",
3137 "akin",
@@ -3212,7 +3228,7 @@ dependencies = [
3228 [[package]]
3229 name = "mistralrs-macros"
3230 version = "0.8.1"
3215 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3231 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3232 dependencies = [
3233 "darling 0.23.0",
3234 "proc-macro2",
@@ -3223,7 +3239,7 @@ dependencies = [
3239 [[package]]
3240 name = "mistralrs-mcp"
3241 version = "0.8.1"
3226 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3242 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3243 dependencies = [
3244 "anyhow",
3245 "async-trait",
@@ -3243,7 +3259,7 @@ dependencies = [
3259 [[package]]
3260 name = "mistralrs-paged-attn"
3261 version = "0.8.1"
3246 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3262 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3263 dependencies = [
3264 "anyhow",
3265 "candle-core",
@@ -3259,7 +3275,7 @@ dependencies = [
3275 [[package]]
3276 name = "mistralrs-quant"
3277 version = "0.8.1"
3262 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3278 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3279 dependencies = [
3280 "byteorder",
3281 "candle-core",
@@ -3288,7 +3304,7 @@ dependencies = [
3304 [[package]]
3305 name = "mistralrs-vision"
3306 version = "0.8.1"
3291 -source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#8c2daf9f82e5d4c912d18f4f2b3ad61c9c9a1e29"
3307 +source = "git+https://github.com/setoelkahfi/mistral.rs?branch=fix%2Fall-platform-fixes#a0e354d85c478c642f2559125f59e5fb4c7d6f0b"
3308 dependencies = [
3309 "candle-core",
3310 "image",
@@ -5033,7 +5049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
5049 checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc"
5050 dependencies = [
5051 "libc",
5036 - "mio 0.8.11",
5052 + "mio",
5053 "signal-hook",
5054 ]
5055
@@ -5771,7 +5787,7 @@ checksum = "2bd1c4c0fc4a7ab90fc15ef6daaa3ec3b893f004f915f2392557ed23237820cd"
5787 dependencies = [
5788 "bytes",
5789 "libc",
5774 - "mio 1.2.0",
5790 + "mio",
5791 "parking_lot",
5792 "pin-project-lite",
5793 "signal-hook-registry",
@@ -5950,8 +5966,7 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
5966 [[package]]
5967 name = "tqdm"
5968 version = "0.8.0"
5953 -source = "registry+https://github.com/rust-lang/crates.io-index"
5954 -checksum = "b316d5c2ac649ca856dacd487d0ebb94f3b746bada51355d93dd2c007ab62a2e"
5969 +source = "git+https://github.com/setoelkahfi/tqdm?branch=deps%2Fbump-crossterm#41e4182829136e6dadbdd1c36af824d19219147a"
5970 dependencies = [
5971 "anyhow",
5972 "crossterm",
@@ -6041,7 +6056,7 @@ version = "2.2.1"
6056 source = "registry+https://github.com/rust-lang/crates.io-index"
6057 checksum = "4fc20a25899c5ae43735253244214f3d5eb75dd28d9cc8491732294a985adb8c"
6058 dependencies = [
6044 - "convert_case",
6059 + "convert_case 0.6.0",
6060 "proc-macro2",
6061 "quote",
6062 "state",
@@ -6920,15 +6935,6 @@ dependencies = [
6935 "windows-targets 0.42.2",
6936 ]
6937
6923 -[[package]]
6924 -name = "windows-sys"
6925 -version = "0.48.0"
6926 -source = "registry+https://github.com/rust-lang/crates.io-index"
6927 -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
6928 -dependencies = [
6929 - "windows-targets 0.48.5",
6930 -]
6931 -
6938 [[package]]
6939 name = "windows-sys"
6940 version = "0.52.0"
Cargo.toml
+11
@@ -68,6 +68,17 @@ mistralrs = { git = "https://github.com/setoelkahfi/mistral.rs", branch = "fix/a
68 # mistralrs-core = { version = "0.8.1", features = ["metal"] }
69 mistralrs-core = { git = "https://github.com/setoelkahfi/mistral.rs", branch = "fix/all-platform-fixes", features = ["metal"] }
70
71 +# visionOS: Metal-accelerated inference (Apple Vision Pro has M2 GPU);
72 +# hf-hub + mistralrs-core needed for GLOBAL_HF_CACHE sandbox workaround.
73 +[target.'cfg(target_os = "visionos")'.dependencies]
74 +hf-hub = { version = "0.4", features = ["tokio", "rustls-tls"], default-features = false }
75 +# mistralrs = { version = "0.8.1", features = ["metal"] }
76 +mistralrs = { git = "https://github.com/setoelkahfi/mistral.rs", branch = "fix/all-platform-fixes", features = ["metal"] }
77 +# mistralrs-core = { version = "0.8.1", features = ["metal"] }
78 +mistralrs-core = { git = "https://github.com/setoelkahfi/mistral.rs", branch = "fix/all-platform-fixes", features = ["metal"] }
79 +
80 +
81 +
82 # macOS: Metal-accelerated inference.
83 [target.'cfg(target_os = "macos")'.dependencies]
84 # mistralrs = { version = "0.8.1", features = ["metal"] }
build.rs
+1 -1
@@ -17,7 +17,7 @@ fn main() {
17 // instruction — only when targeting tvOS.
18 let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
19
20 - if target_os == "tvos" {
20 + if target_os == "tvos" || target_os == "visionos" {
21 let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
22 let asm_path = std::path::Path::new(&manifest_dir).join("scripts/tvos_chkstk.s");
23
src/hf_cache.rs
+20 -3
@@ -246,7 +246,13 @@ fn list_revisions(model_dir: &Path) -> Vec<String> {
246 }
247
248 /// Build a [`ModelDownloadProgress`] payload from raw byte counts.
249 -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "android"))]
249 +#[cfg(any(
250 + target_os = "macos",
251 + target_os = "ios",
252 + target_os = "tvos",
253 + target_os = "visionos",
254 + target_os = "android"
255 +))]
256 fn make_progress(model_id: &str, downloaded: u64, total: u64, done: bool) -> ModelDownloadProgress {
257 let progress = if total > 0 {
258 (downloaded as f64 / total as f64).min(1.0)
@@ -878,7 +884,12 @@ pub fn list_supported_hf_models() -> SupportedHfModelsResponse {
884
885 // ── Apple (macOS + iOS): Metal-accelerated, all model types ─────────────────
886
881 -#[cfg(any(target_os = "macos", target_os = "ios"))]
887 +#[cfg(any(
888 + target_os = "macos",
889 + target_os = "ios",
890 + target_os = "tvos",
891 + target_os = "visionos"
892 +))]
893 pub async fn download_model<F>(
894 model_id: String,
895 on_progress: F,
@@ -1181,7 +1192,13 @@ where
1192
1193 // ── Other platforms: no-op ────────────────────────────────────────────────
1194
1184 -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "android")))]
1195 +#[cfg(not(any(
1196 + target_os = "macos",
1197 + target_os = "ios",
1198 + target_os = "tvos",
1199 + target_os = "visionos",
1200 + target_os = "android"
1201 +)))]
1202 pub async fn download_model<F>(
1203 model_id: String,
1204 _on_progress: F,
src/inference/engine.rs
+23 -1
@@ -60,6 +60,7 @@
60 target_os = "macos",
61 target_os = "ios",
62 target_os = "tvos",
63 + target_os = "visionos",
64 target_os = "windows",
65 target_os = "linux",
66 target_os = "android"
@@ -70,6 +71,7 @@ use std::sync::Arc;
71 target_os = "macos",
72 target_os = "ios",
73 target_os = "tvos",
74 + target_os = "visionos",
75 target_os = "windows",
76 target_os = "linux",
77 target_os = "android"
@@ -84,6 +86,7 @@ use super::types::*;
86 target_os = "macos",
87 target_os = "ios",
88 target_os = "tvos",
89 + target_os = "visionos",
90 target_os = "windows",
91 target_os = "linux",
92 target_os = "android"
@@ -101,6 +104,7 @@ use mistralrs::{IsqBits, TextModelBuilder};
104 target_os = "macos",
105 target_os = "ios",
106 target_os = "tvos",
107 + target_os = "visionos",
108 target_os = "windows",
109 target_os = "linux",
110 target_os = "android"
@@ -115,6 +119,7 @@ enum LoadedModelConfig {
119 target_os = "macos",
120 target_os = "ios",
121 target_os = "tvos",
122 + target_os = "visionos",
123 target_os = "windows",
124 target_os = "linux",
125 target_os = "android"
@@ -142,6 +147,7 @@ impl LoadedModelConfig {
147 target_os = "macos",
148 target_os = "ios",
149 target_os = "tvos",
150 + target_os = "visionos",
151 target_os = "windows",
152 target_os = "linux",
153 target_os = "android"
@@ -178,6 +184,7 @@ struct LoadedModel {
184 target_os = "macos",
185 target_os = "ios",
186 target_os = "tvos",
187 + target_os = "visionos",
188 target_os = "windows",
189 target_os = "linux",
190 target_os = "android"
@@ -190,6 +197,7 @@ pub struct ChatEngine {
197 target_os = "macos",
198 target_os = "ios",
199 target_os = "tvos",
200 + target_os = "visionos",
201 target_os = "windows",
202 target_os = "linux",
203 target_os = "android"
@@ -250,7 +258,12 @@ impl ChatEngine {
258 // `HF_HOME` must be set by the host app (via `configure_cache_dir`
259 // or `download_model(app_data_dir:)`) before any model load.
260 // `get_or_init` is a no-op if already seeded — safe to call repeatedly.
253 - #[cfg(any(target_os = "android", target_os = "ios", target_os = "tvos"))]
261 + #[cfg(any(
262 + target_os = "android",
263 + target_os = "ios",
264 + target_os = "tvos",
265 + target_os = "visionos"
266 + ))]
267 {
268 let hf_home = std::env::var("HF_HOME")
269 .map(std::path::PathBuf::from)
@@ -306,6 +319,7 @@ impl ChatEngine {
319 if cfg!(any(
320 target_os = "ios",
321 target_os = "tvos",
322 + target_os = "visionos",
323 target_os = "android"
324 )) {
325 SamplingConfig::mobile()
@@ -814,6 +828,7 @@ impl ChatEngine {
828 target_os = "macos",
829 target_os = "ios",
830 target_os = "tvos",
831 + target_os = "visionos",
832 target_os = "windows",
833 target_os = "linux",
834 target_os = "android"
@@ -833,6 +848,7 @@ impl Default for ChatEngine {
848 target_os = "macos",
849 target_os = "ios",
850 target_os = "tvos",
851 + target_os = "visionos",
852 target_os = "windows",
853 target_os = "linux",
854 target_os = "android"
@@ -864,6 +880,7 @@ fn build_request(loaded: &LoadedModel, user_message: &str) -> RequestBuilder {
880 target_os = "macos",
881 target_os = "ios",
882 target_os = "tvos",
883 + target_os = "visionos",
884 target_os = "windows",
885 target_os = "linux",
886 target_os = "android"
@@ -898,6 +915,7 @@ fn apply_sampling(mut req: RequestBuilder, sampling: &SamplingConfig) -> Request
915 target_os = "macos",
916 target_os = "ios",
917 target_os = "tvos",
918 + target_os = "visionos",
919 target_os = "windows",
920 target_os = "linux",
921 target_os = "android"
@@ -931,6 +949,7 @@ fn truncate_for_log(s: &str, max_len: usize) -> String {
949 target_os = "macos",
950 target_os = "ios",
951 target_os = "tvos",
952 + target_os = "visionos",
953 target_os = "windows",
954 target_os = "linux",
955 target_os = "android"
@@ -941,6 +960,7 @@ pub struct ChatEngine;
960 target_os = "macos",
961 target_os = "ios",
962 target_os = "tvos",
963 + target_os = "visionos",
964 target_os = "windows",
965 target_os = "linux",
966 target_os = "android"
@@ -1027,6 +1047,7 @@ impl ChatEngine {
1047 target_os = "macos",
1048 target_os = "ios",
1049 target_os = "tvos",
1050 + target_os = "visionos",
1051 target_os = "windows",
1052 target_os = "linux",
1053 target_os = "android"
@@ -1134,6 +1155,7 @@ impl GgufModelConfig {
1155 if cfg!(any(
1156 target_os = "ios",
1157 target_os = "tvos",
1158 + target_os = "visionos",
1159 target_os = "android"
1160 )) {
1161 Self::qwen25_coder_1_5b()
src/inference/token.rs
+3
@@ -37,6 +37,7 @@
37 target_os = "macos",
38 target_os = "ios",
39 target_os = "tvos",
40 + target_os = "visionos",
41 target_os = "windows",
42 target_os = "android"
43 ))]
@@ -58,6 +59,7 @@ const BUILD_TIME_HF_TOKEN: Option<&str> = option_env!("HF_TOKEN");
59 target_os = "macos",
60 target_os = "ios",
61 target_os = "tvos",
62 + target_os = "visionos",
63 target_os = "windows",
64 target_os = "android"
65 ))]
@@ -92,6 +94,7 @@ mod tests {
94 target_os = "macos",
95 target_os = "ios",
96 target_os = "tvos",
97 + target_os = "visionos",
98 target_os = "windows",
99 target_os = "android"
100 ))]
src/lib.rs
+1
@@ -53,6 +53,7 @@ uniffi::setup_scaffolding!();
53 target_os = "macos",
54 target_os = "ios",
55 target_os = "tvos",
56 + target_os = "visionos",
57 target_os = "windows",
58 target_os = "linux",
59 target_os = "android"