Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    OllamaModelOptions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Ollama
    Assembly: Glitch9.AIDevKit.Provider.Ollama.dll
    Syntax
    public class OllamaModelOptions

    Properties

    | Edit this page View Source

    FrequencyPenalty

    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?
    | Edit this page View Source

    LowVram

    Ollama only. Use VRAM-optimized loading.

    Declaration
    [JsonProperty("low_vram")]
    public bool? LowVram { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    MainGpu

    Ollama only. ID of the main GPU to prioritize.

    Declaration
    [JsonProperty("main_gpu")]
    public int? MainGpu { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    NumBatch

    Number of tokens to process in a single batch.

    Declaration
    [JsonProperty("num_batch")]
    public int? NumBatch { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    NumCtx

    Ollama only. Number of context tokens (max sequence length).

    Declaration
    [JsonProperty("num_ctx")]
    public int? NumCtx { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    NumGpu

    Ollama only. Number of GPUs to use.

    Declaration
    [JsonProperty("num_gpu")]
    public int? NumGpu { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    Numa

    Ollama only. Enable NUMA-aware optimization.

    Declaration
    [JsonProperty("numa")]
    public bool? Numa { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    PenalizeNewline

    Ollama only. Whether to apply penalties to newline tokens.

    Declaration
    [JsonProperty("penalize_newline")]
    public bool? PenalizeNewline { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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>
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    UseMlock

    Ollama only. Lock model in RAM.

    Declaration
    [JsonProperty("use_mlock")]
    public bool? UseMlock { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    UseMmap

    Ollama only. Use memory-mapped files.

    Declaration
    [JsonProperty("use_mmap")]
    public bool? UseMmap { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    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?

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation