Documentation Index
Fetch the complete documentation index at: https://docs.synheart.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
syni-swift is the iOS / macOS consumer SDK for Syni. Same agent surface as the Flutter sibling and the Kotlin sibling, idiomatic for Swift (async/await, AsyncThrowingStream<SyniChatEvent, Error> for streaming, Combine AnyPublisher<SyniInstallState, Never> for the install lifecycle).
Platform support
- iOS 16.0+ · macOS 13.0+
- Swift 5.9+ · Xcode 15+
- Native runtime ships as
SyniRuntime.xcframework(built locally viaScripts/build-xcframework.shfor path-dep consumers; binary target on releases)
Installation
./Scripts/build-xcframework.sh once to produce the native runtime (~5 min; see the script for toolchain prerequisites).
Basic usage
Streaming
chatStream returns an AsyncThrowingStream<SyniChatEvent, Error> — token-level .delta events followed by exactly one .final carrying the structured response.
Hybrid local / cloud
SyniExecutionMode cases: .localFirst (default), .cloudFirst, .localOnly, .cloudOnly.
Install lifecycle
WireinstallState into SwiftUI to surface progress:
.downloadingModel → .verifyingModel → .loadingEngine → .bindingPersona.
Where this fits
syni-swift is the agent layer — inference, install lifecycle, persona binding, chat orchestration. It does NOT own:
- HSI signal collection (the synheart-core SDK does), or
- the four-authority gate (consent + capability + activation + session; also a host concern).
SynheartCore and use SyniModule, which wraps this SDK with those layers. Standalone use of SyniSwift is fully supported when you don’t need the wider Synheart contract.
Models
Out-of-the-box GGUF models exposed underSyniModels:
qwen25_15bInstructQ4(default, ~1.5 GB)qwen2_05bInstructQ4(~500 MB)gemma3_1bInstructQ4
SyniModelSpec. Swift also supports Apple Foundation Models as an execution target where available (.appleFoundationModels in RoutingPolicy.preferredEngines).
API reference
| Surface | Notes |
|---|---|
SyniAgent | Constructed with optional installer / cloudConfig. Exposes installState / currentState / isInstalled / hasCloud. |
SyniAgent.install / restoreInstallIfReady / uninstall / dispose | async / throws; emit install-state transitions. |
SyniAgent.chat / chatStream | async throws / AsyncThrowingStream<SyniChatEvent, Error>. |
SyniInstallState | Enum: .notInstalled, .installing(stage:progress:), .installed(...), .failed(reason:cause:). |
SyniChatResponse | displayText, message, suggestions, kind (.chat / .coach / .suggestions / .unknown). |
SyniSpecPersona | load(id) — bundled persona JSON. |
SyniModelCatalog | List local + cloud model options; bundled defaults under SyniModelCatalog.bundled. |
SyniCloudConfig | baseUrl, authToken: () -> String?, tenantId, userId. |
SyniExecutionMode | .localFirst, .cloudFirst, .localOnly, .cloudOnly. |
Related
- Syni overview
- Syni spec
- synheart-core/swift — host SDK with
SyniModuleconsent gate