<!-- llms-explorer concept facts · https://llms-explorer.com/tree/ollama-kv-rotation-port-ollama-kv-rotate/ · pack 2026-10-05 · ~540 tokens -->

# Ollama KV rotation port (OLLAMA_KV_ROTATE)

> Ollama main's `envconfig/config.go` defines `OLLAMA_KV_CACHE_TYPE` ("Quantization type for the K/V cache (default: f16)") and `OLLAMA_FLASH_ATTENTION` among its KV-related variables and no variable named `OLLAMA_KV_ROTATE`.

Parent: [Mac local LLMs: Ollama internals](https://llms-explorer.com/tree/mac-local-llms-ollama-internals/) · 1 facets · 8 facts · page: https://llms-explorer.com/tree/ollama-kv-rotation-port-ollama-kv-rotate/

## Facts

- Ollama main's `envconfig/config.go` defines `OLLAMA_KV_CACHE_TYPE` ("Quantization type for the K/V cache (default: f16)") and `OLLAMA_FLASH_ATTENTION` among its KV-related variables and no variable named `OLLAMA_KV_ROTATE`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/envconfig/config.go)
- A GitHub issue search for `OLLAMA_KV_ROTATE` in ollama/ollama returned 0 results on 2026-10-04. — [source](https://github.com/ollama/ollama/issues?q=OLLAMA_KV_ROTATE)
- A GitHub pull request search for `KV_ROTATE` in ollama/ollama returned 0 results (0 open, 0 closed) on 2026-10-04. — [source](https://github.com/ollama/ollama/pulls?q=KV_ROTATE)
- Ollama's launcher passes the configured KV cache type to llama-server as `--cache-type-k` and `--cache-type-v` with the same value, and flash attention as `on`, `off` or `auto`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/llm/llama_server.go)
- The Ollama FAQ in the cache documents `OLLAMA_KV_CACHE_TYPE` with default `f16` and does not mention rotation. — [source](https://docs.ollama.com/faq)
- Inferred: because the K/V type reaches upstream llama-server unchanged, any quantised-KV rotation that llama-server applies by default is inherited by Ollama on main with no Ollama setting involved. — source: `asserted`
- Inferred: llama.cpp's `LLAMA_ATTN_ROT_DISABLE` opt-out (held in the existing dossier) is the matching control, and it reaches llama-server only if set in the environment Ollama passes to the subprocess. — source: `asserted`
- Inferred: the `OLLAMA_KV_ROTATE` port is a dead branch artifact for Ollama main and should not be recommended to users. — source: `asserted`
