parsers
Disable server-side tool/reasoning parsing under Output Protection (OP) Encryption.
vLLM's tool and reasoning parsers run after the OP plugin has encrypted the model
output, so they would parse ciphertext. That fails to extract anything useful and,
for several reasoning parsers, actively misroutes the entire encrypted payload into
reasoning_content while leaving content empty (which is then dropped when
include_reasoning is False).
Output Protection delegates tool/reasoning parsing to the client, which holds the shared key, decrypts the content, and runs the matching parser locally on the plaintext.
This module patches ParserManager.get_parser
so the parser it returns leaves the (encrypted) output untouched. The ciphertext flows through
verbatim as content, while still inheriting everything else (adjust_request, tool_parser_cls, reasoning_parser_cls, ...)
so vLLM keeps guiding generation (tool-call grammar / reasoning setup).
Under almost no circumstances should you need to import this module directly. If stainedglass_output_protection is installed, and
you launch vLLM via the alternative entrypoint, this module will be automatically applied.
Functions:
| Name | Description |
|---|---|
patch_parser_manager |
Patch |
wrap_parser_cls |
Return a passthrough subclass of |
patch_parser_manager
¶
Patch ParserManager.get_parser to return passthrough parsers.
wrap_parser_cls
¶
Return a passthrough subclass of base_cls.
The result is a subclass of base_cls (so callers keep its type and class
surface) that also mixes in _PassthroughParserMixin. Memoized so each base
class maps to a single wrapper class. Returns base_cls unchanged if it is
None or already a passthrough subclass (never double-wraps).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
type[ParserT] | None
|
The parser class returned by |
required |
Returns:
| Type | Description |
|---|---|
type[ParserT] | None
|
A passthrough subclass of |
type[ParserT] | None
|
nothing to wrap. |