mtp_envelope.h¶
src/inference/mtp_envelope.h
@file mtp_envelope.h @brief Pure envelope check for the MTP speculative path (gh#108).
Owners: @tvanfossen
looks_like_mtp_head
bool entropic::looks_like_mtp_head(int n_layer)
True when the model's layer count is consistent with an MTP head GGUF.
src/inference/mtp_envelope.h:146
Source · 3 lines
inline bool looks_like_mtp_head(int n_layer) {
return n_layer >= 1 && n_layer <= 2;
}Activity · 1 steps
Requirements
mtp_head_classical_path_error
std::string entropic::mtp_head_classical_path_error(int n_layer)
Actionable error message for gh#107: MTP head on classical path.
src/inference/mtp_envelope.h:163
Source · 6 lines
inline std::string mtp_head_classical_path_error(int n_layer) {
return "Draft model has " + std::to_string(n_layer)
+ " layer(s) — this looks like an MTP head GGUF. "
"Set speculative.mtp: true in your config to route through "
"the target-owned shared-KV MTP path instead of crashing.";
}Activity · 1 steps
Requirements
mtp_unsupported_reason
std::string entropic::mtp_unsupported_reason(float temperature, bool has_grammar, bool streaming)
Reason MTP cannot run for a request, or "" when the envelope is safe.
src/inference/mtp_envelope.h:123
Source · 7 lines
inline std::string mtp_unsupported_reason(float temperature, bool has_grammar,
bool streaming) {
(void)temperature;
(void)has_grammar; // gh#108 v2.10.0: grammar propagated via to_common_sampling
(void)streaming; // gh#108 v2.10.0: StreamThinkFilter handles live strip
return {};
}