Skip to main content

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 delivered by the synheart CLI as SyniRuntime.xcframework (see install steps below)

Installation

Swift Package Manager

CocoaPods

Native runtime

Both install paths ship Swift sources only. Install the native runtime once with the synheart CLI:
This writes SyniRuntime.xcframework to <your-project>/synheart/vendor/syni-runtime/. Add the framework to your Xcode target under General → Frameworks, Libraries, and Embedded Content. The Swift package resolves all C symbols at runtime via dlsym(RTLD_DEFAULT), so the package compiles standalone — calls into the runtime fail with a clear error if the install step hasn’t been run.

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

Wire installState into SwiftUI to surface progress:
Stages: .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).
Synheart-ecosystem apps typically depend on SynheartCore and use SyniModule, which wraps this SDK with those layers. Standalone use of Syni is fully supported when you don’t need the wider Synheart contract.

Models

Out-of-the-box GGUF models exposed under SyniModels:
  • qwen25_15bInstructQ4 (default, ~1.5 GB)
  • qwen2_05bInstructQ4 (~500 MB)
  • gemma3_1bInstructQ4
Pinned SHA-256 per model; verified at install time. Bring your own GGUF via a custom SyniModelSpec. Swift also supports Apple Foundation Models as an execution target where available (.appleFoundationModels in RoutingPolicy.preferredEngines).

API reference