|
1
|
[package] |
|
2
|
name = "onde" |
|
3
|
version = "1.1.2" |
|
4
|
edition = "2021" |
|
5
|
description = "On-device inference engine for Apple silicon." |
|
6
|
license = "MIT OR Apache-2.0" |
|
7
|
repository = "https://github.com/ondeinference/onde" |
|
8
|
homepage = "https://ondeinference.com" |
|
9
|
documentation = "https://docs.rs/onde" |
|
10
|
readme = "README.md" |
|
11
|
keywords = ["inference", "on-device", "chat", "llm", "mistral"] |
|
12
|
categories = ["artificial-intelligence", "api-bindings"] |
|
13
|
|
|
14
|
[lib] |
|
15
|
name = "onde" |
|
16
|
# "lib" – normal Rust dependency for other crates. |
|
17
|
# "cdylib" – shared library (.dylib / .so / .dll) consumed by UniFFI bindgen |
|
18
|
# to generate Swift / Kotlin / Python bindings. |
|
19
|
# "staticlib" – static library (.a) required for iOS targets where dynamic |
|
20
|
# linking is not allowed. |
|
21
|
crate-type = ["lib", "cdylib", "staticlib"] |
|
22
|
|
|
23
|
|
|
24
|
# Android: CPU-only GGUF inference via candle; also needs hf-hub and |
|
25
|
# mistralrs-core for explicit cache path seeding (dirs::home_dir() panics |
|
26
|
# in the Android sandbox). |
|
27
|
[target.'cfg(target_os = "android")'.dependencies] |
|
28
|
hf-hub = { version = "0.4", features = ["tokio", "rustls-tls"], default-features = false } |
|
29
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs", features = [] } |
|
30
|
mistralrs-core = { version = "0.8.2", package = "onde-mistralrs-core", features = [] } |
|
31
|
|
|
32
|
# iOS: Metal-accelerated inference; hf-hub + mistralrs-core needed for |
|
33
|
# GLOBAL_HF_CACHE sandbox workaround (~/.cache is outside the container). |
|
34
|
[target.'cfg(target_os = "ios")'.dependencies] |
|
35
|
hf-hub = { version = "0.4", features = ["tokio", "rustls-tls"], default-features = false } |
|
36
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs", features = ["metal"] } |
|
37
|
mistralrs-core = { version = "0.8.2", package = "onde-mistralrs-core", features = ["metal"] } |
|
38
|
|
|
39
|
# Linux: CPU-only baseline (no GPU features). |
|
40
|
# For NVIDIA GPU builds, patch this to features = ["cuda"] in CI before building. |
|
41
|
[target.'cfg(target_os = "linux")'.dependencies] |
|
42
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs" } |
|
43
|
|
|
44
|
# macOS: Metal-accelerated inference. |
|
45
|
[target.'cfg(target_os = "macos")'.dependencies] |
|
46
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs", features = ["metal"] } |
|
47
|
|
|
48
|
# tvOS: Metal-accelerated inference (Apple TV has Apple GPU); hf-hub + |
|
49
|
# mistralrs-core needed for GLOBAL_HF_CACHE sandbox workaround. |
|
50
|
[target.'cfg(target_os = "tvos")'.dependencies] |
|
51
|
hf-hub = { version = "0.4", features = ["tokio", "rustls-tls"], default-features = false } |
|
52
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs", features = ["metal"] } |
|
53
|
mistralrs-core = { version = "0.8.2", package = "onde-mistralrs-core", features = ["metal"] } |
|
54
|
|
|
55
|
# visionOS: Metal-accelerated inference (Apple Vision Pro has M2 GPU); |
|
56
|
# hf-hub + mistralrs-core needed for GLOBAL_HF_CACHE sandbox workaround. |
|
57
|
[target.'cfg(target_os = "visionos")'.dependencies] |
|
58
|
hf-hub = { version = "0.4", features = ["tokio", "rustls-tls"], default-features = false } |
|
59
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs", features = ["metal"] } |
|
60
|
mistralrs-core = { version = "0.8.2", package = "onde-mistralrs-core", features = ["metal"] } |
|
61
|
|
|
62
|
# watchOS: Metal-accelerated inference (Apple Watch Series 4+ has Apple GPU); |
|
63
|
# hf-hub + mistralrs-core needed for GLOBAL_HF_CACHE sandbox workaround. |
|
64
|
# Memory constrained — default to 1.5B model. |
|
65
|
[target.'cfg(target_os = "watchos")'.dependencies] |
|
66
|
hf-hub = { version = "0.4", features = ["tokio", "rustls-tls"], default-features = false } |
|
67
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs", features = ["metal"] } |
|
68
|
mistralrs-core = { version = "0.8.2", package = "onde-mistralrs-core", features = ["metal"] } |
|
69
|
|
|
70
|
# Windows: CPU-only baseline (no GPU features). |
|
71
|
# For NVIDIA GPU builds, patch this to features = ["cuda"] in CI before building. |
|
72
|
[target.'cfg(target_os = "windows")'.dependencies] |
|
73
|
mistralrs = { version = "0.8.2", package = "onde-mistralrs" } |
|
74
|
|
|
75
|
[dependencies] |
|
76
|
anyhow = "1" |
|
77
|
home = "0.5.4" |
|
78
|
log = "^0.4" |
|
79
|
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } |
|
80
|
serde = { version = "1.0", features = ["derive"] } |
|
81
|
serde_json = "1" |
|
82
|
|
|
83
|
thiserror = "2" |
|
84
|
tokio = { version = "1", features = ["macros", "rt", "sync"] } |
|
85
|
tsync = "2" |
|
86
|
|
|
87
|
# Pinned to =0.31.0 — the versions MUST be identical across the crate and |
|
88
|
# the uniffi-bindgen binary crate. |
|
89
|
uniffi = { version = "=0.31.0", features = ["tokio"] } |
|
90
|
|
|
91
|
[dependencies.smbcloud-gresiq-sdk] |
|
92
|
version = "0.3" |
|
93
|
# path = "../smbcloud-cli/crates/smbcloud-gresiq-sdk" |
|
94
|
|
|
95
|
[build-dependencies] |
|
96
|
# Used by build.rs to compile the tvOS ___chkstk_darwin assembly stub. |
|
97
|
cc = "1" |
|
98
|
dotenvy = "0.15" |
|
99
|
# Required for UniFFI scaffolding code generation at build time. |
|
100
|
uniffi = { version = "=0.31.0", features = ["build"] } |
|
101
|
|
|
102
|
# ── Local development patches ──────────────────────────────────────────────── |
|
103
|
# |
|
104
|
# [patch.crates-io] is stripped by `cargo publish` and never seen by crates.io |
|
105
|
# consumers. These patches only apply when building from this local checkout. |
|
106
|
# |
|
107
|
# To develop against the mistral.rs git fork locally instead of the published |
|
108
|
# onde-mistralrs crates, uncomment the block below: |
|
109
|
# |
|
110
|
# [patch.crates-io] |
|
111
|
# onde-mistralrs = { git = "https://github.com/setoelkahfi/mistral.rs", branch = "fix/all-platform-fixes", package = "mistralrs" } |
|
112
|
# onde-mistralrs-core = { git = "https://github.com/setoelkahfi/mistral.rs", branch = "fix/all-platform-fixes", package = "mistralrs-core" } |
|
113
|
|
|
114
|
# Patch sysctl with watchOS support until upstream merges it. |
|
115
|
# PR: https://github.com/johalun/sysctl-rs/pull/74 |
|
116
|
# NOTE: [patch.crates-io] is ignored by crates.io consumers — safe to keep. |
|
117
|
[patch.crates-io] |
|
118
|
sysctl = { git = "https://github.com/setoelkahfi/sysctl-rs.git", branch = "feature/watchos" } |