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
| """ | |
| MLX-VLM Thinking Format Patch | |
| ============================= | |
| Problem: Qwen3.5 (and similar thinking models) output "Thinking Process:\n...\n</think>" | |
| instead of proper <think>...</think> tags when served via mlx_vlm.server. | |
| This breaks UIs like Open WebUI that expect standard <think> tag format. | |
| Fix: Add a transform function and apply it to both streaming and non-streaming responses. |