Finish Reasons
Finish reason
Part of: Reading Model Outputs
Your model spits out a beautiful answer that ends mid-sentence: "...and the three main causes are first,", then nothing. Nobody hit a key. The model didn't crash. It hit a wall called the token limit, and a single field in the response told you exactly that. That field is the finish reason , and reading it turns "why is my output broken?" into "oh, it got cut off." What it is Every response carries a finish reason : a short string explaining why generation stopped. The model produces tokens one at a time and needs a reason to quit. There are a handful of standard reasons, and each one means something different for how you should treat the output. The common values: - stop : the model finished naturally. It decided the answer was complete and emitted its end signal. This is the happy path. - length : generation hit the maximum-length cap (the max tokens limit). The answer is cut off mid-thought. Nothing is wrong with the model; you simply didn't give it enough room. - stop sequence : the model produced a string you told it to stop on (covered in lesson 4). It halted on purpose, at a boundary you defined. - content filter : the output was blocked by a safety filter. The text was with
Challenge: Continuation Retry Engine