This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| vLLM preserve_thinking proxy (multi-session, restart-safe) | |
| Behaviour | |
| ───────── | |
| 1. Forwards requests to UPSTREAM (CLI `--upstream`, env | |
| PRESERVE_THINKING_PROXY_UPSTREAM, or default https://vllm.treowai.com). | |
| 2. Injects preserve_thinking=true into chat_template_kwargs when the client did | |
| not set it (OpenAI Chat, Responses API, and Anthropic Messages / Claude Code). |