Files
vLLM/vllm/v1/watermarking/factory.py
T
7ee8a6dd01 [watermarking] Dual-key gumbel-max watermarking for speculative decoding support (#56122)
Signed-off-by: Raphael Rialland <raphael.rialland@mistral.ai>
Signed-off-by: Simon Veitner <sveitner@redhat.com>
Signed-off-by: Tomas Ruiz <tomas.ruiz.te@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: Simon Veitner <sveitner@redhat.com>
Co-authored-by: Tomas Ruiz <tomas.ruiz.te@gmail.com>
2026-09-12 18:42:01 +00:00

23 lines
778 B
Python

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from vllm.config.watermarking import WatermarkConfig
from vllm.v1.watermarking.gumbel import (
DualKeyGumbelWatermarker,
GumbelWatermarker,
)
from vllm.v1.watermarking.watermarker import Watermarker
def create_watermarker(config: WatermarkConfig) -> Watermarker:
if config.algorithm == "gumbel":
return GumbelWatermarker(config.key, config.context_width, config.prf)
if config.algorithm == "dual_key_gumbel":
return DualKeyGumbelWatermarker(
config.key,
config.context_width,
config.prf,
config.alpha,
)
raise ValueError(f"Unknown watermarking algorithm: {config.algorithm}")