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
MaxNewTokens
Maximum number of tokens to generate. -1 keeps the default.
public int MaxNewTokens
Field Value
MinP
Drop tokens less likely than this fraction of the most likely token. -1 keeps the default.
public float MinP
Field Value
RepetitionPenalty
Penalty above 1 for repeating earlier tokens; 1 disables it. -1 keeps the default.
public float RepetitionPenalty
Field Value
Temperature
Sampling temperature; higher is more random. -1 keeps the default.
public float Temperature
Field Value
TopK
Sample only from the k most likely tokens. -1 keeps the default.
public int TopK
Field Value
TopP
Nucleus sampling: sample from the smallest set of tokens whose probability sums to p. -1 keeps the default.
public float TopP
Field Value
Methods
Creative()
Creative generation.
public static GenerationConfig Creative()
Returns
Default()
All model defaults.
public static GenerationConfig Default()
Returns
Greedy()
Greedy decoding (deterministic).
public static GenerationConfig Greedy()
Returns
Kjarni runs the same engine on every platform: