---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/ollama/types/interfaces/OllamaRuntimeOptions.md
description: >-
  Native Ollama runtime/sampling parameters — sent NESTED under the request
  body's `options` key, NOT at the top level (this is the key structural
  divergence from the OpenAI wire, where these sit at the top level). All fields
  are optional; set only the ones you want to override. An index signature
  allows forward-compatible passthrough of llama.cpp parameters this type has
  not yet enumerated.
---

# Interface: OllamaRuntimeOptions

Defined in: [src/batteries/llm/ollama/types.ts:91](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L91)

Native Ollama runtime/sampling parameters — sent NESTED under the request body's `options` key,
NOT at the top level (this is the key structural divergence from the OpenAI wire, where these
sit at the top level). All fields are optional; set only the ones you want to override. An
index signature allows forward-compatible passthrough of llama.cpp parameters this type has not
yet enumerated.

## Indexable

```ts
[key: string]: unknown
```

Forward-compatible passthrough for additional llama.cpp parameters.

## Properties

| Property                                                     | Type                   | Description                                                                             | Defined in                                                                                                                          |
| ------------------------------------------------------------ | ---------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|  `frequency_penalty?` | `number`               | Frequency penalty.                                                                      | [src/batteries/llm/ollama/types.ts:119](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L119) |
|  `main_gpu?`                   | `number`               | Primary GPU index.                                                                      | [src/batteries/llm/ollama/types.ts:127](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L127) |
|  `min_p?`                         | `number`               | Min-p sampling cutoff.                                                                  | [src/batteries/llm/ollama/types.ts:101](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L101) |
|  `num_batch?`                 | `number`               | Prompt-processing batch size.                                                           | [src/batteries/llm/ollama/types.ts:123](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L123) |
|  `num_ctx?`                     | `number`               | Context window (KV-cache) size in tokens. Independent of the ADK `contextWindow` guard. | [src/batteries/llm/ollama/types.ts:93](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L93)   |
|  `num_gpu?`                     | `number`               | Number of layers to offload to GPU(s).                                                  | [src/batteries/llm/ollama/types.ts:125](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L125) |
|  `num_keep?`                   | `number`               | Tokens to keep from the initial prompt when context is exceeded.                        | [src/batteries/llm/ollama/types.ts:111](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L111) |
|  `num_predict?`             | `number`               | Max tokens to predict (`-1` = infinite, `-2` = fill context).                           | [src/batteries/llm/ollama/types.ts:109](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L109) |
|  `num_thread?`               | `number`               | CPU thread count.                                                                       | [src/batteries/llm/ollama/types.ts:129](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L129) |
|  `numa?`                           | `boolean`              | Enable NUMA support.                                                                    | [src/batteries/llm/ollama/types.ts:131](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L131) |
|  `penalize_newline?`   | `boolean`              | Penalize newline tokens.                                                                | [src/batteries/llm/ollama/types.ts:121](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L121) |
|  `presence_penalty?`   | `number`               | Presence penalty.                                                                       | [src/batteries/llm/ollama/types.ts:117](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L117) |
|  `repeat_last_n?`         | `number`               | Look-back window for repeat penalty.                                                    | [src/batteries/llm/ollama/types.ts:115](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L115) |
|  `repeat_penalty?`       | `number`               | Penalty applied to repeated tokens.                                                     | [src/batteries/llm/ollama/types.ts:113](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L113) |
|  `seed?`                           | `number`               | RNG seed for reproducible outputs.                                                      | [src/batteries/llm/ollama/types.ts:105](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L105) |
|  `stop?`                           | `string` | `string`\[] | Stop sequence(s).                                                                       | [src/batteries/llm/ollama/types.ts:107](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L107) |
|  `temperature?`             | `number`               | Sampling temperature.                                                                   | [src/batteries/llm/ollama/types.ts:95](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L95)   |
|  `top_k?`                         | `number`               | Top-k sampling cutoff.                                                                  | [src/batteries/llm/ollama/types.ts:99](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L99)   |
|  `top_p?`                         | `number`               | Nucleus sampling cutoff.                                                                | [src/batteries/llm/ollama/types.ts:97](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L97)   |
|  `typical_p?`                 | `number`               | Typical-p sampling cutoff.                                                              | [src/batteries/llm/ollama/types.ts:103](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L103) |
|  `use_mmap?`                   | `boolean`              | Memory-map the model.                                                                   | [src/batteries/llm/ollama/types.ts:133](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/ollama/types.ts#L133) |
