kitten-tts-webgpu
Version:
Run Kitten TTS (80M) locally in the browser via WebGPU. One function call: textToSpeech('Hello!') → WAV blob.
28 lines (27 loc) • 762 B
TypeScript
/** Model configuration derived from ONNX inspection. */
export interface KittenConfig {
symbols: string[];
voiceAliases: Record<string, string>;
sampleRate: number;
}
export declare const DEFAULT_CONFIG: KittenConfig;
/** Parsed weight tensor from ONNX. */
export interface WeightTensor {
name: string;
shape: number[];
dtype: 'float32' | 'float16' | 'int8' | 'uint8';
data: ArrayBuffer;
scale?: Float32Array;
zeroPoint?: Uint8Array | Int8Array;
}
/** Voice embedding data. */
export interface VoiceData {
/** 400 style vectors per voice, each 256-dim float32 */
embeddings: Float32Array;
}
/** GPU buffer with metadata. */
export interface GpuTensor {
buffer: GPUBuffer;
shape: number[];
size: number;
}