---
title: "Package-level declarations"
sidebar_label: "Package-level declarations"
description: "Kotlin binding reference: Package-level declarations."
---

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

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

# Package-level declarations

## Types

| Name | Summary |
|---|---|
| [Activation](Activation/index.md) | [common]<br>enum [Activation](Activation/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[Activation](Activation/index.md)&gt; <br>A fused activation epilogue. `Identity` = none. The gated kinds (`SwiGlu`, `GeGlu`, `ReGlu`, `Situ`) take a concatenated `[*, 2d]` gate‖up input and emit `[*, d]`, used as a fused projection epilogue. |
| [Agg](Agg/index.md) | [common]<br>enum [Agg](Agg/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[Agg](Agg/index.md)&gt; <br>A group-by aggregation over a group's non-null values. |
| [AggSpec](AggSpec/index.md) | [common]<br>data class [AggSpec](AggSpec/index.md)(val column: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val agg: [Agg](Agg/index.md) = Agg.SUM, val outName: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;&quot;)<br>One aggregation of a [Table.groupBy](Table/groupBy.md): the column, the reduction and the output name (empty for `<column>_<agg>`). |
| [AudioData](AudioData/index.md) | [common]<br>class [AudioData](AudioData/index.md)(val samples: [Tensor](Tensor/index.md), val info: [AudioInfo](AudioInfo/index.md))<br>A decoded waveform plus its effective layout: [samples](AudioData/samples.md) is `[frames]` (mono) or `[frames, channels]` Float32 on the host. Release [samples](AudioData/samples.md) when done (`use {}`), as any tensor. |
| [AudioInfo](AudioInfo/index.md) | [common]<br>data class [AudioInfo](AudioInfo/index.md)(val sampleRate: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val channels: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val frames: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html))<br>An audio stream's effective layout, read from its header. With a non-zero target rate or channel count the figures are what a decode to that target produces; [frames](AudioInfo/frames.md) is exactly the count [Io.loadAudio](Io/loadAudio.md) with the same targets returns (seconds = frames / sampleRate). |
| [AudioNormKind](AudioNormKind/index.md) | [common]<br>enum [AudioNormKind](AudioNormKind/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[AudioNormKind](AudioNormKind/index.md)&gt; <br>The normalization an audio feature processor applies to its output. |
| [AudioProcessOptions](AudioProcessOptions/index.md) | [common]<br>data class [AudioProcessOptions](AudioProcessOptions/index.md)(val maxLengthSamples: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, val chunkLengthSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val padToChunk: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val paddingValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val inputScaleFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val melFloor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val logMode: [LogMode](LogMode/index.md)? = null, val logDynamicRange: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val logShift: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val logScale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val normalization: [AudioNormKind](AudioNormKind/index.md)? = null, val normMean: [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)? = null, val normStd: [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)? = null)<br>Per-call overrides of [AudioProcessor.process](AudioProcessor/process.md): only the knobs the pipeline reads fresh each call. A set field replaces the loaded configuration's value for that call only. [normMean](AudioProcessOptions/normMean.md) and [normStd](AudioProcessOptions/normStd.md) are the scalar operands of [AudioNormKind.GLOBAL_MEAN_STD](AudioNormKind/GLOBAL_MEAN_STD/index.md). |
| [AudioProcessor](AudioProcessor/index.md) | [common]<br>class [AudioProcessor](AudioProcessor/index.md)<br>A configuration-driven audio feature processor: a waveform in, the raw waveform, a log-mel spectrogram or a log-mel filterbank out, as a model's `preprocessor_config.json` states it. A file or payload is decoded, resampled to the configured rate and mixed to mono first; a waveform you hand in must already be at that rate. `AutoCloseable`: [close](AudioProcessor/close.md) releases it. |
| [Backends](Backends/index.md) | [common]<br>object [Backends](Backends/index.md)<br>Backend discovery: which compute backends this runtime carries, which load on THIS device and why one does not, and the devices each exposes. Every call takes a [ComputeApi](ComputeApi/index.md). |
| [BatchableState](BatchableState/index.md) | [common]<br>interface [BatchableState](BatchableState/index.md)<br>The reads the continuous batcher takes of a session's state, on the engine's thread, every step: the carried load, its ceiling (the headroom admits work) and the units the next step launches (1 for a decode step; a prompt ingested in chunks reports its next chunk's length). Keep them cheap and never raise: a raise is reported and reads as 0. |
| [BatcherConfig](BatcherConfig/index.md) | [common]<br>data class [BatcherConfig](BatcherConfig/index.md)(val maxBatch: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, val workBudget: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, val stepTokenBudget: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0)<br>Continuous-batch composition knobs: sessions per step, work per step, tokens launched per step (0 = unbounded). |
| [CapacityPolicy](CapacityPolicy/index.md) | [common]<br>enum [CapacityPolicy](CapacityPolicy/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[CapacityPolicy](CapacityPolicy/index.md)&gt; <br>How admission accounts for the model's capacity beyond the session cap: [SLOT_CAP](CapacityPolicy/SLOT_CAP/index.md) admits up to the session ceiling and never reads the model's capacity; [NO_EVICT](CapacityPolicy/NO_EVICT/index.md) admits a request only while the free capacity covers every active session's remaining need plus this one's whole need; [PREEMPT_LAST](CapacityPolicy/PREEMPT_LAST/index.md) admits while the free capacity covers the next step and lets the model set a session aside when it runs short, to re-admit it later. |
| [ChatTemplateInputs](ChatTemplateInputs/index.md) | [common]<br>class [ChatTemplateInputs](ChatTemplateInputs/index.md)(val messages: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val tools: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val addGenerationPrompt: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val extraContext: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val nowEpochSeconds: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0)<br>The full inputs of a chat render: the [messages](ChatTemplateInputs/messages.md) as a JSON array of `{"role", "content", ...}` turns (an assistant turn may carry `tool_calls`, a `"tool"` turn a tool response), the [tools](ChatTemplateInputs/tools.md) offered to the model as a JSON array of schemas (null for none), whether to append the assistant-turn priming ([addGenerationPrompt](ChatTemplateInputs/addGenerationPrompt.md)), [extraContext](ChatTemplateInputs/extraContext.md) as a JSON object whose keys become template variables (null for none), and the fixed clock behind the template's `strftime_now` as Unix seconds, so a render is reproducible (0, the default, renders at the epoch). |
| [ChatTemplateOptions](ChatTemplateOptions/index.md) | [common]<br>class [ChatTemplateOptions](ChatTemplateOptions/index.md)(val chatTemplate: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val applyPolyfills: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val useBosToken: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val useEosToken: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val defineStrftimeNow: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val polyfillTools: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val polyfillToolCallExamples: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val polyfillToolCalls: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val polyfillToolResponses: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val polyfillSystemRole: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val polyfillObjectArguments: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val polyfillTypedContent: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null)<br>Per-render overrides of a chat render. Every toggle is tri-state: null keeps the template's standing behavior, a value forces it for this render only. [chatTemplate](ChatTemplateOptions/chatTemplate.md) swaps the template source for the call; it is parsed per render, so keep the standing template for the hot path. |
| [ChunkCallback](ChunkCallback/index.md) | [common]<br>fun interface [ChunkCallback](ChunkCallback/index.md)<br>Called per streamed chunk, on the engine's thread; never block in it. |
| [ChunkProducer](ChunkProducer/index.md) | [common]<br>fun interface [ChunkProducer](ChunkProducer/index.md)<br>A chunked body's producer: one chunk per pull, null at the end. |
| [ChunkSink](ChunkSink/index.md) | [common]<br>fun interface [ChunkSink](ChunkSink/index.md)<br>A sink for the body chunks of a streaming read. |
| [ClikaRt](ClikaRt/index.md) | [common]<br>object [ClikaRt](ClikaRt/index.md)<br>The entry of the binding: the runtime library and the bridge load at the first touch of this object, and [load](ClikaRt/load.md) runs the one check every call depends on. |
| [ClikaRtAndroid](ClikaRtAndroid/index.md) | [android]<br>object [ClikaRtAndroid](ClikaRtAndroid/index.md)<br>The Android entry over [ClikaRt](ClikaRt/index.md): pins the runtime's cache root to the app's own cache directory, then loads the binding. |
| [ClikaRtException](ClikaRtException/index.md) | [common]<br>class [ClikaRtException](ClikaRtException/index.md)(val status: [Status](Status/index.md), val codeName: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), message: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html))<br>A runtime failure. [codeName](ClikaRtException/codeName.md) is the machine-readable channel that survives every build flavor; branch on it, never on the message text (release builds may show an opaque message code). [status](ClikaRtException/status.md) is the coarse class. |
| [ClikaRtLog](ClikaRtLog/index.md) | [common]<br>object [ClikaRtLog](ClikaRtLog/index.md)<br>The runtime's log lines through the host app's own logger. The runtime logs on its &quot;ClikaRT&quot; channel; [setLevel](ClikaRtLog/setLevel.md) sets that channel's threshold and [setCallback](ClikaRtLog/setCallback.md) routes every record at or above it to a [LogCallback](LogCallback/index.md). The runtime's own console output continues beside the callback. |
| [ColumnOp](ColumnOp/index.md) | [common]<br>enum [ColumnOp](ColumnOp/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[ColumnOp](ColumnOp/index.md)&gt; <br>An in-place column operation ([Table.applyScalar](Table/applyScalar.md), [Table.applyColumn](Table/applyColumn.md)). |
| [CompileOptions](CompileOptions/index.md) | [common]<br>data class [CompileOptions](CompileOptions/index.md)(val inputShapes: [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), [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)&gt; = emptyMap(), val namedDims: [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), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt; = emptyMap(), val sampleInputs: [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), [Tensor](Tensor/index.md)&gt; = emptyMap(), val weights: [Placement](Placement/index.md)? = null, val stickyWeights: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false)<br>How [OnnxModel.compile](OnnxModel/compile.md) builds the graph. With none of the shape roads a dynamic input dim stays dynamic and the graph binds real shapes at run time; [inputShapes](CompileOptions/inputShapes.md) pins an input to one fixed shape, [namedDims](CompileOptions/namedDims.md) pins every dim declared under that name (an ONNX `dim_param`), and [sampleInputs](CompileOptions/sampleInputs.md) pins each named input to its example's shape and dtype (the values are never read); the roads combine, the explicit shapes winning. [weights](CompileOptions/weights.md) is the device or stream the finalized graph serves on (null keeps the operators where they are); [stickyWeights](CompileOptions/stickyWeights.md) keeps the weights resident under memory pressure. |
| [CompletionCallback](CompletionCallback/index.md) | [common]<br>fun interface [CompletionCallback](CompletionCallback/index.md)<br>Called once at a session's end, on the engine's thread, with its response or its failure (the other is null); never block in it. |
| [ComputeApi](ComputeApi/index.md) | [common]<br>enum [ComputeApi](ComputeApi/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[ComputeApi](ComputeApi/index.md)&gt; <br>The compute backend a device dispatches through. |
| [Cookie](Cookie/index.md) | [common]<br>data class [Cookie](Cookie/index.md)(val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val value: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;/&quot;, val domain: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;&quot;, val maxAge: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = -1, val httpOnly: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val secure: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val sameSite: [SameSite](SameSite/index.md) = SameSite.LAX)<br>A cookie to set on a response: [maxAge](Cookie/maxAge.md) below 0 means a session cookie, an empty [domain](Cookie/domain.md) omits the attribute, [httpOnly](Cookie/httpOnly.md) hides it from script, [secure](Cookie/secure.md) limits it to HTTPS. |
| [CsvReadOptions](CsvReadOptions/index.md) | [common]<br>data class [CsvReadOptions](CsvReadOptions/index.md)(val separator: [Char](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char/index.html) = ',', val hasHeader: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val nullTokens: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt; = emptyList())<br>The options of a CSV read: the field [separator](CsvReadOptions/separator.md), whether the first row carries the column names, and the unquoted values that read as null beside an empty field. Column types are inferred. |
| [DefaultsOptions](DefaultsOptions/index.md) | [common]<br>data class [DefaultsOptions](DefaultsOptions/index.md)(val specialize: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val shapeFixation: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val channelsLastInputs: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val channelsLastOutputs: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false)<br>The choices the optimizer's transforms read: [specialize](DefaultsOptions/specialize.md) collapses the shape arithmetic the compile's pinned shapes fix (a graph compiled from ONNX), [shapeFixation](DefaultsOptions/shapeFixation.md) the same for a traced graph's static dims, and the two channels-last choices omit the layout conversions at the inputs or the outputs (changing those slots' contract: read the specs after). |
| [Device](Device/index.md) | [common]<br>data class [Device](Device/index.md)(val api: [ComputeApi](ComputeApi/index.md), val index: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)) : [Placement](Placement/index.md)<br>A compute device: a backend api plus a device index. An accelerator index is zero-based and names one physical device; a CPU index names a SOCKET, with the whole machine at [WHOLE_MACHINE](Device/Companion/WHOLE_MACHINE.md), so [CPU](Device/Companion/CPU-property.md) uses every core and `Device.cpu(0)` confines work to socket 0. |
| [DeviceKind](DeviceKind/index.md) | [common]<br>enum [DeviceKind](DeviceKind/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[DeviceKind](DeviceKind/index.md)&gt; <br>Where a device sits relative to the host: an integrated GPU shares the host's memory (phones, Jetson boards, Apple silicon), a discrete one has its own, the CPU is the host itself; [UNKNOWN](DeviceKind/UNKNOWN/index.md) when the backend reports no kind. |
| [DeviceProperties](DeviceProperties/index.md) | [common]<br>data class [DeviceProperties](DeviceProperties/index.md)(val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val kind: [DeviceKind](DeviceKind/index.md), val driverVersion: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val backendRuntimeVersion: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val smCount: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val computeCapabilityMajor: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val computeCapabilityMinor: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val warpSize: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val maxThreadsPerBlock: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val sharedMemoryPerBlockBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val totalMemoryBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val isIntegrated: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val hasTensorCores: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val supportsFp16: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val supportsBf16: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val supportsFp8E4m3: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val prefixContinuationBitExact: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), val unavailableReason: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html))<br>A device's static capabilities (see [Device.properties](Device/properties.md)). Field meanings are normalized across backends: [smCount](DeviceProperties/smCount.md) is SMs on CUDA, compute units elsewhere; [warpSize](DeviceProperties/warpSize.md) is the warp/wave/subgroup width; the compute capability is the CUDA SM version or the nearest generation tag elsewhere. A field the backend does not report is 0 / false / &quot;&quot;. [unavailableReason](DeviceProperties/unavailableReason.md) is empty when the device serves. |
| [Disposition](Disposition/index.md) | [common]<br>enum [Disposition](Disposition/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[Disposition](Disposition/index.md)&gt; <br>A session's outcome of one iterate step: keep stepping, done (its outputs are final), failed (see [SessionStepResult.error](SessionStepResult/error.md)), or set aside for lack of capacity and re-admitted later with its delivered chunks intact (only under [CapacityPolicy.PREEMPT_LAST](CapacityPolicy/PREEMPT_LAST/index.md)). |
| [DownloadOptions](DownloadOptions/index.md) | [common]<br>data class [DownloadOptions](DownloadOptions/index.md)(val bearerToken: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)? = null, val progress: [ProgressSink](ProgressSink/index.md)? = null, val connectTimeoutSec: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 10, val readTimeoutSec: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 30, val followRedirects: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val resume: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false)<br>The options of a transfer: a bearer token for `Authorization` (never logged), a [progress](DownloadOptions/progress.md) sink (return false to cancel), the connect and read budgets in seconds, whether 3xx redirects are followed, and, for [Http.downloadFile](Http/downloadFile.md) alone, whether an existing partial destination is resumed with a ranged request and kept on failure. |
| [DType](DType/index.md) | [common]<br>enum [DType](DType/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[DType](DType/index.md)&gt; <br>The element format of a tensor's values. The set covers booleans, signed and unsigned integers (sub-byte widths included), the IEEE-style floats and the narrow floating formats quantized models use. |
| [EagerScope](EagerScope/index.md) | [common]<br>class [EagerScope](EagerScope/index.md)<br>While open, forces EAGER execution on the calling thread, even inside a [TracingScope](TracingScope/index.md): a region that must compute concrete values. Thread-local. |
| [Encoded](Encoded/index.md) | [common]<br>class [Encoded](Encoded/index.md)(val ids: [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)&lt;[IntArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html)&gt;, val inputIds: [Tensor](Tensor/index.md)?, val attentionMask: [Tensor](Tensor/index.md)?, val seqLengths: [Tensor](Tensor/index.md)?, val cuSeqlens: [Tensor](Tensor/index.md)?)<br>A tensor-shaped encode: [ids](Encoded/ids.md) always carries one id row per input text; the tensor columns are present only when [EncodeOptions.returnTensors](EncodeOptions/returnTensors.md) was set: [inputIds](Encoded/inputIds.md)`[B, S]` padded Int32 (or one flat row with [varlen](EncodeOptions/varlen.md)), [attentionMask](Encoded/attentionMask.md)`[B, S]` Int32 with 1 for a token and 0 for pad (padded layout only), [seqLengths](Encoded/seqLengths.md)`[B]` Int32, the real token count per sequence, and [cuSeqlens](Encoded/cuSeqlens.md)`[B + 1]` Int32, the exclusive prefix sums an attention over the flat row takes. Release the tensors you were given when done. |
| [EncodeOptions](EncodeOptions/index.md) | [common]<br>data class [EncodeOptions](EncodeOptions/index.md)(val addSpecialTokens: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val returnTensors: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val varlen: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val padId: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)? = null, val device: [Placement](Placement/index.md)? = null, val maxLength: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, val truncationSide: [TruncationSide](TruncationSide/index.md) = TruncationSide.RIGHT, val paddingSide: [PaddingSide](PaddingSide/index.md) = PaddingSide.RIGHT, val padToMultipleOf: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null)<br>The per-call controls of the tensor-shaped encode entry points ([Tokenizer.encodeText](Tokenizer/encodeText.md), [Tokenizer.encodeBatch](Tokenizer/encodeBatch.md)). |
| [ErrorHandler](ErrorHandler/index.md) | [common]<br>fun interface [ErrorHandler](ErrorHandler/index.md)<br>The page of an error status (a 404, an explicit error): the request and the status in, the response out. |
| [EventProducer](EventProducer/index.md) | [common]<br>fun interface [EventProducer](EventProducer/index.md)<br>A Server-Sent-Events body's producer: one event per pull, null at the end. |
| [ExceptionHandler](ExceptionHandler/index.md) | [common]<br>fun interface [ExceptionHandler](ExceptionHandler/index.md)<br>The page of a failed handler (one that raised): the request and the failure's text in, the response out. |
| [ExecConfig](ExecConfig/index.md) | [common]<br>data class [ExecConfig](ExecConfig/index.md)(val batcher: [BatcherConfig](BatcherConfig/index.md) = BatcherConfig(), val scheduler: [SchedulerConfig](SchedulerConfig/index.md) = SchedulerConfig(), val stream: [Stream](Stream/index.md)? = null, val maxQueued: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0)<br>One executor's configuration: the batching and scheduling knobs, the stream it runs on (null = a new asynchronous stream of its own) and the in-flight cap for backpressure (0 = unbounded). |
| [Executor](Executor/index.md) | [common]<br>class [Executor](Executor/index.md)<br>Drives one model: admits requests, runs its phases and delivers results. [enqueue](Executor/enqueue.md) validates the request against the model's schema and answers at once; [await](Executor/await.md) blocks for the session's response; [shutdown](Executor/shutdown.md) drains; a later [enqueue](Executor/enqueue.md) fails with `FAILED_PRECONDITION`. `AutoCloseable`: [close](Executor/close.md) shuts down and releases the executor, and the model stays the caller's. |
| [FormFile](FormFile/index.md) | [common]<br>class [FormFile](FormFile/index.md)<br>One uploaded file of a `multipart/form-data` body: its client-side name, content type and bytes. |
| [FormPart](FormPart/index.md) | [common]<br>class [FormPart](FormPart/index.md)<br>One part of a `multipart/form-data` body: a text field (empty [filename](FormPart/filename.md) and [contentType](FormPart/contentType.md)) or a file part. |
| [FrameBatch](FrameBatch/index.md) | [common]<br>class [FrameBatch](FrameBatch/index.md)(val frames: [Tensor](Tensor/index.md), val indices: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), val ptsSeconds: [DoubleArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html), val durationSeconds: [DoubleArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html))<br>A decoded batch of frames plus the alignment facts a video model needs: [frames](FrameBatch/frames.md) packed `[K, H, W, 3]` UInt8 on the host, the source [indices](FrameBatch/indices.md) they were taken from, each frame's presentation time in seconds (the clip's own timeline, offsets and uneven spacing included) and its display duration. Release [frames](FrameBatch/frames.md) when done. |
| [FunctionModel](FunctionModel/index.md) | [common]<br>class [FunctionModel](FunctionModel/index.md)<br>A serving model whose phases are Kotlin bodies: declare the contract, bind each phase (and the state factory of a stateful model), then hand it to an [Executor](Executor/index.md) or a [Pipeline](Pipeline/index.md). A phase bound after an executor or a pipeline was created over the model is not one it runs. `AutoCloseable`; [close](FunctionModel/close.md) refuses while an executor or a pipeline holds the model. |
| [GeluMode](GeluMode/index.md) | [common]<br>enum [GeluMode](GeluMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[GeluMode](GeluMode/index.md)&gt; <br>GELU approximation: exact (`None`), `Tanh` (the tanh approximation), `Quick` (sigmoid-based), or `Fast`. |
| [GridSampleMode](GridSampleMode/index.md) | [common]<br>enum [GridSampleMode](GridSampleMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[GridSampleMode](GridSampleMode/index.md)&gt; <br>`grid_sample` interpolation. |
| [GridSamplePaddingMode](GridSamplePaddingMode/index.md) | [common]<br>enum [GridSamplePaddingMode](GridSamplePaddingMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[GridSamplePaddingMode](GridSamplePaddingMode/index.md)&gt; <br>`grid_sample` out-of-bounds handling. |
| [Handler](Handler/index.md) | [common]<br>fun interface [Handler](Handler/index.md)<br>A route handler: the request in, the response out. |
| [HashLaneAlgo](HashLaneAlgo/index.md) | [common]<br>enum [HashLaneAlgo](HashLaneAlgo/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[HashLaneAlgo](HashLaneAlgo/index.md)&gt; <br>`hash_lanes` permutation. `Auto` picks by the input's lane width: a 32-bit integer lane maps through `Triple32`, a 64-bit lane through `Moremur`. The named kinds select a permutation within that width: `Triple32` and `WeakTwoMul` are 32-bit, `Moremur`, `Feistel3Mul3` and `Feistel4Mul2` are 64-bit; a kind of the other width is refused. |
| [HashTensorMode](HashTensorMode/index.md) | [common]<br>enum [HashTensorMode](HashTensorMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[HashTensorMode](HashTensorMode/index.md)&gt; <br>`hash_tensor` combine mode. `XorSum` xor-folds the elements' mixed hashes; order-independent, so a digest survives layout permutations. |
| [Http](Http/index.md) | [common]<br>object [Http](Http/index.md)<br>The runtime's HTTP client: text and byte downloads, a download to a file (resumable), the full response of a GET, a POST or a DELETE, and the streaming reads whose chunks or events arrive through a sink on the calling thread. A failure to complete a request is a [ClikaRtException](ClikaRtException/index.md); an answered status is data in the [HttpResponse](HttpResponse/index.md). |
| [HttpResponse](HttpResponse/index.md) | [common]<br>class [HttpResponse](HttpResponse/index.md)<br>A finished HTTP response, the outcome of a request the server answered: any answered [status](HttpResponse/status.md) arrives here as data (a 404 or a 401 too; branch on [status](HttpResponse/status.md) or [isOk](HttpResponse/isOk.md)); only a request that could not complete at all (the connection, TLS, a timeout, a cancellation) fails with a [ClikaRtException](ClikaRtException/index.md). [headers](HttpResponse/headers.md) keep the arrival order and a name may repeat; [body](HttpResponse/body.md) is empty for a transfer that streamed its body to a file. |
| [HttpServer](HttpServer/index.md) | [common]<br>class [HttpServer](HttpServer/index.md)<br>The runtime's HTTP server: routes by verb and path (exact, or a pattern whose groups become captures), route groups, middleware, static files, the failure and error pages, an access logger, the tuning knobs, and the start and stop ([listen](HttpServer/listen.md) blocks; [listenAsync](HttpServer/listenAsync.md) / [bindToAnyPort](HttpServer/bindToAnyPort.md) serve on a background thread; [stop](HttpServer/stop.md) drains). A handler runs on the server's own thread; the runtime attaches it to the JVM for the call. `AutoCloseable`: [close](HttpServer/close.md) stops the server if it runs and releases it. A borrowed server ([isBorrowed](HttpServer/isBorrowed.md)) is another object's, handed out for its routes: [close](HttpServer/close.md) drops the handle and releases nothing, and the owner's start, stop and lifetime stay the owner's. |
| [ImageInfo](ImageInfo/index.md) | [common]<br>data class [ImageInfo](ImageInfo/index.md)(val height: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val width: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val channels: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html))<br>An image's pixel geometry as displayed (channels-last), read from its header: an EXIF orientation tag is applied, so a rotated photo reports the swapped height and width, the same `[H, W, C]`[Io.loadImage](Io/loadImage.md) returns. |
| [ImageProcessOptions](ImageProcessOptions/index.md) | [common]<br>data class [ImageProcessOptions](ImageProcessOptions/index.md)(val doResize: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val resize: &lt;Error class: unknown class&gt;&lt;[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt;? = null, val resample: [ImageResample](ImageResample/index.md)? = null, val antialias: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val doCenterCrop: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val crop: &lt;Error class: unknown class&gt;&lt;[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt;? = null, val doRescale: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val rescaleFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val doNormalize: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val imageMean: [FloatArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html)? = null, val imageStd: [FloatArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html)? = null, val doConvertRgb: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val doPad: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val padTo: &lt;Error class: unknown class&gt;&lt;[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt;? = null)<br>Per-call overrides of [ImageProcessor.process](ImageProcessor/process.md): a set field replaces the loaded configuration's value for that call only, an unset (null) field keeps it. Setting [resize](ImageProcessOptions/resize.md) does not turn [doResize](ImageProcessOptions/doResize.md) on by itself. [imageMean](ImageProcessOptions/imageMean.md) and [imageStd](ImageProcessOptions/imageStd.md) are set together, per channel (length 1 or 3). |
| [ImageProcessor](ImageProcessor/index.md) | [common]<br>class [ImageProcessor](ImageProcessor/index.md)<br>A configuration-driven image preprocessor: convert to RGB, resize, center-crop, rescale, normalize and pad, as a model's `preprocessor_config.json` states them, to a `[H, W, C]` Float32 tensor (channels-last). Load one from a model directory, or build one from the common knobs with [fromArgs](ImageProcessor/Companion/fromArgs.md). `AutoCloseable`: [close](ImageProcessor/close.md) releases it. |
| [ImageResample](ImageResample/index.md) | [common]<br>enum [ImageResample](ImageResample/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[ImageResample](ImageResample/index.md)&gt; <br>The resampling filter of an image resize; the codes are the runtime's own. |
| [InterpMode](InterpMode/index.md) | [common]<br>enum [InterpMode](InterpMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[InterpMode](InterpMode/index.md)&gt; <br>Resampling mode for `ops::interpolate` (rank dispatch picks the spatial variant: Linear covers linear/bilinear/trilinear by input rank). |
| [Io](Io/index.md) | [common]<br>object [Io](Io/index.md)<br>Decoding and encoding of images, audio and video, and the NumPy `.npy` entry and exit forms of a tensor. |
| [IterateBody](IterateBody/index.md) | [common]<br>fun interface [IterateBody](IterateBody/index.md)<br>The body of an iterate phase: one result per slot, in slot order. |
| [JoinKind](JoinKind/index.md) | [common]<br>enum [JoinKind](JoinKind/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[JoinKind](JoinKind/index.md)&gt; <br>The flavor of a [Table.join](Table/join.md): [INNER](JoinKind/INNER/index.md) keeps matched rows only, [LEFT](JoinKind/LEFT/index.md) and [RIGHT](JoinKind/RIGHT/index.md) also keep that side's unmatched rows (nulls fill the other side), [OUTER](JoinKind/OUTER/index.md) keeps both sides' unmatched rows. |
| [Json](Json/index.md) | [common]<br>class [Json](Json/index.md)<br>A JSON document: null, a boolean, a number, a string, an array or an object. Parse one with [parse](Json/Companion/parse.md) or [readFile](Json/Companion/readFile.md), build one with [newObject](Json/Companion/newObject.md) / [newArray](Json/Companion/newArray.md) and the scalar factories, read it with the `is` predicates, the `as` readers and [at](Json/at.md), write it with [set](Json/set.md) and [add](Json/add.md), and serialize it with [dump](Json/dump.md) or [writeFile](Json/writeFile.md). A read answers an independent copy, a write copies the given value in, so no document ever aliases another. `AutoCloseable`: [close](Json/close.md) releases the document. |
| [JsonKind](JsonKind/index.md) | [common]<br>enum [JsonKind](JsonKind/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[JsonKind](JsonKind/index.md)&gt; <br>The kind of a JSON value; the codes are the bridge's. |
| [KVSpecOptions](KVSpecOptions/index.md) | [common]<br>data class [KVSpecOptions](KVSpecOptions/index.md)(val batch: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, val pastLenMin: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, val pastLenOpt: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, val pastLenMax: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0)<br>The session cache sizing of a model served from a graph with a KV cache: the batch every cache input is specced at and the past length as a min / opt / max range (the one-value form fixes it). A graph without a KV cache ignores it. |
| [LogCallback](LogCallback/index.md) | [common]<br>fun interface [LogCallback](LogCallback/index.md)<br>A callback carrying one runtime log record: its [LogLevel](LogLevel/index.md) and the formatted line (no trailing newline). Registered through [ClikaRtLog.setCallback](ClikaRtLog/setCallback.md); fires on whichever thread logged, so keep the body short and never log back into the runtime from it. |
| [Logger](Logger/index.md) | [common]<br>fun interface [Logger](Logger/index.md)<br>The per-request access logger, run after each response. |
| [LogLevel](LogLevel/index.md) | [common]<br>enum [LogLevel](LogLevel/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[LogLevel](LogLevel/index.md)&gt; <br>The severities of the runtime's log records, low to high; [OFF](LogLevel/OFF/index.md) disables the channel. |
| [LogMode](LogMode/index.md) | [common]<br>enum [LogMode](LogMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[LogMode](LogMode/index.md)&gt; <br>How an audio spectrum is compressed after the mel bank. |
| [MemorySource](MemorySource/index.md) | [common]<br>enum [MemorySource](MemorySource/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[MemorySource](MemorySource/index.md)&gt; <br>How the physical figures of a [MemoryStats](MemoryStats/index.md) were obtained: read from the driver or the OS ([MEASURED](MemorySource/MEASURED/index.md)), derived from a declared budget or a clamped read ([HEURISTIC](MemorySource/HEURISTIC/index.md)), or not available ([UNKNOWN](MemorySource/UNKNOWN/index.md)). |
| [MemoryStats](MemoryStats/index.md) | [common]<br>data class [MemoryStats](MemoryStats/index.md)(val deviceFreeBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val deviceTotalBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val deviceMemorySource: [MemorySource](MemorySource/index.md), val activeBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val requestedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val reservedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val cachedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val peakActiveBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val peakReservedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val peakRequestedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numAllocs: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numFrees: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numOom: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val numInflightParkWaits: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val wrappedBytes: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val wrappedAllocs: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html))<br>A device's memory at one point in time (see [Device.memoryStats](Device/memoryStats.md)): the physical free and total bytes with how they were obtained, and the runtime pool's counters for that device. [requestedBytes](MemoryStats/requestedBytes.md) is the residency gauge (what the live allocations asked for: a second live copy of a weight doubles it); the peaks only ever rise until [Device.resetPeakMemoryStats](Device/resetPeakMemoryStats.md). Byte counts and tallies are unsigned 64-bit in the runtime and ride `Long`. |
| [MeshgridIndexing](MeshgridIndexing/index.md) | [common]<br>enum [MeshgridIndexing](MeshgridIndexing/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[MeshgridIndexing](MeshgridIndexing/index.md)&gt; <br>`meshgrid` output orientation: NumPy's `indexing=` argument. `IJ` (matrix indexing) keeps output shapes in the input order; `XY` (Cartesian) swaps the first two axes. |
| [Method](Method/index.md) | [common]<br>enum [Method](Method/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[Method](Method/index.md)&gt; <br>An HTTP verb; the codes are the bridge's. |
| [Middleware](Middleware/index.md) | [common]<br>fun interface [Middleware](Middleware/index.md)<br>A middleware: read or tag the request, call [Next](Next/index.md) (or not), answer a response. |
| [ModelGraph](ModelGraph/index.md) | [common]<br>class [ModelGraph](ModelGraph/index.md)<br>A compiled model: its I/O contract, its placement, and its runs. A graph runs once it is finalized ([finalizeGraph](ModelGraph/finalizeGraph.md): placed on its device, the weights packed, the execution order planned); a run before that fails with `FAILED_PRECONDITION`. [to](ModelGraph/to.md) moves it to a device or a stream, before finalizing (recording where finalizing places it) or after (moving the finalized graph). `AutoCloseable`: [close](ModelGraph/close.md) releases the graph. |
| [ModelSchema](ModelSchema/index.md) | [common]<br>data class [ModelSchema](ModelSchema/index.md)(val inputs: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[TensorSpec](TensorSpec/index.md)&gt; = emptyList(), val outputs: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[TensorSpec](TensorSpec/index.md)&gt; = emptyList(), val stateful: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val supportsStreaming: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false)<br>A model's full I/O contract: the consumed and produced slots, and whether it keeps per-session state or streams. |
| [ModMode](ModMode/index.md) | [common]<br>enum [ModMode](ModMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[ModMode](ModMode/index.md)&gt; <br>`mod` convention: Python (sign follows divisor) or C (sign follows dividend). |
| [MoeRouting](MoeRouting/index.md) | [common]<br>enum [MoeRouting](MoeRouting/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[MoeRouting](MoeRouting/index.md)&gt; <br>Mixture-of-Experts routing: how the router logits select the top-k experts and produce the combine weights. Values are PINNED (ABI). |
| [NativeLibraries](NativeLibraries/index.md) | [common]<br>object [NativeLibraries](NativeLibraries/index.md)<br>The runtime's native libraries on a desktop JVM. A library packed in a bridge jar under `native/<os>-<arch>/` (the platform ids: `linux-x86_64`, `linux-arm64`, `macos-arm64`, `windows-x86_64`, `windows-arm64`) is extracted once per process into a temporary directory, removed at exit, and loaded from there; a library packed nowhere on the classpath loads by name through `java.library.path`. An Android app ships its libraries in `jniLibs`, where the by-name load is the one path. |
| [Next](Next/index.md) | [common]<br>fun interface [Next](Next/index.md)<br>The rest of the chain a middleware may call: the next middleware, or the route's handler. |
| [NullOrder](NullOrder/index.md) | [common]<br>enum [NullOrder](NullOrder/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[NullOrder](NullOrder/index.md)&gt; <br>Where a multi-key sort places null cells. |
| [OnnxModel](OnnxModel/index.md) | [common]<br>class [OnnxModel](OnnxModel/index.md)<br>An ONNX model opened from a file: the graph loads into memory and the external initializer payloads stay on disk until something consumes them; nothing is validated beyond the wire format, and [compile](OnnxModel/compile.md) is where operator support is decided. `AutoCloseable`: [close](OnnxModel/close.md) releases the parsed model (a graph it compiled lives on). |
| [OnnxModelOptions](OnnxModelOptions/index.md) | [common]<br>data class [OnnxModelOptions](OnnxModelOptions/index.md)(val saveAsExternalData: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, val deduplicateInitializers: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val deduplicateNodes: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val producerName: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;ClikaRT&quot;, val irVersion: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0)<br>How an ONNX model is edited and saved; given at [OnnxModel.open](OnnxModel/Companion/open.md), they hold for the model's lifetime. [saveAsExternalData](OnnxModelOptions/saveAsExternalData.md) null means automatic (a `<stem>_data` sidecar once the payloads exceed the 2 GiB protobuf ceiling), true always a sidecar, false never; [irVersion](OnnxModelOptions/irVersion.md) 0 keeps an opened file's own IR version. |
| [Ops](Ops/index.md) | [common]<br>object [Ops](Ops/index.md)<br>The generated operator surface; see the file banner for its laws. |
| [OptimizeOptions](OptimizeOptions/index.md) | [common]<br>data class [OptimizeOptions](OptimizeOptions/index.md)(val defaults: [DefaultsOptions](DefaultsOptions/index.md) = DefaultsOptions(), val maxNumIterations: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 100)<br>How [ModelGraph.optimize](ModelGraph/optimize.md) runs: the transforms' choices and the most iterations one run makes (at least 1). The list is the graph's own defaults. |
| [OptimizeReport](OptimizeReport/index.md) | [common]<br>class [OptimizeReport](OptimizeReport/index.md)<br>What one optimize run did: the iterations run, whether it stopped on its own, whether it changed the graph, and one row per transform. |
| [PaddingSide](PaddingSide/index.md) | [common]<br>enum [PaddingSide](PaddingSide/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[PaddingSide](PaddingSide/index.md)&gt; <br>Which end of a short row a padded batch fills. [LEFT](PaddingSide/LEFT/index.md) suits decoder-only batch generation: every row's real tokens end flush at the last column. |
| [PadMode](PadMode/index.md) | [common]<br>enum [PadMode](PadMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[PadMode](PadMode/index.md)&gt; <br>`pad` boundary handling. Constant fills with the given value; Reflect mirrors about the edge (edge sample not repeated); Replicate repeats the edge sample; Circular wraps around. |
| [PhaseContext](PhaseContext/index.md) | [common]<br>class [PhaseContext](PhaseContext/index.md)<br>What a run-once phase body reads and writes: the request's inputs (each read answers a fresh tensor the body owns; the bytes are the request's) and the phase's outputs. Valid for the body's call alone; never keep it past the return. An op the body issues runs on the phase's own stream. |
| [PhaseKind](PhaseKind/index.md) | [common]<br>enum [PhaseKind](PhaseKind/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[PhaseKind](PhaseKind/index.md)&gt; <br>How a phase runs: once per session, or stepped by the runtime until the session finishes. |
| [Pipeline](Pipeline/index.md) | [common]<br>class [Pipeline](Pipeline/index.md)<br>A multi-step serving ensemble: each step runs a model under its own executor tuning, wired by name maps into one request/response surface declared by the external schema. [enqueue](Pipeline/enqueue.md) validates the request against that schema and answers at once, with or without callbacks; [await](Pipeline/await.md) blocks for the session's response; [cancel](Pipeline/cancel.md) stops a session at its next step boundary (its completion reads `CANCELLED`); [shutdown](Pipeline/shutdown.md) drains and a later [enqueue](Pipeline/enqueue.md) fails with `FAILED_PRECONDITION`. `AutoCloseable`: [close](Pipeline/close.md) shuts down and releases the pipeline, and the models stay the caller's. |
| [PipelineStep](PipelineStep/index.md) | [common]<br>data class [PipelineStep](PipelineStep/index.md)(val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val model: [FunctionModel](FunctionModel/index.md), val execConfig: [ExecConfig](ExecConfig/index.md) = ExecConfig(), val inputMap: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;&lt;Error class: unknown class&gt;&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;&gt; = emptyList(), val outputMap: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;&lt;Error class: unknown class&gt;&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;&gt; = emptyList())<br>One node of a [Pipeline](Pipeline/index.md): a model with its executor tuning, wired by `(pipeline name, step input)` pairs in [inputMap](PipelineStep/inputMap.md) and `(step output, pipeline name)` pairs in [outputMap](PipelineStep/outputMap.md). |
| [PixelShuffleMode](PixelShuffleMode/index.md) | [common]<br>enum [PixelShuffleMode](PixelShuffleMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[PixelShuffleMode](PixelShuffleMode/index.md)&gt; <br>`pixel_shuffle` channel ordering. |
| [Placement](Placement/index.md) | [common]<br>sealed interface [Placement](Placement/index.md)<br>Where work runs or a tensor lives: a [Device](Device/index.md) names the device (the work follows its inputs and otherwise takes the calling thread's current lane there), a [Stream](Stream/index.md) names the lane exactly (a device's default stream is the opt-in to synchronous execution). A null placement is the runtime's default. |
| [PlacementScope](PlacementScope/index.md) | [common]<br>class [PlacementScope](PlacementScope/index.md)(where: [Placement](Placement/index.md))<br>While open, where is the calling thread's ambient placement: every call that names no placement takes it. Thread-local; scopes nest and each restores what it displaced. |
| [ProcessedVideo](ProcessedVideo/index.md) | [common]<br>class [ProcessedVideo](ProcessedVideo/index.md)(val clip: [Tensor](Tensor/index.md), val frameIndices: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), val ptsSeconds: [DoubleArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double-array/index.html))<br>A processed clip plus the sampling facts a timestamp-aware model needs: [clip](ProcessedVideo/clip.md)`[sampled, H, W, C]` Float32, the source [frameIndices](ProcessedVideo/frameIndices.md) sampled in order, and each one's presentation time in seconds. Release [clip](ProcessedVideo/clip.md) when done. |
| [Processor](Processor/index.md) | [common]<br>class [Processor](Processor/index.md)<br>A model directory's preprocessors as one composite: the tokenizer and the one media processor (image, audio or video) its files describe; a missing piece leaves its slot empty rather than failing the load. Each accessor hands out a standalone handle sharing the composite's instance, valid after the composite is closed; an empty slot fails with `NOT_FOUND`, so check the `has` properties first. `AutoCloseable`. |
| [ProgressSink](ProgressSink/index.md) | [common]<br>fun interface [ProgressSink](ProgressSink/index.md)<br>A progress callback of a transfer; return false to cancel it. |
| [QuantileInterp](QuantileInterp/index.md) | [common]<br>enum [QuantileInterp](QuantileInterp/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[QuantileInterp](QuantileInterp/index.md)&gt; <br>`quantile` interpolation between data points. Linear interpolates between the two neighbors; Lower / Higher take a neighbor; Nearest the closer one; Midpoint their mean. |
| [Reduction](Reduction/index.md) | [common]<br>enum [Reduction](Reduction/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[Reduction](Reduction/index.md)&gt; <br>Loss reduction over the batch. |
| [Regex](Regex/index.md) | [common]<br>class [Regex](Regex/index.md)<br>A compiled regular expression, matched over bytes (UTF-8 by default). [fullMatch](Regex/fullMatch.md) needs the whole text to match; [partialMatch](Regex/partialMatch.md) and [find](Regex/find.md) look anywhere in it. A malformed pattern fails at [compile](Regex/Companion/compile.md) with `INVALID_ARGUMENT` and the engine's diagnostic. `AutoCloseable`: [close](Regex/close.md) releases the compiled program. |
| [RegexOptions](RegexOptions/index.md) | [common]<br>data class [RegexOptions](RegexOptions/index.md)(val caseSensitive: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, val longestMatch: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val dotMatchesNewline: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val neverCapture: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val maxProgramMemory: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, val latin1: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false)<br>The compile options of a [Regex](Regex/index.md): a case-insensitive match ([caseSensitive](RegexOptions/caseSensitive.md) false), leftmost-longest instead of leftmost-first ([longestMatch](RegexOptions/longestMatch.md)), `.` matching a newline, every group non-capturing, a cap on the compiled program's memory in bytes (0 for none), and Latin-1 bytes instead of UTF-8. |
| [Request](Request/index.md) | [common]<br>data class [Request](Request/index.md)(val inputs: [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), [Tensor](Tensor/index.md)&gt;, val priority: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 0, val deadlineMs: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, val streaming: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false)<br>A request: named inputs (the keys are the schema's input names; an input the schema does not declare is carried through for the phase body to read) plus scheduling hints. The tensors stay the caller's. |
| [RequestCallbacks](RequestCallbacks/index.md) | [common]<br>data class [RequestCallbacks](RequestCallbacks/index.md)(val onChunk: [ChunkCallback](ChunkCallback/index.md)? = null, val onComplete: [CompletionCallback](CompletionCallback/index.md)? = null)<br>The event-driven hooks of a pipeline session: delivered serially and in order, the completion once after the last chunk. A raise from either is reported on its thread and the engine proceeds. |
| [Response](Response/index.md) | [common]<br>class [Response](Response/index.md)<br>A session's final response: its named outputs, fresh tensors the caller owns; [close](Response/close.md) releases them all. |
| [ResponseChunk](ResponseChunk/index.md) | [common]<br>class [ResponseChunk](ResponseChunk/index.md)<br>One streamed chunk of a session's output: fresh tensors the caller owns ([close](ResponseChunk/close.md) releases them); [final](ResponseChunk/final.md) marks the last chunk of a cleanly finishing stream. A pipeline's stream ends with one empty final chunk and its payload rides the completion; an erroring or canceled session marks no chunk final. |
| [RopeScaling](RopeScaling/index.md) | [common]<br>enum [RopeScaling](RopeScaling/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[RopeScaling](RopeScaling/index.md)&gt; <br>RoPE frequency-scaling family (long-context extension). Every family also folds an OPTIONAL 1-D `[rotary_dim/2]``freq_factors` per-band divisor table into its frequencies (absent ⇒ no division); the 2-D `[2, rotary_dim/2]` short/long-row form belongs to the LongRoPE families alone, which REQUIRE a table in one of the two shapes. |
| [RotaryMode](RotaryMode/index.md) | [common]<br>enum [RotaryMode](RotaryMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[RotaryMode](RotaryMode/index.md)&gt; <br>How a rotary embedding pairs the channels it rotates. |
| [RoundingMode](RoundingMode/index.md) | [common]<br>enum [RoundingMode](RoundingMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[RoundingMode](RoundingMode/index.md)&gt; <br>Integer-division / floor-div rounding. |
| [RouteGroup](RouteGroup/index.md) | [common]<br>class [RouteGroup](RouteGroup/index.md)<br>A group of routes under a path prefix, with its own middleware; made by [HttpServer.group](HttpServer/group.md) or [group](RouteGroup/group.md). `AutoCloseable`: [close](RouteGroup/close.md) releases the group's handle (the routes registered stay on the server). |
| [RunOnceBody](RunOnceBody/index.md) | [common]<br>fun interface [RunOnceBody](RunOnceBody/index.md)<br>The body of a run-once phase: read the context's inputs, set its outputs. |
| [SameSite](SameSite/index.md) | [common]<br>enum [SameSite](SameSite/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[SameSite](SameSite/index.md)&gt; <br>A cookie's cross-site posture. |
| [ScatterReduceMode](ScatterReduceMode/index.md) | [common]<br>enum [ScatterReduceMode](ScatterReduceMode/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[ScatterReduceMode](ScatterReduceMode/index.md)&gt; <br>`scatter_reduce` combine op. Sum / Prod / Mean accumulate; AMax / AMin keep the extremum. |
| [SchedulerConfig](SchedulerConfig/index.md) | [common]<br>data class [SchedulerConfig](SchedulerConfig/index.md)(val maxActiveSessions: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, val capacityPolicy: [CapacityPolicy](CapacityPolicy/index.md) = CapacityPolicy.SLOT_CAP)<br>Admission knobs: the concurrent-session ceiling (1 = serial) and the capacity policy. |
| [ServerRequest](ServerRequest/index.md) | [common]<br>class [ServerRequest](ServerRequest/index.md)<br>A request as a handler sees it: a borrowed view, valid for the handler call alone; never keep it past the return. The observers are always present; the lookups answer null when the header, query field, cookie or form field is absent; the path captures of a pattern route are read by index or by name; [setAttr](ServerRequest/setAttr.md) / [attr](ServerRequest/attr.md) are the middleware-to-handler channel (read-only inside the failure and error pages and the logger). |
| [ServerResponse](ServerResponse/index.md) | [common]<br>class [ServerResponse](ServerResponse/index.md)<br>A response a handler answers, built by a factory and chained with [withHeader](ServerResponse/withHeader.md) / [withCookie](ServerResponse/withCookie.md). Returning it from a handler consumes it; a response never returned is released by [close](ServerResponse/close.md). |
| [ServerSentEvent](ServerSentEvent/index.md) | [common]<br>class [ServerSentEvent](ServerSentEvent/index.md)(val event: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;message&quot;, val data: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val id: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) = &quot;&quot;)<br>One Server-Sent-Events frame: its [event](ServerSentEvent/event.md) type (`message` by default), its [data](ServerSentEvent/data.md) payload and its [id](ServerSentEvent/id.md). |
| [SessionId](SessionId/index.md) | [common]<br>typealias [SessionId](SessionId/index.md) = [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)<br>A session's handle, answered by `enqueue` and read by `await` and `cancel`. |
| [SessionStepResult](SessionStepResult/index.md) | [common]<br>class [SessionStepResult](SessionStepResult/index.md)(val disposition: [Disposition](Disposition/index.md) = Disposition.CONTINUE, val outputs: [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), [Tensor](Tensor/index.md)&gt; = emptyMap(), val error: [ClikaRtException](ClikaRtException/index.md)? = null)<br>One session's result of an iterate step: the verdict, this step's outputs (the engine takes them at the return: the body gives them away and their handles are emptied) and, under [Disposition.ERROR](Disposition/ERROR/index.md), the failure. |
| [SortKey](SortKey/index.md) | [common]<br>data class [SortKey](SortKey/index.md)(val column: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val order: [SortOrder](SortOrder/index.md) = SortOrder.ASCENDING, val nulls: [NullOrder](NullOrder/index.md) = NullOrder.LAST)<br>One key of a multi-key sort, most significant first, with its direction and null placement. |
| [SortOrder](SortOrder/index.md) | [common]<br>enum [SortOrder](SortOrder/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[SortOrder](SortOrder/index.md)&gt; <br>A sort's direction. |
| [SseSink](SseSink/index.md) | [common]<br>fun interface [SseSink](SseSink/index.md)<br>A sink for the events of a Server-Sent-Events stream. |
| [StateFactory](StateFactory/index.md) | [common]<br>fun interface [StateFactory](StateFactory/index.md)<br>A model's per-session state factory: any object, or null for no state. It runs with the session's stream as the thread's placement. A state that is `AutoCloseable` is closed when the engine releases the session; one that implements [BatchableState](BatchableState/index.md) is read by the batcher. |
| [Status](Status/index.md) | [common]<br>enum [Status](Status/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[Status](Status/index.md)&gt; <br>The coarse class of a runtime failure, the first thing to branch on; [ClikaRtException.codeName](ClikaRtException/codeName.md) is the fine-grained name. |
| [StepContext](StepContext/index.md) | [common]<br>class [StepContext](StepContext/index.md)<br>What an iterate body reads: one slot per session in the batch, in batch order. An op the body issues runs on the step's stream. |
| [StepSlot](StepSlot/index.md) | [common]<br>class [StepSlot](StepSlot/index.md)<br>One session's slot in a batched iterate step: its state (the object the model's state factory made; null for a stateless model), the runtime's session id (minted in arrival order) and the request's priority. |
| [Stream](Stream/index.md) | [common]<br>class [Stream](Stream/index.md) : [Placement](Placement/index.md)<br>An execution stream: an ordered queue of device work. Work placed on a stream you [create](Stream/Companion/create.md) is pipelined, so the host keeps queueing while the device runs, and two such streams overlap independent work. The per-device [defaultStream](Stream/Companion/defaultStream.md) runs each operation on the calling thread instead: the explicit opt-in to synchronous execution. |
| [StreamingDecoder](StreamingDecoder/index.md) | [common]<br>class [StreamingDecoder](StreamingDecoder/index.md)<br>Incremental id-to-text decoding for a generation stream. Ids arrive one at a time, but decoded bytes are displayable only at UTF-8 boundaries (a code point can span tokens): [push](StreamingDecoder/push.md) returns exactly the newly stable text (often empty while a code point is incomplete) and [finish](StreamingDecoder/finish.md) flushes the tail and resets the decoder for a fresh stream. One decoder serves one stream at a time; it stays valid after the [Tokenizer](Tokenizer/index.md) it came from is closed. `AutoCloseable`: [close](StreamingDecoder/close.md) releases it. |
| [SwigluFusion](SwigluFusion/index.md) | [common]<br>enum [SwigluFusion](SwigluFusion/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[SwigluFusion](SwigluFusion/index.md)&gt; <br>How the gate‖up halves are laid out in a gated MoE FC1 output. |
| [SynchronousScope](SynchronousScope/index.md) | [common]<br>class [SynchronousScope](SynchronousScope/index.md)<br>While open, every op dispatched on the calling thread COMPLETES before the dispatch returns, whichever stream runs it. Thread-local: open and close it on one thread (`use { }`); scopes nest. |
| [SynchronousStreamScope](SynchronousStreamScope/index.md) | [common]<br>class [SynchronousStreamScope](SynchronousStreamScope/index.md)(stream: [Stream](Stream/index.md))<br>While open, every op dispatched on the calling thread waits for completion before the dispatch returns, and stream runs at most one task at a time. Open it only on a quiescent stream (synchronize first); thread-local. |
| [Table](Table/index.md) | [common]<br>class [Table](Table/index.md)<br>A columnar frame: an ordered set of named, typed columns sharing one row count. Build one with [create](Table/Companion/create.md) and [addColumn](Table/addColumn.md) / [addStringColumn](Table/addStringColumn.md) or read a CSV; read a column back as a tensor or a cell by row and column; the verbs ([select](Table/select.md), [head](Table/head.md), [sortBy](Table/sortBy.md), [filter](Table/filter.md), [groupBy](Table/groupBy.md), [join](Table/join.md), ...) each answer a new frame and leave the source unchanged; the in-place operations ([applyScalar](Table/applyScalar.md), [applyColumn](Table/applyColumn.md), [assignColumn](Table/assignColumn.md)) change a column of this frame. `AutoCloseable`: [close](Table/close.md) releases the frame. |
| [Template](Template/index.md) | [common]<br>class [Template](Template/index.md)<br>A parsed, reusable text template (the engine the chat templates use): [parse](Template/Companion/parse.md) once, [render](Template/render.md) against a JSON object of variables as often as needed. Malformed syntax fails at [parse](Template/Companion/parse.md); an undefined variable in a strict position or a type error fails at [render](Template/render.md). `AutoCloseable`. |
| [Tensor](Tensor/index.md) | [common]<br>class [Tensor](Tensor/index.md)<br>An N-dimensional array on a device, with a shape, a [dtype](Tensor/dtype.md) and a placement. Build one through [Tensors](Tensors/index.md), move it with [to](Tensor/to.md), read it back with [item](Tensor/item.md) and the typed array readers, and [release](Tensor/release.md) it when done (the last release frees the storage). |
| [TensorCallback](TensorCallback/index.md) | [common]<br>fun interface [TensorCallback](TensorCallback/index.md)<br>A callback carrying a tensor: [Tensor.onComplete](Tensor/onComplete.md)'s notification. The [Tensor](Tensor/index.md) handed in is the callback's for the duration of the call only: whatever reference it does not [Tensor.release](Tensor/release.md) itself is released when the callback returns. A callback that needs the value past its return reads it out ([Tensor.item](Tensor/item.md), the array readers) inside the call. |
| [Tensors](Tensors/index.md) | [common]<br>object [Tensors](Tensors/index.md)<br>The tensor factories and data entry. |
| [TensorSpec](TensorSpec/index.md) | [common]<br>class [TensorSpec](TensorSpec/index.md)(val name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val dtype: [DType](DType/index.md) = DType.FLOAT32, val dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = LongArray(0), val optional: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, val dimNames: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt; = emptyList())<br>A named, typed tensor slot of a model's contract. A [dims](TensorSpec/dims.md) entry equal to [DYNAMIC_DIM](TensorSpec/Companion/DYNAMIC_DIM.md) resolves at run time and an empty [dims](TensorSpec/dims.md) leaves the shape unconstrained; [dimNames](TensorSpec/dimNames.md) is empty or [dims](TensorSpec/dims.md)-long with &quot;&quot; for an unnamed dim, and the same name on two slots declares one size; [optional](TensorSpec/optional.md) marks an input the model runs without. |
| [Token](Token/index.md) | [common]<br>data class [Token](Token/index.md)(val id: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val text: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val begin: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val end: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val special: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html))<br>One token of [Tokenizer.tokenize](Tokenizer/tokenize.md): its [id](Token/id.md), the surface [text](Token/text.md) it spells, the half-open byte span `[begin, end)` it covers in the source text, and whether the tokenizer injected it itself ([special](Token/special.md): bos, eos, ...) rather than reading it from the input. |
| [Tokenizer](Tokenizer/index.md) | [common]<br>class [Tokenizer](Tokenizer/index.md)<br>A loaded tokenizer: text to ids and back, the tensor-shaped batch forms, the model's chat template, and a streaming decoder for generation. |
| [TracingScope](TracingScope/index.md) | [common]<br>class [TracingScope](TracingScope/index.md)<br>While open, the calling thread builds a LAZY graph: ops return unscheduled tensors that carry their lineage and no kernel runs; [Tensor.synchronize](Tensor/synchronize.md) materializes one. Thread-local. |
| [TransformReport](TransformReport/index.md) | [common]<br>class [TransformReport](TransformReport/index.md)<br>What one transform of the list did: the iterations in which it changed the graph, a failure (undone and skipped, the graph still correct) with its code and message, and whether it still fired when the cap stopped the run. |
| [TruncationSide](TruncationSide/index.md) | [common]<br>enum [TruncationSide](TruncationSide/index.md) : [Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)&lt;[TruncationSide](TruncationSide/index.md)&gt; <br>Which end of a too-long sequence truncation drops; [RIGHT](TruncationSide/RIGHT/index.md) keeps the head. |
| [VideoData](VideoData/index.md) | [common]<br>class [VideoData](VideoData/index.md)(val batch: [FrameBatch](FrameBatch/index.md), val info: [VideoInfo](VideoInfo/index.md))<br>A whole decoded clip ([batch](VideoData/batch.md): every frame in order) plus its stream facts. |
| [VideoInfo](VideoInfo/index.md) | [common]<br>data class [VideoInfo](VideoInfo/index.md)(val totalFrames: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), val fps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val durationSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), val width: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val height: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html), val codec: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), val pixelFormat: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html))<br>A video stream's static geometry and timing, read from its header. The frame count reads 0 where the container cannot establish it; the index reads then refuse an out-of-range frame by name. |
| [VideoMetadata](VideoMetadata/index.md) | [common]<br>data class [VideoMetadata](VideoMetadata/index.md)(val totalFrames: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, val fps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0, val durationSeconds: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0)<br>The timing facts of a decoded clip; only fps-based sampling reads them. |
| [VideoProcessOptions](VideoProcessOptions/index.md) | [common]<br>data class [VideoProcessOptions](VideoProcessOptions/index.md)(val numFrames: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, val fps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, val image: [ImageProcessOptions](ImageProcessOptions/index.md)? = null)<br>Per-call overrides of [VideoProcessor.process](VideoProcessor/process.md): the temporal sampling ([numFrames](VideoProcessOptions/numFrames.md) sampled uniformly, 0 keeps every frame; or a target [fps](VideoProcessOptions/fps.md), which needs the clip's timing) and per-frame spatial overrides in [image](VideoProcessOptions/image.md). |
| [VideoProcessor](VideoProcessor/index.md) | [common]<br>class [VideoProcessor](VideoProcessor/index.md)<br>A configuration-driven video preprocessor: temporal frame sampling over the per-frame image pipeline, to a `[sampled, H, W, C]` Float32 clip. It takes decoded frames (`[T, H, W, C]` UInt8), or a file or payload it decodes through the ffmpeg command the host provides ([Io.videoCapability](Io/videoCapability.md)). `AutoCloseable`: [close](VideoProcessor/close.md) releases it. |
| [VideoReader](VideoReader/index.md) | [common]<br>class [VideoReader](VideoReader/index.md)<br>A lazily opened video: [open](VideoReader/Companion/open.md) reads the header only, [info](VideoReader/info.md) reports the stream facts, and each read decodes exactly the frames it names. The decode runs through the ffmpeg command the host provides ([Io.videoCapability](Io/videoCapability.md)). `AutoCloseable`: [close](VideoReader/close.md) releases the reader and its decoder state; a released reader refuses every call. |
| [VoidCallback](VoidCallback/index.md) | [common]<br>fun interface [VoidCallback](VoidCallback/index.md)<br>A callback with no payload: the deleter of a wrapped buffer ([Tensors.fromBlob](Tensors/fromBlob.md) / [Tensors.fromBlobStrided](Tensors/fromBlobStrided.md)). The runtime runs it exactly once, when the last reference to the wrapping tensor drops, on whichever thread that happens; the callback already holds the buffer it is being told to release, so nothing is passed. |