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

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

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

# LoadOptions

[common]\
data class [LoadOptions](index.md)(val contextLength: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, val maxActive: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, val thinking: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, 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 generative model. Every field has the library's own default; a zero or a null keeps it.

## Constructors

| | |
|---|---|
| [LoadOptions](LoadOptions.md) | [common]<br>constructor(contextLength: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, maxActive: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, thinking: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, 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 reply the model serves. 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 smaller window shrinks the key-value cache the load allocates, which is what lets a phone load a model whose full window would not fit. A speech model reads it the same way (its decoder's window comes down, never up). |
| [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. |
| [maxActive](maxActive.md) | [common]<br>val [maxActive](maxActive.md): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0<br>The requests the model serves at once: a text model's decode sessions (the key-value cache's slot count a chat session or a served model opens), a speech model's admitted requests. 0 keeps one, the single-session footprint; a phone app keeps it there. |
| [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) |
| [thinking](thinking.md) | [common]<br>val [thinking](thinking.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null<br>The thinking channel of a model whose [Capabilities.thinking](../Capabilities/thinking.md) is [ThinkingControl.TOGGLE](../ThinkingControl/TOGGLE/index.md): `true` renders the prompt with thinking on, `false` with it off, `null` keeps the checkpoint's default. A model with no such switch ignores it; a request may override it per call through [GenerationConfig.thinking](../GenerationConfig/thinking.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. |