Commit c82b79886 for llama.cpp
commit c82b7988662405e595b2ac5ac4bafd2915606db8
Author: Xuan-Son Nguyen <son@huggingface.co>
Date: Tue Dec 1 14:25:56 2026 +0100
server: add "repetition_penalty" as alias for "repeat_penalty" (#33439)
diff --git a/tools/server/README.md b/tools/server/README.md
index 62cc57551..f690d7c04 100644
--- a/tools/server/README.md
+++ b/tools/server/README.md
@@ -557,7 +557,7 @@ These words will not be included in the completion, so make sure to add them to
`typical_p`: Enable locally typical sampling with parameter p. Default: `1.0`, which is disabled.
-`repeat_penalty`: Control the repetition of token sequences in the generated text. Default: `1.1`
+`repeat_penalty`: Control the repetition of token sequences in the generated text (alias: `repetition_penalty`). Default: `1.1`
`repeat_last_n`: Last n tokens to consider for penalizing repetition. Default: `64`, where `0` is disabled.
@@ -878,7 +878,7 @@ Returns raw audio bytes (`audio/wav` by default) rather than JSON. For the list
`temperature`: Temperature for the backbone sampler and the audio frames, for models that support it. `0` is greedy sampling. Optional, absent keeps the server `--temp` for the backbone and the model defaults for the audio.
-`repeat_penalty`: Repetition penalty applied to the backbone sampler over the whole generation (default `1.05`). Without this, the backbone can loop and re-generate the same utterance.
+`repeat_penalty`: Repetition penalty applied to the backbone sampler over the whole generation (alias: `repetition_penalty`, default `1.05`). Without this, the backbone can loop and re-generate the same utterance.
`seed`: RNG seed for both the backbone sampler and the codec/vocoder (`-1` = random, the default). Set to a fixed value for reproducible output.
diff --git a/tools/server/server-context.cpp b/tools/server/server-context.cpp
index 3b58c972a..063eb897a 100644
--- a/tools/server/server-context.cpp
+++ b/tools/server/server-context.cpp
@@ -5713,7 +5713,7 @@ static json parse_tts_body(const server_http_req & req) {
body[k] = std::stoll(body[k].get<std::string>());
}
}
- for (const char * k : { "top_p", "temperature", "repeat_penalty", "speed", "loudness", "cfg_scale" }) {
+ for (const char * k : { "top_p", "temperature", "repeat_penalty", "repetition_penalty", "speed", "loudness", "cfg_scale" }) {
if (body.contains(k) && body[k].is_string()) {
body[k] = std::stof(body[k].get<std::string>());
}
diff --git a/tools/server/server-schema.cpp b/tools/server/server-schema.cpp
index ccae2458b..e111e983d 100644
--- a/tools/server/server-schema.cpp
+++ b/tools/server/server-schema.cpp
@@ -130,6 +130,7 @@ std::vector<std::unique_ptr<field>> make_llama_cmpl_schema(const common_params &
->set_desc("Last n tokens to consider for penalizing repetition (0 = disabled)"));
add((new field_num("repeat_penalty", params.sampling.penalty_repeat))
+ ->add_alias("repetition_penalty")
->set_desc("Control the repetition of token sequences in the generated text (1.0 = disabled)"));
add((new field_num("frequency_penalty", params.sampling.penalty_freq))
@@ -574,6 +575,7 @@ std::vector<std::unique_ptr<field>> make_tts_schema(server_task & task) {
->set_desc("Max number of audio frames to generate"));
add((new field_num("repeat_penalty", task.params.sampling.penalty_repeat))
+ ->add_alias("repetition_penalty")
->set_desc("Repetition penalty applied to the backbone sampler over the whole generation"));
add((new field_bool("stream", task.params.stream))