Skip to content

Frontend: preserve server-default repetition detection backport - #693

Open
myshytf wants to merge 1 commit into
local-inference-lab:dev/infernal-invocationfrom
myshytf:fix/repetition-detection-server-default
Open

myshytf wants to merge 1 commit into
local-inference-lab:dev/infernal-invocationfrom
myshytf:fix/repetition-detection-server-default

Conversation

@myshytf

@myshytf myshytf commented Sep 7, 2026

Copy link
Copy Markdown

Operator-configurable repetition-detection defaults

Status: historical upstream backport, not enabled in the active Kimi service. Published for review at the operator's request; no new serving behavior is introduced by publication.

Prepared commit 95b96696e702 preserves the server-default plumbing from upstream vllm-project/vllm#51036. Original authorship and attribution are retained.

The change admits repetition_detection from model generation configuration, converts its JSON object to RepetitionDetectionParams, and lets chat/completion requests inherit that default when they do not supply their own setting. Request values still take precedence. Without an operator-configured default or request value the detector remains disabled.

Important distinction

This configuration feature is not the fix for corrupted four-token prefill tails. Lab #687 corrects the underlying graph-selection defect. This branch only exposes an optional output-stopping policy and is not being used to conceal that defect or presented as a precision-preserving model optimization.

Validation and compatibility

The corresponding upstream PR records six protocol-default tests, generation-config conversion coverage and eight neighboring stop-token default tests. The prepared branch includes the protocol and model-config test additions. The publication audit inspected those changes and ran git diff --check; it did not rerun the historical full test matrix or model evaluation.

The branch targets the local-inference-lab integration line. It is a backport record of existing upstream work, not a duplicate upstream proposal. Open lab searches found no separate server-default repetition-detection PR.

Current-base review and tests are required before merge. No active generation configuration, repetition penalty, stopping policy, server or cache was changed. AI assistance was used for publication; human merge approval is not asserted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KxvNwugeU8RJFd7WRYwNLG

The repetition detector (check_sequence_repetition, FinishReason
REPETITION) exists in the scheduler and is exposed per-request, but
there is no way for an operator to enable it server-side: the
get_diff_sampling_param allowlist drops it from generation configs
(--generation-config / --override-generation-config), and the OpenAI
protocols never fell back to default_sampling_params for it.

Add repetition_detection to the allowlist, convert the raw JSON dict
into typed RepetitionDetectionParams in ModelConfig, and fall back to
the server default in Completion/Chat to_sampling_params when the
request does not set its own - the same pattern used for stop_token_ids
in vllm-project#22519.

Co-authored-by: Kimi (AI coding assistant)
Signed-off-by: Islam <islam.almersawi@openinnovation.ai>
@myshytf
myshytf requested a review from mgoin as a code owner September 7, 2026 07:37
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 2b378c0a-48c5-437a-a1ab-60dca7a317e2

📥 Commits

Reviewing files that changed from the base of the PR and between b5f995e and 95b9669.

📒 Files selected for processing (5)
  • tests/entrypoints/openai/test_repetition_detection_defaults.py
  • tests/test_config.py
  • vllm/config/model.py
  • vllm/entrypoints/openai/chat_completion/protocol.py
  • vllm/entrypoints/openai/completion/protocol.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants