TheStageAI/AppleSDK

TheStage AI inference SDK for iOS and MacOS

Swift

29

40 commits

updated Oct 1, 2026

See the code

README

TheStage Apple SDK

On-Device Apple SDK

On-device speech, language, and audio inference for iOS and macOS on Apple Silicon. Engines ship as CoreML bundles from Hugging Face; the SDK picks ANE / GPU / CPU per device. After initialize, inference never leaves the device — there is no server in the hot path.

Version1.5.0 (pin this tag / SwiftPM exact:)
ChecksumsRELEASE.md — binary sha256 and the pinned model packs
PlatformsiOS 18+, macOS 15+, Apple Silicon only
SurfacesNative Swift (TheStageSDK) · Flutter plugin (iOS)
EnginesHugging Face TheStageAI/* @ v1.5
Tokenapp.thestage.ai — online initialize required

Not supported: iOS Simulator, Intel Macs, Android, server-side inference.

Known issues (1.5.0)

  • Voice tool-call streaming / parsing: filler text and tool-call markup can appear interleaved on the same stream, so TTS may start speaking while a tool call is still being recognized or executed. Some edge cases in tool call parsing remain. Planned fix in the next release.
  • iOS 27 memory accounting: iOS 27 charges Neural Engine memory to the app. Large multifunction packs (Gemma-4 E2B) run close to the per-process limit on 12 GB phones in speculative mode; the SDK releases the speculative-only engine views while decoding plain and reloads them for the next speculative call. Switching plain → speculative on a loaded Gemma-4 can still exceed the limit on an iPhone 18 Pro. Stay on one setting per session, or prefer the LFM2.5 packs on iOS 27 devices.

Built for battery — not just tok/s

On-device generation on the Apple Neural Engine draws a fraction of the power of GPU paths like MLX — phones stay cooler, laptops stay on battery, and sustained chat / voice agents remain practical.

Power draw during generation — Gemma3-1B, TheStage ANE vs MLX GPU

Gemma3-1B, sustained load. MacBook M3 Max via macmon; iPhone 13 via battery drain. ~5.1× less power on M3 Max and ~3.5× on iPhone 13 vs MLX (GPU). Lower is better.

Speed and latency charts live under Performance.


Read this first

Humans — do the 60-second Mac quick start, then pick Swift or Flutter under Integrate. Dive into contracts only when something breaks.

Agents / coding assistants — treat this file as the index, then open docs/llms.txt and the linked page for the pipeline you touch. Hard rules:

  1. Always initialize before any pipeline / start_model.
  2. Pin the SDK to tag 1.5.0 (do not float from:).
  3. Pass HF repo ids like "TheStageAI/Qwen3-0.6B" — omit revision unless you intentionally override (defaults track this SDK line).
  4. Audio is mono Float / Float32List in [-1.0, 1.0] — never Float64 / Int16 without converting.
  5. Do not invent device IDs, seat accounting, or crypto details — see licensing.
initialize (online) ──► start_model / Pipeline(...) ──► infer / infer_stream
        │                         │
        │                         ▼
        │              HF download + cache (first time)
        ▼
   process session OK     inference fully on-device

Table of contents

  1. What's in this repo
  2. Capabilities & model fleet
  3. Performance
  4. Quick start
  5. Prerequisites
  6. Integrate
  7. Mental model
  8. Contracts (audio · progress · Swift↔Flutter)
  9. Documentation map
  10. Troubleshooting
  11. Secrets & license

What's in this repo

PathRole
TheStageCore.xcframework/Pre-built binary (ios-arm64 + macos-arm64)
Package.swift + Sources/TheStageSDK/SwiftPM entry — import TheStageSDK
plugin/thestage_apple_sdk/Flutter plugin (iOS only); vendors the xcframework
examples/Demos pinned to this SDK version — see examples/README.md
examples/macos_swift_tts/Start here — native Swift streaming TTS on Mac (no Xcode)
examples/engine_bench/iPhone LLM / TTS / ASR / VLM benches (Hugging Face engines)
examples/voice_agent/Flutter mic → VAD → STT → LLM → TTS with barge-in
examples/voice_agent_custom_nodes/Flutter custom nodes + ephemeral VLM captions
docs/Per-pipeline guides + llms.txt agent index
scripts/setup.shOne-time host setup for Flutter examples

Capabilities & model fleet

Everything below is the production @v1.5 fleet. Pass the HF id as engines_path (or construct the typed pipeline with the same string).

TaskHF enginesSwift entryNotes
Chat LLMTheStageAI/Qwen3-0.6BTheStageLLMAlso gemma-3-1b-it, LFM2.5-230M / 350M
Chat LLM (multimodal root)TheStageAI/gemma-4-E2B-itTSVLMGemma-4 E2B, text-only for now (encoders attach later)
ASRTheStageAI/thewhisper-large-v3-turboWhisperPipelineAlso Qwen3-ASR-0.6B
TTSTheStageAI/neutts-nano-multilingualNeuTTSMultilingualPipelinePrefer nano for voice agents
TTSTheStageAI/Qwen3-TTS-12Hz-0.6B-BaseQwen3TTSPipelineAuto-routed from bundle layout
VADTheStageAI/silero-vadSileroVAD512-sample chunks @ 16 kHz
Turn detectTheStageAI/smart-turn-v3via TheStageVoiceAgentDNN end-of-turn
Speaker IDTheStageAI/redimnet2SpeakerEmbedding192-d embedding, 2 s window
Full agentcompose aboveTheStageVoiceAgentSee voice_agent.md

Out of this release (do not pin in new apps): full neutts-multilingual, English espeak neutts / NeuTTSNanoPipeline, wake-word, VLM / YOLO.

Model cards (contracts + acknowledgments): huggingface.co/TheStageAI.


Performance

Release-build comparisons vs common on-device stacks. Device class and thermals matter — treat these as relative guidance, not an SLA.

Decode throughput vs MLX (GPU)

Gemma-3-1B-it tokens/sec across iPhones — TheStage on ANE vs MLX on GPU (higher is better):

Gemma-3-1B-it decode speed — TheStage AI vs MLX GPU

Time to first token

LFM2.5-350M TTFT — TheStage stays in the low teens of ms while MLX stretches on older phones (lower is better):

LFM2.5-350M time to first token — TheStage AI vs MLX GPU

ANE runtime bake-off (same chip)

Qwen3-0.6B on iPhone 17 Pro, all paths on the Neural Engine — TheStage SDK vs CoreML-LLM and CoreAI (higher is better):

Qwen3-0.6B decode speed — ANE runtimes on iPhone 17 Pro

Power / efficiency (intro highlight): Built for battery.


Quick start

60 seconds on Mac (no Xcode, no device)

cd examples/macos_swift_tts
export TS_API_TOKEN=th_…          # from app.thestage.ai
swift run

First run downloads NeuTTS engines and caches them; later runs start cold from disk. Playback-only — no mic permission. Details: examples/macos_swift_tts/README.md.

Physical iPhone (Flutter)

./scripts/setup.sh                # idempotent; espeak only if you need nano-EN
cp examples/voice_agent/secrets.example.json \
   examples/voice_agent/secrets.json
# edit secrets.json → TS_API_TOKEN

In Xcode (examples/voice_agent/ios/Runner.xcodeproj): set Team + unique Bundle Identifier, then:

cd examples/voice_agent
flutter pub get
flutter run --release \
    --dart-define-from-file=secrets.json \
    -d <YOUR_IPHONE_DEVICE_ID>

examples/voice_agent is the same recipe (+ OPENAI_API_KEY if you use the cloud LLM provider).


Prerequisites

RequirementMinimumNotes
macOS15.0Apple Silicon Mac
iOS18.0Physical iPhone / iPad
Xcode16.0For device signing / iOS apps
Swift6.0SwiftPM
Flutter / Dart3.24 / 3.5Flutter examples + plugin only
Networkonce per processRequired for initialize and first engine download
# Flutter path only
brew install flutter
flutter config --enable-swift-package-manager

Integrate

Native Swift (iOS + macOS)

Xcode → File → Add Package Dependencies… → this repo URL → product TheStageSDK. Or:

.package(
    url: "https://github.com/TheStageAI/AppleSDK.git",
    exact: Version(1, 5, 0)
)
import TheStageSDK

let ai = TheStageAI.shared
try await ai.initialize(api_token: "th_…")

let llm = try await TheStageLLM(
    engines_path: "TheStageAI/Qwen3-0.6B",
    on_load_progress: { p in
        print("[\(p.model)] \(p.phase) \(Int(p.fraction * 100))%")
    }
)

let result = llm.infer(
    prompt: "Give me a one-line haiku about Swift.",
    max_new_tokens: 64
)
print(result.text)

Two ways to drive models (same cache, same progress events):

StyleWhen to use
Typed pipelines (TheStageLLM(...), WhisperPipeline(...), …)Native Swift apps — compile-time APIs
TheStageAI.shared.start_model / infer / infer_streamJSON lifecycle, Flutter, dynamic model sets

Flutter (iOS)

dependencies:
  thestage_apple_sdk:
    git:
      url: https://github.com/TheStageAI/AppleSDK.git
      path: plugin/thestage_apple_sdk
      ref: 1.5.0
flutter config --enable-swift-package-manager
# Xcode → Runner → Minimum Deployments → iOS 18.0
import 'package:thestage_apple_sdk/thestage_apple_sdk.dart';

await TheStageFlutterSDK.initialize(api_token: 'th_…');

await TheStageFlutterSDK.start_model(
  model_name: 'llm',
  engines_path: 'TheStageAI/Qwen3-0.6B',
);

final result = await TheStageFlutterSDK.infer(
  model_name: 'llm',
  input_json: {
    'prompt': 'Give me a one-line haiku about Swift.',
    'max_new_tokens': 64,
  },
);
print(result[0]['text']);

More: plugin README. Fastest path to a working UI: copy an examples/ app.


Mental model

Lifecycle

  1. initialize(api_token:) — online token check + device seat registration. Fails offline / on network errors. Once per process when reachable; after success, inference is on-device for that process.
  2. Load — Pipeline(engines_path:) or start_model(...). First hit downloads the HF revision for this SDK line into Application Support (not purged by iOS, excluded from iCloud backup).
  3. Infer — batch infer or streaming infer_stream / TTS streamer.
  4. Stop — stop_model / drop pipeline references to free memory.

Revisions

Omit revision: in normal apps. This build resolves HF tags via an internal map aligned with SDK 1.5.0 → fleet v1.5. Override only when you intentionally pin an older engine tag.

Init & seats (product)


Contracts

Audio I/O

All public audio is PCM mono, samples in [-1.0, 1.0].

PipelineDirectionRateFraming
SileroVADin16 kHzexactly 512 samples / call (stateful)
WhisperPipeline / Qwen3-ASRin16 kHzany length; SDK windows long audio
NeuTTS / Qwen3-TTSout24 kHzstreamer = chunks; batch = one buffer
SpeakerEmbeddingin16 kHz2.0 s window (pad/trim)

Prefer tts.sample_rate over hardcoding. Mic path for agents is 16 kHz; TTS playback is 24 kHz — resample at the edge if you mix them.

Swift: [Float] · Flutter: Float32List only.

Load progress

Optional on_load_progress (Swift) / TheStageFlutterSDK.on_progress (Flutter). Phases are monotonic 0...1:

PhaseBandNotes
downloading0.00 – 0.70HF fetch (skipped on cache hit)
extracting0.70 – 0.85Unpack (skipped on cache hit)
loading0.85 – 0.99Pipeline construction
ready1.00Success only

Swift ↔ Flutter parity

OperationSwiftFlutter
InitializeTheStageAI.shared.initialize(api_token:)TheStageFlutterSDK.initialize(api_token:)
Startai.start_model(...)start_model(...)
Stopai.stop_model(model_name:)stop_model(model_name:)
Batchai.infer(model_name:input_json:)infer(...)
Streamai.infer_stream(...) → AsyncStreaminfer_stream(...) → Stream
TTS pushstreamer.send / stop_streamsend / finish_stream / stop_stream
Progressper-call on_load_progressglobal on_progress
Typed pipelinesyesno — JSON path only

Naming trap: Swift apiToken: vs Flutter api_token:.


Documentation map

DocOpen when you need…
docs/llms.txtAgent-oriented symbol + page index
llm.mdChat, streaming tokens, sampling, KV
asr.mdTheWhisper + Qwen3-ASR: clips, live captions, languages
vlm.mdImage + prompt → text
tts.mdNeuTTS + Qwen3-TTS, voices, streaming
vad.mdSilero chunk contract
audio_nodes.mdDefault audio, custom PCM providers, node graph
streaming.mdBack-pressure, sentence segmentation
voice_agent.mdFull loop, barge-in, smart-turn knobs
loading.mdload_models, warm-up, staying specialized
types.mdShared configs, results, SamplingParams
speaker_embedding.mdEnroll / verify
licensing.mdToken, seats, offline rules
logging.mdSupport breadcrumbs
product_terms.mdCommercial / legal pointer

Troubleshooting

SymptomLikely causeFix
notInitialized / pipelines throw at constructForgot initializeCall it once at app start (online)
Init fails offline / flaky networkOnline validation requiredReconnect; retry initialize
Simulator build / Metal errorsSimulator unsupportedUse a physical device or Apple Silicon Mac
First infer very slowHF downloadWait for ready; later runs use cache
Flutter audio glitches / NaNsFloat64List or wrong rateUse Float32List; match table above
TTS / ASR “wrong” model typeBundle auto-routePass the correct HF repo; see tts.md
SwiftPM / plugin resolve failsFloating versionPin exact: / ref: 1.5.0
Voice agent never commits turnThresholds / modeSee smart-turn knobs in voice_agent.md
Tool call + spoken filler overlap / odd parseKnown streaming gap this releaseSee Known issues above; fix planned next release

Secrets & license

Flutter examples load tokens via --dart-define-from-file=secrets.json (from secrets.example.json). Keep real keys out of git. The macOS example uses TS_API_TOKEN in the environment.

License: LICENSE. Commercial terms: product_terms.md.

TheStageAI/AppleSDK

TheStage AI inference SDK for iOS and MacOS

Swift

29

40 commits

updated Oct 1, 2026

See the code

README

TheStage Apple SDK

On-Device Apple SDK

On-device speech, language, and audio inference for iOS and macOS on Apple Silicon. Engines ship as CoreML bundles from Hugging Face; the SDK picks ANE / GPU / CPU per device. After initialize, inference never leaves the device — there is no server in the hot path.

Version1.5.0 (pin this tag / SwiftPM exact:)
ChecksumsRELEASE.md — binary sha256 and the pinned model packs
PlatformsiOS 18+, macOS 15+, Apple Silicon only
SurfacesNative Swift (TheStageSDK) · Flutter plugin (iOS)
EnginesHugging Face TheStageAI/* @ v1.5
Tokenapp.thestage.ai — online initialize required

Not supported: iOS Simulator, Intel Macs, Android, server-side inference.

Known issues (1.5.0)

  • Voice tool-call streaming / parsing: filler text and tool-call markup can appear interleaved on the same stream, so TTS may start speaking while a tool call is still being recognized or executed. Some edge cases in tool call parsing remain. Planned fix in the next release.
  • iOS 27 memory accounting: iOS 27 charges Neural Engine memory to the app. Large multifunction packs (Gemma-4 E2B) run close to the per-process limit on 12 GB phones in speculative mode; the SDK releases the speculative-only engine views while decoding plain and reloads them for the next speculative call. Switching plain → speculative on a loaded Gemma-4 can still exceed the limit on an iPhone 18 Pro. Stay on one setting per session, or prefer the LFM2.5 packs on iOS 27 devices.

Built for battery — not just tok/s

On-device generation on the Apple Neural Engine draws a fraction of the power of GPU paths like MLX — phones stay cooler, laptops stay on battery, and sustained chat / voice agents remain practical.

Power draw during generation — Gemma3-1B, TheStage ANE vs MLX GPU

Gemma3-1B, sustained load. MacBook M3 Max via macmon; iPhone 13 via battery drain. ~5.1× less power on M3 Max and ~3.5× on iPhone 13 vs MLX (GPU). Lower is better.

Speed and latency charts live under Performance.


Read this first

Humans — do the 60-second Mac quick start, then pick Swift or Flutter under Integrate. Dive into contracts only when something breaks.

Agents / coding assistants — treat this file as the index, then open docs/llms.txt and the linked page for the pipeline you touch. Hard rules:

  1. Always initialize before any pipeline / start_model.
  2. Pin the SDK to tag 1.5.0 (do not float from:).
  3. Pass HF repo ids like "TheStageAI/Qwen3-0.6B" — omit revision unless you intentionally override (defaults track this SDK line).
  4. Audio is mono Float / Float32List in [-1.0, 1.0] — never Float64 / Int16 without converting.
  5. Do not invent device IDs, seat accounting, or crypto details — see licensing.
initialize (online) ──► start_model / Pipeline(...) ──► infer / infer_stream
        │                         │
        │                         ▼
        │              HF download + cache (first time)
        ▼
   process session OK     inference fully on-device

Table of contents

  1. What's in this repo
  2. Capabilities & model fleet
  3. Performance
  4. Quick start
  5. Prerequisites
  6. Integrate
  7. Mental model
  8. Contracts (audio · progress · Swift↔Flutter)
  9. Documentation map
  10. Troubleshooting
  11. Secrets & license

What's in this repo

PathRole
TheStageCore.xcframework/Pre-built binary (ios-arm64 + macos-arm64)
Package.swift + Sources/TheStageSDK/SwiftPM entry — import TheStageSDK
plugin/thestage_apple_sdk/Flutter plugin (iOS only); vendors the xcframework
examples/Demos pinned to this SDK version — see examples/README.md
examples/macos_swift_tts/Start here — native Swift streaming TTS on Mac (no Xcode)
examples/engine_bench/iPhone LLM / TTS / ASR / VLM benches (Hugging Face engines)
examples/voice_agent/Flutter mic → VAD → STT → LLM → TTS with barge-in
examples/voice_agent_custom_nodes/Flutter custom nodes + ephemeral VLM captions
docs/Per-pipeline guides + llms.txt agent index
scripts/setup.shOne-time host setup for Flutter examples

Capabilities & model fleet

Everything below is the production @v1.5 fleet. Pass the HF id as engines_path (or construct the typed pipeline with the same string).

TaskHF enginesSwift entryNotes
Chat LLMTheStageAI/Qwen3-0.6BTheStageLLMAlso gemma-3-1b-it, LFM2.5-230M / 350M
Chat LLM (multimodal root)TheStageAI/gemma-4-E2B-itTSVLMGemma-4 E2B, text-only for now (encoders attach later)
ASRTheStageAI/thewhisper-large-v3-turboWhisperPipelineAlso Qwen3-ASR-0.6B
TTSTheStageAI/neutts-nano-multilingualNeuTTSMultilingualPipelinePrefer nano for voice agents
TTSTheStageAI/Qwen3-TTS-12Hz-0.6B-BaseQwen3TTSPipelineAuto-routed from bundle layout
VADTheStageAI/silero-vadSileroVAD512-sample chunks @ 16 kHz
Turn detectTheStageAI/smart-turn-v3via TheStageVoiceAgentDNN end-of-turn
Speaker IDTheStageAI/redimnet2SpeakerEmbedding192-d embedding, 2 s window
Full agentcompose aboveTheStageVoiceAgentSee voice_agent.md

Out of this release (do not pin in new apps): full neutts-multilingual, English espeak neutts / NeuTTSNanoPipeline, wake-word, VLM / YOLO.

Model cards (contracts + acknowledgments): huggingface.co/TheStageAI.


Performance

Release-build comparisons vs common on-device stacks. Device class and thermals matter — treat these as relative guidance, not an SLA.

Decode throughput vs MLX (GPU)

Gemma-3-1B-it tokens/sec across iPhones — TheStage on ANE vs MLX on GPU (higher is better):

Gemma-3-1B-it decode speed — TheStage AI vs MLX GPU

Time to first token

LFM2.5-350M TTFT — TheStage stays in the low teens of ms while MLX stretches on older phones (lower is better):

LFM2.5-350M time to first token — TheStage AI vs MLX GPU

ANE runtime bake-off (same chip)

Qwen3-0.6B on iPhone 17 Pro, all paths on the Neural Engine — TheStage SDK vs CoreML-LLM and CoreAI (higher is better):

Qwen3-0.6B decode speed — ANE runtimes on iPhone 17 Pro

Power / efficiency (intro highlight): Built for battery.


Quick start

60 seconds on Mac (no Xcode, no device)

cd examples/macos_swift_tts
export TS_API_TOKEN=th_…          # from app.thestage.ai
swift run

First run downloads NeuTTS engines and caches them; later runs start cold from disk. Playback-only — no mic permission. Details: examples/macos_swift_tts/README.md.

Physical iPhone (Flutter)

./scripts/setup.sh                # idempotent; espeak only if you need nano-EN
cp examples/voice_agent/secrets.example.json \
   examples/voice_agent/secrets.json
# edit secrets.json → TS_API_TOKEN

In Xcode (examples/voice_agent/ios/Runner.xcodeproj): set Team + unique Bundle Identifier, then:

cd examples/voice_agent
flutter pub get
flutter run --release \
    --dart-define-from-file=secrets.json \
    -d <YOUR_IPHONE_DEVICE_ID>

examples/voice_agent is the same recipe (+ OPENAI_API_KEY if you use the cloud LLM provider).


Prerequisites

RequirementMinimumNotes
macOS15.0Apple Silicon Mac
iOS18.0Physical iPhone / iPad
Xcode16.0For device signing / iOS apps
Swift6.0SwiftPM
Flutter / Dart3.24 / 3.5Flutter examples + plugin only
Networkonce per processRequired for initialize and first engine download
# Flutter path only
brew install flutter
flutter config --enable-swift-package-manager

Integrate

Native Swift (iOS + macOS)

Xcode → File → Add Package Dependencies… → this repo URL → product TheStageSDK. Or:

.package(
    url: "https://github.com/TheStageAI/AppleSDK.git",
    exact: Version(1, 5, 0)
)
import TheStageSDK

let ai = TheStageAI.shared
try await ai.initialize(api_token: "th_…")

let llm = try await TheStageLLM(
    engines_path: "TheStageAI/Qwen3-0.6B",
    on_load_progress: { p in
        print("[\(p.model)] \(p.phase) \(Int(p.fraction * 100))%")
    }
)

let result = llm.infer(
    prompt: "Give me a one-line haiku about Swift.",
    max_new_tokens: 64
)
print(result.text)

Two ways to drive models (same cache, same progress events):

StyleWhen to use
Typed pipelines (TheStageLLM(...), WhisperPipeline(...), …)Native Swift apps — compile-time APIs
TheStageAI.shared.start_model / infer / infer_streamJSON lifecycle, Flutter, dynamic model sets

Flutter (iOS)

dependencies:
  thestage_apple_sdk:
    git:
      url: https://github.com/TheStageAI/AppleSDK.git
      path: plugin/thestage_apple_sdk
      ref: 1.5.0
flutter config --enable-swift-package-manager
# Xcode → Runner → Minimum Deployments → iOS 18.0
import 'package:thestage_apple_sdk/thestage_apple_sdk.dart';

await TheStageFlutterSDK.initialize(api_token: 'th_…');

await TheStageFlutterSDK.start_model(
  model_name: 'llm',
  engines_path: 'TheStageAI/Qwen3-0.6B',
);

final result = await TheStageFlutterSDK.infer(
  model_name: 'llm',
  input_json: {
    'prompt': 'Give me a one-line haiku about Swift.',
    'max_new_tokens': 64,
  },
);
print(result[0]['text']);

More: plugin README. Fastest path to a working UI: copy an examples/ app.


Mental model

Lifecycle

  1. initialize(api_token:) — online token check + device seat registration. Fails offline / on network errors. Once per process when reachable; after success, inference is on-device for that process.
  2. Load — Pipeline(engines_path:) or start_model(...). First hit downloads the HF revision for this SDK line into Application Support (not purged by iOS, excluded from iCloud backup).
  3. Infer — batch infer or streaming infer_stream / TTS streamer.
  4. Stop — stop_model / drop pipeline references to free memory.

Revisions

Omit revision: in normal apps. This build resolves HF tags via an internal map aligned with SDK 1.5.0 → fleet v1.5. Override only when you intentionally pin an older engine tag.

Init & seats (product)


Contracts

Audio I/O

All public audio is PCM mono, samples in [-1.0, 1.0].

PipelineDirectionRateFraming
SileroVADin16 kHzexactly 512 samples / call (stateful)
WhisperPipeline / Qwen3-ASRin16 kHzany length; SDK windows long audio
NeuTTS / Qwen3-TTSout24 kHzstreamer = chunks; batch = one buffer
SpeakerEmbeddingin16 kHz2.0 s window (pad/trim)

Prefer tts.sample_rate over hardcoding. Mic path for agents is 16 kHz; TTS playback is 24 kHz — resample at the edge if you mix them.

Swift: [Float] · Flutter: Float32List only.

Load progress

Optional on_load_progress (Swift) / TheStageFlutterSDK.on_progress (Flutter). Phases are monotonic 0...1:

PhaseBandNotes
downloading0.00 – 0.70HF fetch (skipped on cache hit)
extracting0.70 – 0.85Unpack (skipped on cache hit)
loading0.85 – 0.99Pipeline construction
ready1.00Success only

Swift ↔ Flutter parity

OperationSwiftFlutter
InitializeTheStageAI.shared.initialize(api_token:)TheStageFlutterSDK.initialize(api_token:)
Startai.start_model(...)start_model(...)
Stopai.stop_model(model_name:)stop_model(model_name:)
Batchai.infer(model_name:input_json:)infer(...)
Streamai.infer_stream(...) → AsyncStreaminfer_stream(...) → Stream
TTS pushstreamer.send / stop_streamsend / finish_stream / stop_stream
Progressper-call on_load_progressglobal on_progress
Typed pipelinesyesno — JSON path only

Naming trap: Swift apiToken: vs Flutter api_token:.


Documentation map

DocOpen when you need…
docs/llms.txtAgent-oriented symbol + page index
llm.mdChat, streaming tokens, sampling, KV
asr.mdTheWhisper + Qwen3-ASR: clips, live captions, languages
vlm.mdImage + prompt → text
tts.mdNeuTTS + Qwen3-TTS, voices, streaming
vad.mdSilero chunk contract
audio_nodes.mdDefault audio, custom PCM providers, node graph
streaming.mdBack-pressure, sentence segmentation
voice_agent.mdFull loop, barge-in, smart-turn knobs
loading.mdload_models, warm-up, staying specialized
types.mdShared configs, results, SamplingParams
speaker_embedding.mdEnroll / verify
licensing.mdToken, seats, offline rules
logging.mdSupport breadcrumbs
product_terms.mdCommercial / legal pointer

Troubleshooting

SymptomLikely causeFix
notInitialized / pipelines throw at constructForgot initializeCall it once at app start (online)
Init fails offline / flaky networkOnline validation requiredReconnect; retry initialize
Simulator build / Metal errorsSimulator unsupportedUse a physical device or Apple Silicon Mac
First infer very slowHF downloadWait for ready; later runs use cache
Flutter audio glitches / NaNsFloat64List or wrong rateUse Float32List; match table above
TTS / ASR “wrong” model typeBundle auto-routePass the correct HF repo; see tts.md
SwiftPM / plugin resolve failsFloating versionPin exact: / ref: 1.5.0
Voice agent never commits turnThresholds / modeSee smart-turn knobs in voice_agent.md
Tool call + spoken filler overlap / odd parseKnown streaming gap this releaseSee Known issues above; fix planned next release

Secrets & license

Flutter examples load tokens via --dart-define-from-file=secrets.json (from secrets.example.json). Keep real keys out of git. The macOS example uses TS_API_TOKEN in the environment.

License: LICENSE. Commercial terms: product_terms.md.

Significant stargazers

Yuri Khrustalev

70 followers · starred Jun 2026