nemo_voice_agent.vllm.v1.sample.logits_processor
nemo_voice_agent.vllm.v1.sample.logits_processor
Submodules
Package Contents
Classes
API
Bases: LogitsProcessor
Enforce a per-request thinking-token budget for reasoning models.
The processor tracks thinking-start / thinking-end boundaries in each
request’s output. Once a request’s thinking token count enters the
grace window, \n and end-token logits are boosted. At the hard
limit all logits except the next forced end token are set to -inf.
Additively boost newline and end-token logits.
Encode text without special tokens.
Set all logits to -inf except the next token in the end sequence.
Advances forcing_end_idx each call.
Obtain a tokenizer from the vLLM config.
Called by process_dict_updates for each newly added request.
Return True if prompt_tok_ids ends with pattern, ignoring any trailing tokens whose ID is in skip_ids (e.g. newlines).
Update state by scanning output_tok_ids[from_idx:].
Modify the logits in place to force thinking-budget exits when the limit is reached.
Return whether this processor preserves argmax behavior (it does not).
Sync per-request thinking state with the batch update from vLLM.
Validate thinking-budget-related extra_args on the provided sampling params.