#pragma once
#include "llama.h"
#include "common.h"
struct common_speculative;
std::string common_speculative_type_name_str(const std::vector<enum common_speculative_type> & types);
const char * common_speculative_all_types_str();
std::vector<enum common_speculative_type> common_speculative_types_from_names(const std::vector<std::string> & names);
enum common_speculative_type common_speculative_type_from_name(const std::string & name);
std::string common_speculative_type_to_str(enum common_speculative_type type);
common_speculative * common_speculative_init(common_params_speculative & params, uint32_t n_seq);
void common_speculative_free(common_speculative * spec);
struct common_speculative_draft_params {
bool drafting = false;
int32_t n_max = -1;
llama_pos n_past;
llama_token id_last;
const llama_tokens * prompt;
llama_tokens * result;
};
common_speculative_draft_params & common_speculative_get_draft_params(common_speculative * spec, llama_seq_id seq_id);
void common_speculative_begin(common_speculative * spec, llama_seq_id seq_id, const llama_tokens & prompt);
bool common_speculative_process(common_speculative * spec, const llama_batch & batch);
void common_speculative_draft(common_speculative * spec);
void common_speculative_accept(common_speculative * spec, llama_seq_id, uint16_t n_accepted);
void common_speculative_print_stats(const common_speculative * spec);
struct common_speculative_deleter {
void operator()(common_speculative * s) { common_speculative_free(s); }
};
typedef std::unique_ptr<common_speculative, common_speculative_deleter> common_speculative_ptr;