|
1
|
# Siti AI — visionOS app |
|
2
|
|
|
3
|
A native SwiftUI chat app for visionOS, built directly on the [`onde-swift`](https://github.com/ondeinference/onde-swift) SDK — the same on-device inference engine that powers the Tauri app at the repo root. This is a separate native client, not a Tauri build target; Tauri does not support visionOS. |
|
4
|
|
|
5
|
Project layout and build-target conventions (window sizing, `xros`/`xrsimulator` platform settings, App Group entitlements, solid-image-stack app icon) follow the `SplitFireAIVision` target in the sibling `splitfire` repo (`../splitfire/frontend/xcode/splitfire/SplitFireAI.xcodeproj`). The chat engine wiring (streaming bridge, model lifecycle, conversation persistence) follows `onde-swift`'s own `Examples/OndeExample` app. |
|
6
|
|
|
7
|
## Setup |
|
8
|
|
|
9
|
Install [XcodeGen](https://github.com/yonaskolb/XcodeGen) if you don't have it: |
|
10
|
|
|
11
|
``` |
|
12
|
brew install xcodegen |
|
13
|
``` |
|
14
|
|
|
15
|
Generate the Xcode project and open it: |
|
16
|
|
|
17
|
``` |
|
18
|
cd xcode |
|
19
|
xcodegen generate |
|
20
|
open SitiVision.xcodeproj |
|
21
|
``` |
|
22
|
|
|
23
|
Set your development team under Signing & Capabilities (defaults to `2TQF86ZACD`, the same team as the Tauri app's iOS build — see `../src-tauri/tauri.conf.json`), pick a Vision Pro simulator or device, hit Run. |
|
24
|
|
|
25
|
### Developing against a local `onde-swift` checkout |
|
26
|
|
|
27
|
By default `project.yml` pulls `Onde` from the published `onde-swift` releases (`from: 1.1.0`), the same way `src-tauri/Cargo.toml` pins `onde = "1.1"` from crates.io. To iterate against a sibling `onde-swift` checkout instead — e.g. while adding a new SDK method — point the package at a local path the same way the Rust side's `[patch.crates-io]` block does: |
|
28
|
|
|
29
|
```yaml |
|
30
|
packages: |
|
31
|
Onde: |
|
32
|
path: ../../onde-swift |
|
33
|
``` |
|
34
|
|
|
35
|
Then, from that `onde-swift` checkout, build the visionOS slice before regenerating: |
|
36
|
|
|
37
|
``` |
|
38
|
make visionos |
|
39
|
``` |
|
40
|
|
|
41
|
`make visionos` needs the sibling `onde` Rust crate checked out next to `onde-swift` (`ONDE_REPO` defaults to `../onde`) and a nightly Rust toolchain with `-Z build-std`, since visionOS is a tier-3 target. |
|
42
|
|
|
43
|
## What it does |
|
44
|
|
|
45
|
On first launch, it downloads and loads the platform-default model (Qwen 2.5 3B on visionOS, same tier as macOS) and streams replies token-by-token. Conversations persist locally between launches. The model cache lives in the shared `group.com.ondeinference.apps` App Group, so a model already downloaded by the Tauri macOS/iOS build of Siti is reused here instead of being fetched twice. |
|
46
|
|
|
47
|
Current MVP feature set (mirrors `onde-swift`'s example app, reskinned for Siti): |
|
48
|
|
|
49
|
- token-by-token streaming with a stop button |
|
50
|
- local conversation persistence between launches |
|
51
|
- model settings sheet for system prompt + sampling preset |
|
52
|
- toolbar actions to reload the model or clear the conversation |
|
53
|
- prompt suggestions when the conversation is empty |
|
54
|
|
|
55
|
Not yet done: a real visionOS-native layout (ornaments, volumes, spatial windows) — this MVP is a single glass `WindowGroup`, functionally equivalent to the iOS/macOS chat view. Immersive-space exploration is a good next step once the 2D chat flow is verified end-to-end. |
|
56
|
|
|
57
|
## Files |
|
58
|
|
|
59
|
| File | What's in it | |
|
60
|
|------|---------------| |
|
61
|
| `SitiVisionApp.swift` | Entry point. Calls `setupInferenceEnvironment()` at launch, sizes the default window. | |
|
62
|
| `ContentView.swift` | The chat UI: header, empty state, message list, input bar, reload/clear actions, settings sheet. | |
|
63
|
| `ChatViewModel.swift` | Bridges UniFFI streaming into Swift concurrency, manages model lifecycle, restores history, persists conversation. | |
|
64
|
| `SitiDefaults.swift` | Siti's system prompt (mirrors `../src-tauri/src/chat/mod.rs`'s `CHAT_SYSTEM_PROMPT`), sampling presets, prompt suggestions. | |
|
65
|
| `InferenceEnvironment.swift` | Points `HF_HOME`/`TMPDIR` at the shared App Group container so downloads land somewhere visionOS allows and are shared with the Tauri build. | |
|
66
|
| `SitiVision.entitlements` | Generated by `xcodegen generate` from `project.yml`'s `entitlements.properties` — do not hand-edit, it's overwritten on every generate. | |
|
67
|
| `project.yml` | XcodeGen spec. `SitiVision.xcodeproj` is generated from this, not checked in. | |