API reference · Kjarni 0.2.7

Struct GenerationConfig

Namespace: Kjarni
Assembly: Kjarni.dll

Generation parameters for decoder models. Use -1 sentinel values to keep model defaults.

public struct GenerationConfig

Fields

DoSample

1 samples, 0 decodes greedily (always the most likely token), -1 keeps the default.

public int DoSample

Field Value

int

MaxNewTokens

Maximum number of tokens to generate. -1 keeps the default.

public int MaxNewTokens

Field Value

int

MinP

Drop tokens less likely than this fraction of the most likely token. -1 keeps the default.

public float MinP

Field Value

float

RepetitionPenalty

Penalty above 1 for repeating earlier tokens; 1 disables it. -1 keeps the default.

public float RepetitionPenalty

Field Value

float

Temperature

Sampling temperature; higher is more random. -1 keeps the default.

public float Temperature

Field Value

float

TopK

Sample only from the k most likely tokens. -1 keeps the default.

public int TopK

Field Value

int

TopP

Nucleus sampling: sample from the smallest set of tokens whose probability sums to p. -1 keeps the default.

public float TopP

Field Value

float

Methods

Creative()

Creative generation.

public static GenerationConfig Creative()

Returns

GenerationConfig

Default()

All model defaults.

public static GenerationConfig Default()

Returns

GenerationConfig

Greedy()

Greedy decoding (deterministic).

public static GenerationConfig Greedy()

Returns

GenerationConfig

Kjarni runs the same engine on every platform: