n | int | 1 | Number of output sequences generated from the prompt. The top n sequences are returned. |
best_of | int | n | Number of output sequences generated from the prompt. The top n sequences are returned from these best_of sequences. Must be ≥ n. Treated as beam width in beam search. |
presence_penalty | float | 0.0 | Penalizes new tokens based on their presence in the generated text so far. Values > 0 encourage new tokens, values < 0 encourage repetition. |
frequency_penalty | float | 0.0 | Penalizes new tokens based on their frequency in the generated text so far. Values > 0 encourage new tokens, values < 0 encourage repetition. |
repetition_penalty | float | 1.0 | Penalizes new tokens based on their appearance in the prompt and generated text. Values > 1 encourage new tokens, values < 1 encourage repetition. |
temperature | float | 1.0 | Controls the randomness of sampling. Lower values make it more deterministic, higher values make it more random. Zero means greedy sampling. |
top_p | float | 1.0 | Controls the cumulative probability of top tokens to consider. Must be in (0, 1]. Set to 1 to consider all tokens. |
top_k | int | -1 | Controls the number of top tokens to consider. Set to -1 to consider all tokens. |
min_p | float | 0.0 | Represents the minimum probability for a token to be considered, relative to the most likely token. Must be in [0, 1]. Set to 0 to disable. |
use_beam_search | bool | false | Whether to use beam search instead of sampling. |
length_penalty | float | 1.0 | Penalizes sequences based on their length. Used in beam search. |
early_stopping | bool or string | false | Controls stopping condition in beam search. Can be true, false, or "never". |
stop | string or list[str] | None | String(s) that stop generation when produced. The output will not contain these strings. |
stop_token_ids | list[int] | None | List of token IDs that stop generation when produced. Output contains these tokens unless they are special tokens. |
ignore_eos | bool | false | Whether to ignore the End-Of-Sequence token and continue generating tokens after its generation. |
max_tokens | int | 16 | Maximum number of tokens to generate per output sequence. |
min_tokens | int | 0 | Minimum number of tokens to generate per output sequence before EOS or stop sequences. |
skip_special_tokens | bool | true | Whether to skip special tokens in the output. |
spaces_between_special_tokens | bool | true | Whether to add spaces between special tokens in the output. |
truncate_prompt_tokens | int | None | If set, truncate the prompt to this many tokens. |