eagle3: support --eagle3 in llama-cli

This commit is contained in:
ruixiangw
2026-02-28 00:33:54 +00:00
parent b8ab2cc559
commit 07e2c9707c
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -3352,7 +3352,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
[](common_params & params) {
params.speculative.eagle3 = true;
}
).set_examples({LLAMA_EXAMPLE_SPECULATIVE}));
).set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_CLI}));
add_opt(common_arg(
{"-cd", "--ctx-size-draft"}, "N",
string_format("size of the prompt context for the draft model (default: %d, 0 = loaded from model)", params.speculative.n_ctx),
+11
View File
@@ -671,7 +671,18 @@ private:
}
params_base.speculative.model_dft = model_dft.get();
params_base.speculative.model_tgt = model;
params_base.speculative.cparams_dft = common_context_params_to_llama(params_dft);
if (params_base.speculative.eagle3) {
// EAGLE3 current limitation: extracted target features are per-context; multiple slots would overwrite each other
if (params_base.n_parallel > 1) {
SRV_ERR("%s", "EAGLE3 speculative decoding is not supported with n_parallel > 1\n");
return false;
}
llama_set_eagle3(ctx, model_dft.get());
SRV_INF("%s", "EAGLE3 feature extraction enabled on target model\n");
}
}
std::string & mmproj_path = params_base.mmproj.path;