Skip to content

Server: preserve raw prompts in /v1/completions - #1012

Open
kyuz0 wants to merge 1 commit into
antirez:mainfrom
kyuz0:fix/raw-openai-completions-main
Open

Server: preserve raw prompts in /v1/completions#1012
kyuz0 wants to merge 1 commit into
antirez:mainfrom
kyuz0:fix/raw-openai-completions-main

Conversation

@kyuz0

@kyuz0 kyuz0 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

/v1/completions currently wraps the supplied prompt in a system/user conversation and adds an assistant prefix. Continue the raw prefix instead, with only the model's start sequence added to string prompts.

  • Preserve supplied token IDs exactly; reject unsupported prompt shapes and invalid IDs.
  • Keep compatibility thinking controls inert and preserve generated thinking tags while honoring model/client stops.
  • Keep live and disk cache reuse consistent with the actual raw prompt, including tokenization boundaries.

Validation: model-free DeepSeek/GLM prompt, token-ID, stop and cache regression fixtures; CPU server, agent and session tests; AddressSanitizer/UndefinedBehaviorSanitizer checks. The initial prompt/cache fixture fails against unchanged main. Model-backed inference has not been rerun for this server-only change.

Remove the injected system/user conversation from string prompts, preserve exact token-ID prompts, and keep compatibility thinking controls inert. Retain model stops without applying chat-only thinking-tag stops.

Validate raw live and disk cache histories before reuse, preserving model start tokens and sampled tokenization boundaries. Add model-free prompt/cache/stop regressions and a model-backed tokenization check.
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.

1 participant