A reasoning model supports three evaluation modes with different context window budgets:
"non-think": 8192 tokens"high": 131072 tokens"max": 393216 tokensImplement prepare_eval_input(tokens, mode, reserved_output) that prepares a prompt for evaluation under a given mode:
tokens: a list of integer token ids representing the input prompt.mode: one of "non-think", "high", "max".reserved_output: a non-negative integer number of tokens that must be reserved for the model's output within the context window.Let C be the context window for the given mode. The maximum allowed input length is L = C - reserved_output. If L <= 0, return an empty list. Otherwise, if len(tokens) > L, left-truncate the prompt so that only the last L tokens remain (keeping the most recent context). If len(tokens) <= L, return the prompt unchanged.
If mode is not one of the three valid strings, raise ValueError.
Return the resulting list of token ids.