-
public class LlmGenerationConfig.Builder
Builder class for constructing LlmGenerationConfig instances.
Provides a fluent interface for configuring generation parameters with sensible defaults.All methods return the builder instance to enable method chaining.
-
-
Method Summary
Modifier and Type Method Description LlmGenerationConfig.Builder
echo(boolean echo)
Sets whether to include the input prompt in the generated output. LlmGenerationConfig.Builder
maxNewTokens(int maxNewTokens)
Sets the maximum number of new tokens to generate. LlmGenerationConfig.Builder
warming(boolean warming)
Enables or disables model warming. LlmGenerationConfig.Builder
seqLen(int seqLen)
Sets the maximum sequence length for generation. LlmGenerationConfig.Builder
temperature(float temperature)
Sets the temperature for random sampling. LlmGenerationConfig
build()
Constructs the LlmGenerationConfig instance with the configured parameters. -
-
Method Detail
-
echo
LlmGenerationConfig.Builder echo(boolean echo)
Sets whether to include the input prompt in the generated output.
- Parameters:
echo
- true to include input prompt, false to return only new tokens
-
maxNewTokens
LlmGenerationConfig.Builder maxNewTokens(int maxNewTokens)
Sets the maximum number of new tokens to generate.
- Parameters:
maxNewTokens
- the token limit (-1 for unlimited generation)
-
warming
LlmGenerationConfig.Builder warming(boolean warming)
Enables or disables model warming.
- Parameters:
warming
- true to generate initial tokens for model warmup
-
seqLen
LlmGenerationConfig.Builder seqLen(int seqLen)
Sets the maximum sequence length for generation.
- Parameters:
seqLen
- maximum sequence length (-1 for default behavior)
-
temperature
LlmGenerationConfig.Builder temperature(float temperature)
Sets the temperature for random sampling.
- Parameters:
temperature
- sampling temperature (typical range 0.0-1.
-
build
LlmGenerationConfig build()
Constructs the LlmGenerationConfig instance with the configured parameters.
-
-
-
-