Entropic 2.11.1
Local-first agentic inference engine
Loading...
Searching...
No Matches
empty_content_diagnosis.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
27#pragma once
28
29#include <string>
30
31namespace entropic {
32
40
51inline EmptyContentCause diagnose_empty_content(bool content_empty,
52 bool produced_tokens,
53 const std::string& finish_reason) {
55 if (!content_empty || !produced_tokens) {
57 } else if (finish_reason == "length") {
59 } else if (finish_reason == "stop") {
61 }
62 return cause;
63}
64
73inline std::string explain_empty_content(EmptyContentCause cause) {
74 // The gh#137 case deliberately does NOT mention max_tokens: the model chose
75 // to stop, so more budget changes nothing and naming it misdirects.
76 static const std::string kBudget =
77 "The generation hit its token budget while still inside a reasoning "
78 "block, so no answer was ever produced and the content is empty. This "
79 "is a budget problem: raise max_tokens for this tier.";
80 static const std::string kStopped =
81 "The model ended the turn while still inside an unterminated reasoning "
82 "block, so the content is empty. finish_reason is 'stop', NOT 'length' "
83 "— this is not a budget problem and raising max_tokens will not help. "
84 "The prompt or tier configuration is not converging on an answer.";
85 static const std::string kUnknown =
86 "The turn produced tokens but delivered no content, and the finish "
87 "reason does not explain why. This is not a parse error; report it "
88 "with the raw generation attached.";
89
90 std::string out;
92 out = kBudget;
93 } else if (cause == EmptyContentCause::model_stopped) {
94 out = kStopped;
95 } else if (cause == EmptyContentCause::unknown) {
96 out = kUnknown;
97 }
98 return out;
99}
100
101} // namespace entropic
Activate model on GPU (WARM → ACTIVE).
std::string explain_empty_content(EmptyContentCause cause)
Operator-facing explanation for an empty-content turn.
EmptyContentCause
Why a turn produced tokens but delivered no content.
@ budget_truncated
finish_reason == "length": ran out of tokens.
@ unknown
Empty for a reason this rule cannot attribute.
@ not_empty
Content survived; nothing to explain.
@ model_stopped
Model ended the turn while still reasoning.
EmptyContentCause diagnose_empty_content(bool content_empty, bool produced_tokens, const std::string &finish_reason)
Classify an empty-content turn from what the decode reported.