Interface: OllamaLLMParams
@providerprotocol/ai / ollama / OllamaLLMParams
Interface: OllamaLLMParams
Section titled “Interface: OllamaLLMParams”Defined in: src/providers/ollama/types.ts:32
Ollama-specific LLM parameters for model inference.
These parameters control model behavior during text generation. Most map
directly to Ollama’s options field in the API, while some (keep_alive,
think, logprobs, top_logprobs) are top-level request parameters.
All parameters are optional and will use Ollama’s defaults if not specified.
Example
Section titled “Example”const params: OllamaLLMParams = { temperature: 0.7, top_p: 0.9, num_predict: 500, stop: ['\n\n', 'END']};https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values Ollama Parameters
Properties
Section titled “Properties”f16_kv?
Section titled “f16_kv?”
optionalf16_kv:boolean
Defined in: src/providers/ollama/types.ts:103
Enable f16 KV cache
frequency_penalty?
Section titled “frequency_penalty?”
optionalfrequency_penalty:number
Defined in: src/providers/ollama/types.ts:61
Frequency penalty (default: 0.0)
keep_alive?
Section titled “keep_alive?”
optionalkeep_alive:string|number
Defined in: src/providers/ollama/types.ts:124
Keep model loaded in memory (string duration like “5m” or number of seconds)
logprobs?
Section titled “logprobs?”
optionallogprobs:boolean
Defined in: src/providers/ollama/types.ts:127
Return log probabilities
low_vram?
Section titled “low_vram?”
optionallow_vram:boolean
Defined in: src/providers/ollama/types.ts:100
Enable low VRAM mode
main_gpu?
Section titled “main_gpu?”
optionalmain_gpu:number
Defined in: src/providers/ollama/types.ts:97
Main GPU to use (default: 0)
min_p?
Section titled “min_p?”
optionalmin_p:number
Defined in: src/providers/ollama/types.ts:46
Minimum probability for a token to be considered (default: 0.0)
mirostat?
Section titled “mirostat?”
optionalmirostat:0|1|2
Defined in: src/providers/ollama/types.ts:64
Mirostat sampling mode (0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0)
mirostat_eta?
Section titled “mirostat_eta?”
optionalmirostat_eta:number
Defined in: src/providers/ollama/types.ts:67
Mirostat learning rate (default: 0.1)
mirostat_tau?
Section titled “mirostat_tau?”
optionalmirostat_tau:number
Defined in: src/providers/ollama/types.ts:70
Mirostat target entropy (default: 5.0)
num_batch?
Section titled “num_batch?”
optionalnum_batch:number
Defined in: src/providers/ollama/types.ts:88
Number of batches (default: 512)
num_ctx?
Section titled “num_ctx?”
optionalnum_ctx:number
Defined in: src/providers/ollama/types.ts:85
Context window size (default: model-dependent)
num_gpu?
Section titled “num_gpu?”
optionalnum_gpu:number
Defined in: src/providers/ollama/types.ts:94
Number of layers to offload to GPU (default: auto)
num_keep?
Section titled “num_keep?”
optionalnum_keep:number
Defined in: src/providers/ollama/types.ts:82
Number of tokens to keep from initial prompt (default: 4)
num_predict?
Section titled “num_predict?”
optionalnum_predict:number
Defined in: src/providers/ollama/types.ts:34
Maximum number of tokens to predict (default: -1 = infinite)
num_thread?
Section titled “num_thread?”
optionalnum_thread:number
Defined in: src/providers/ollama/types.ts:91
Number of threads (default: auto)
optionalnuma:boolean
Defined in: src/providers/ollama/types.ts:115
NUMA support
penalize_newline?
Section titled “penalize_newline?”
optionalpenalize_newline:boolean
Defined in: src/providers/ollama/types.ts:73
Penalize newlines (default: true)
presence_penalty?
Section titled “presence_penalty?”
optionalpresence_penalty:number
Defined in: src/providers/ollama/types.ts:58
Presence penalty (default: 0.0)
repeat_last_n?
Section titled “repeat_last_n?”
optionalrepeat_last_n:number
Defined in: src/providers/ollama/types.ts:55
Number of tokens to look back for repeat penalty (default: 64)
repeat_penalty?
Section titled “repeat_penalty?”
optionalrepeat_penalty:number
Defined in: src/providers/ollama/types.ts:52
Repeat penalty (default: 1.1)
optionalseed:number
Defined in: src/providers/ollama/types.ts:79
Seed for deterministic sampling (default: random)
optionalstop:string[]
Defined in: src/providers/ollama/types.ts:76
Stop sequences
temperature?
Section titled “temperature?”
optionaltemperature:number
Defined in: src/providers/ollama/types.ts:37
Temperature for randomness (default: 0.8)
tfs_z?
Section titled “tfs_z?”
optionaltfs_z:number
Defined in: src/providers/ollama/types.ts:118
TFS-Z sampling (default: 1.0 = disabled)
think?
Section titled “think?”
optionalthink:boolean|"low"|"medium"|"high"
Defined in: src/providers/ollama/types.ts:121
Enable thinking mode (for models that support it)
top_k?
Section titled “top_k?”
optionaltop_k:number
Defined in: src/providers/ollama/types.ts:43
Top-k sampling (default: 40)
top_logprobs?
Section titled “top_logprobs?”
optionaltop_logprobs:number
Defined in: src/providers/ollama/types.ts:130
Number of top log probabilities to return
top_p?
Section titled “top_p?”
optionaltop_p:number
Defined in: src/providers/ollama/types.ts:40
Top-p (nucleus) sampling (default: 0.9)
typical_p?
Section titled “typical_p?”
optionaltypical_p:number
Defined in: src/providers/ollama/types.ts:49
Typical p sampling (default: 1.0 = disabled)
use_mlock?
Section titled “use_mlock?”
optionaluse_mlock:boolean
Defined in: src/providers/ollama/types.ts:109
Use mlock for memory locking
use_mmap?
Section titled “use_mmap?”
optionaluse_mmap:boolean
Defined in: src/providers/ollama/types.ts:106
Use mmap for model loading
vocab_only?
Section titled “vocab_only?”
optionalvocab_only:boolean
Defined in: src/providers/ollama/types.ts:112
Vocabulary only mode