---
title: "KVCacheConfig"
sidebar_label: "KVCacheConfig"
description: "The clika_runtime.nn KVCacheConfig class."
---

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

Cache-wide construction parameters; per-row geometry rides KVLayerSpec.

## `device` (property)

(self) -> clika_runtime._core.Device

## `head_dim` (property)

(self) -> int

## `k_quant` (property)

(self) -> clika_runtime._core.nn.KVQuantSpec | None

## `k_scale` (property)

(self) -> float | None

## `kv_cache_scheme` (property)

(self) -> str

## `kv_dtype` (property)

(self) -> clika_runtime._core.DataType

## `max_seqs` (property)

(self) -> int

## `max_tokens_per_seq` (property)

(self) -> int

## `mode` (property)

(self) -> clika_runtime._core.nn.KVCacheMode

## `num_kv_heads` (property)

(self) -> int

## `num_layers` (property)

(self) -> int

## `paged` (property)

(self) -> clika_runtime._core.nn.PagedParams | None

## `v_quant` (property)

(self) -> clika_runtime._core.nn.KVQuantSpec | None

## `v_scale` (property)

(self) -> float | None

## `__init__`

```python
__init____init__(self, *, num_layers: int = 0, num_kv_heads: int = 0, head_dim: int = 0, kv_dtype: clika_runtime._core.DataType = DataType.BFloat16, max_seqs: int = 1, max_tokens_per_seq: int = 0, device: clika_runtime._core.Device = device(type='cpu'), k_quant: clika_runtime._core.nn.KVQuantSpec | None = None, v_quant: clika_runtime._core.nn.KVQuantSpec | None = None, kv_cache_scheme: str = '', k_scale: float | None = None, v_scale: float | None = None, mode: clika_runtime._core.nn.KVCacheMode = KVCacheMode.Continuous, paged: clika_runtime._core.nn.PagedParams | None = None) -> None
```

__init__(self, *, num_layers: int = 0, num_kv_heads: int = 0, head_dim: int = 0, kv_dtype: clika_runtime._core.DataType = DataType.BFloat16, max_seqs: int = 1, max_tokens_per_seq: int = 0, device: clika_runtime._core.Device = device(type='cpu'), k_quant: clika_runtime._core.nn.KVQuantSpec | None = None, v_quant: clika_runtime._core.nn.KVQuantSpec | None = None, kv_cache_scheme: str = '', k_scale: float | None = None, v_scale: float | None = None, mode: clika_runtime._core.nn.KVCacheMode = KVCacheMode.Continuous, paged: clika_runtime._core.nn.PagedParams | None = None) -> None
