TTSKitConfig.
Basic Configuration
Model Variants
TTSKit supports two Qwen3 TTS model variants:Selecting a Variant
Platform Defaults
TTSKit automatically selects the best model for the current platform:Compute Units
Configure which hardware accelerators each model component uses:Available Compute Units
MLComputeUnits
Run on CPU only. Lower power consumption, slower inference.
MLComputeUnits
Run on CPU and Neural Engine (ANE). Best performance on Apple Silicon.
MLComputeUnits
Run on CPU and GPU. Useful when ANE is unavailable or saturated.
MLComputeUnits
Use all available compute units (CPU, GPU, ANE).
Recommended Settings
Model Loading
Control when and how models are loaded:Prewarm vs Load
- Prewarm
- Load
Prewarm Mode: Compile models one at a time and discard weights to limit peak memory.Use on first launch or after a model update to serialize CoreML compilation.
Model Repository
By default, models are downloaded from the official HuggingFace repo:Custom Model Repository
You can point to a custom HuggingFace repo:Local Models
Skip download and use a local model folder:Model Discovery
Fetch available models from HuggingFace:Download a Model
Explicitly download a model without initializing TTSKit:Seed for Reproducibility
Set a seed for deterministic generation:The seed is XORed with a per-task counter to ensure different samples across calls while maintaining reproducibility within a session.
Logging
Enable verbose logging for debugging:Custom Log Handler
Redirect logs to your own handler:Component Overrides
Replace any model component with a custom implementation:Available Components
Convenience Initializer
TTSKit provides a convenience initializer that exposes all config fields as parameters:Background Downloads
Use a backgroundURLSession for model downloads:
Model State
Track the model lifecycle withmodelState:
Memory Management
Unload models to free memory:Timings
Access detailed timing information:Reset State
Clear timing statistics between runs:Example: Full Configuration
Here’s a complete example with all configuration options:Next Steps
Overview
Return to TTSKit overview
Generation
Learn about generation options