---
title: "TtsLoadOptions"
sidebar_label: "TtsLoadOptions"
description: "Kotlin binding reference: TtsLoadOptions."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.modelverse](../index.md)/[TtsLoadOptions](index.md)

# TtsLoadOptions

[common]\
data class [TtsLoadOptions](index.md)(val contextLength: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, val scratchDir: &lt;Error class: unknown class&gt;? = null, val modelArgs: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt; = emptyMap(), val revision: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;main&quot;, val cacheDir: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val token: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val offline: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val device: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val weights: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val dtype: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null) : [SourceOptions](../SourceOptions/index.md)

The load-time choices a caller makes for a text-to-speech model.

## Constructors

| | |
|---|---|
| [TtsLoadOptions](TtsLoadOptions.md) | [common]<br>constructor(contextLength: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, scratchDir: &lt;Error class: unknown class&gt;? = null, modelArgs: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt; = emptyMap(), revision: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;main&quot;, cacheDir: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, token: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, offline: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, device: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, weights: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, dtype: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null) |

## Properties

| Name | Summary |
|---|---|
| [cacheDir](cacheDir.md) | [common]<br>open override val [cacheDir](cacheDir.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null |
| [contextLength](contextLength.md) | [common]<br>val [contextLength](contextLength.md): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0<br>The context window in tokens: the longest prompt plus generated speech frames the model's key-value cache opens for. 0 is auto: the largest window that fits the device's free memory beside the weights, bounded by the checkpoint's own; a value names the window, clamped to the checkpoint's. A sentence needs about a thousand tokens; a smaller window is what lets a phone load the model. |
| [device](device.md) | [common]<br>open override val [device](device.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null |
| [dtype](dtype.md) | [common]<br>open override val [dtype](dtype.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null<br>The precision the weights load at: `"float16"` or `"bfloat16"` casts a dense checkpoint's float weights at load (about half the memory of a float32 checkpoint; the cast is best effort, and the stored precision keeps the model as trained) and selects a quantized checkpoint's compute dtype; `null` keeps the checkpoint's own. A load that reads neither meaning refuses naming the loads that do. The same `dtype` the command line's `--dtype` reads. |
| [modelArgs](modelArgs.md) | [common]<br>val [modelArgs](modelArgs.md): [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt;<br>The family's load arguments, as key and value pairs the model library reads at load (the chatterbox family's `t3` set to `v3` or `v2` selects its multilingual line from a snapshot that also holds the English checkpoint). Empty keeps the snapshot's own choice. |
| [offline](offline.md) | [common]<br>open override val [offline](offline.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false |
| [revision](revision.md) | [common]<br>open override val [revision](revision.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) |
| [scratchDir](scratchDir.md) | [common]<br>val [scratchDir](scratchDir.md): &lt;Error class: unknown class&gt;? = null<br>A directory the model may write scratch files into (the app's cache directory): a [VoiceReference.Pcm16](../VoiceReference/Pcm16/index.md) reference is written there as a WAV file the model reads, named by the clip's content so a repeated clip keeps its prepared voice, and removed when the model closes. Null admits [VoiceReference.File](../VoiceReference/File/index.md) references alone; a PCM reference is then refused and ends in [SpeakListener.onError](../SpeakListener/onError.md). |
| [token](token.md) | [common]<br>open override val [token](token.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null |
| [weights](weights.md) | [common]<br>open override val [weights](weights.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null<br>The weight option of a repository that ships several (a GGUF repository with many quantizations): a quantization tag (`Q4_K_M`), a repo-relative `.gguf` file name, or a glob over the option names. Null picks nothing: a repository with one option needs none, one with several refuses naming them. The same `weights` the command line's `--weights` reads. |