Class OllamaModelOptions
This class defines a flexible set of parameters that control how text is generated by a language model. These options are entirely optional, but tuning them allows for precise control over randomness, token filtering, sampling behavior, and performance tuning.
Inherited Members
Namespace: Glitch9.AIDevKit.Ollama
Assembly: Glitch9.AIDevKit.Provider.Ollama.dll
Syntax
public class OllamaModelOptions
Properties
| Edit this page View SourceFrequencyPenalty
Penalizes tokens that occur frequently across the generated content. Range: -2.0??.0 (typical: 0??.0).
Declaration
[JsonProperty("frequency_penalty")]
public float? FrequencyPenalty { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
LowVram
Ollama only. Use VRAM-optimized loading.
Declaration
[JsonProperty("low_vram")]
public bool? LowVram { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
MainGpu
Ollama only. ID of the main GPU to prioritize.
Declaration
[JsonProperty("main_gpu")]
public int? MainGpu { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
MinP
Minimum probability for token filtering (less common). Range: 0.0??.0
Declaration
[JsonProperty("min_p")]
public float? MinP { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
Mirostat
Ollama only. Enables Mirostat sampling (0: off, 1 or 2: enabled).
Declaration
[JsonProperty("mirostat")]
public int? Mirostat { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
MirostatEta
Ollama only. Controls learning rate in Mirostat sampling. Typical: 0.1
Declaration
[JsonProperty("mirostat_eta")]
public float? MirostatEta { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
MirostatTau
Ollama only. ontrols surprise level in Mirostat sampling. Typical: 5.0
Declaration
[JsonProperty("mirostat_tau")]
public float? MirostatTau { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
NumBatch
Number of tokens to process in a single batch.
Declaration
[JsonProperty("num_batch")]
public int? NumBatch { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
NumCtx
Ollama only. Number of context tokens (max sequence length).
Declaration
[JsonProperty("num_ctx")]
public int? NumCtx { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
NumGpu
Ollama only. Number of GPUs to use.
Declaration
[JsonProperty("num_gpu")]
public int? NumGpu { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
NumKeep
Ollama only. Number of initial tokens to keep from context when truncating.
Declaration
[JsonProperty("num_keep")]
public int? NumKeep { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
NumPredict
Ollama only. Maximum number of tokens to predict (like max_tokens).
Declaration
[JsonProperty("num_predict")]
public int? NumPredict { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
NumThread
Ollama only. Number of CPU threads to use for inference. Typical: number of physical CPU cores.
Declaration
[JsonProperty("num_thread")]
public int? NumThread { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Numa
Ollama only. Enable NUMA-aware optimization.
Declaration
[JsonProperty("numa")]
public bool? Numa { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
PenalizeNewline
Ollama only. Whether to apply penalties to newline tokens.
Declaration
[JsonProperty("penalize_newline")]
public bool? PenalizeNewline { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
PresencePenalty
Penalizes tokens already present in the generated content. Range: -2.0??.0 (typical: 0??.0).
Declaration
[JsonProperty("presence_penalty")]
public float? PresencePenalty { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
RepeatLastN
Ollama only. Number of previous tokens to consider for repetition penalty. Typical: 64??56
Declaration
[JsonProperty("repeat_last_n")]
public int? RepeatLastN { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
RepeatPenalty
Penalizes repetition of recent tokens. Range: 0.0??.0 (typical: 1.1).
Declaration
[JsonProperty("repeat_penalty")]
public float? RepeatPenalty { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
Seed
Random seed for reproducibility. Set to the same value for deterministic output.
Declaration
[JsonProperty("seed")]
public long? Seed { get; set; }
Property Value
| Type | Description |
|---|---|
| long? |
Stop
List of strings that, if generated, will stop further generation.
Declaration
[JsonProperty("stop")]
public List<string> Stop { get; set; }
Property Value
| Type | Description |
|---|---|
| List<string> |
Temperature
Sampling temperature: controls randomness in output. Lower = deterministic, Higher = creative. Range: 0.0??.0 (typical: 0.7??.0).
Declaration
[JsonProperty("temperature")]
public float? Temperature { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
TopK
Top-K sampling: limits the next token selection to the K most probable tokens. Range: 1??00 (typical: 40).
Declaration
[JsonProperty("top_k")]
public int? TopK { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
TopP
Top-P sampling (nucleus sampling): limits the next token selection to a cumulative probability. Range: 0.0??.0 (typical: 0.9).
Declaration
[JsonProperty("top_p")]
public float? TopP { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
TypicalP
Ollama only. Typical sampling, alternative to top_p. Range: 0.0??.0
Declaration
[JsonProperty("typical_p")]
public float? TypicalP { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
UseMlock
Ollama only. Lock model in RAM.
Declaration
[JsonProperty("use_mlock")]
public bool? UseMlock { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
UseMmap
Ollama only. Use memory-mapped files.
Declaration
[JsonProperty("use_mmap")]
public bool? UseMmap { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |
VocabOnly
Ollama only. Only load the vocabulary; do not load full model.
Declaration
[JsonProperty("vocab_only")]
public bool? VocabOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? |