Skip to content

Commit 07e2c97

Browse files
committed
eagle3: support --eagle3 in llama-cli
1 parent b8ab2cc commit 07e2c97

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

common/arg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
33523352
[](common_params & params) {
33533353
params.speculative.eagle3 = true;
33543354
}
3355-
).set_examples({LLAMA_EXAMPLE_SPECULATIVE}));
3355+
).set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_CLI}));
33563356
add_opt(common_arg(
33573357
{"-cd", "--ctx-size-draft"}, "N",
33583358
string_format("size of the prompt context for the draft model (default: %d, 0 = loaded from model)", params.speculative.n_ctx),

tools/server/server-context.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,18 @@ struct server_context_impl {
671671
}
672672

673673
params_base.speculative.model_dft = model_dft.get();
674+
params_base.speculative.model_tgt = model;
674675
params_base.speculative.cparams_dft = common_context_params_to_llama(params_dft);
676+
677+
if (params_base.speculative.eagle3) {
678+
// EAGLE3 current limitation: extracted target features are per-context; multiple slots would overwrite each other
679+
if (params_base.n_parallel > 1) {
680+
SRV_ERR("%s", "EAGLE3 speculative decoding is not supported with n_parallel > 1\n");
681+
return false;
682+
}
683+
llama_set_eagle3(ctx, model_dft.get());
684+
SRV_INF("%s", "EAGLE3 feature extraction enabled on target model\n");
685+
}
675686
}
676687

677688
std::string & mmproj_path = params_base.mmproj.path;

0 commit comments

Comments
 (0)