Using this app you can force DeepSeek R1 models to think more deeply by extending their reasoning process. It uses unsloth optimized models for better performance and unlimited context length (only limited by available VRAM).
The app works by detecting when the model tries to conclude thoughts too early and replacing those with prompts that encourage additional reasoning, continuing until a minimum threshold of thinking set by you is reached.
App by anzorq. If you like it, please consider supporting me:
![image](https://private-user-images.githubusercontent.com/3750161/406806995-05d1c32d-de56-446a-b8b7-e7e51fa32b18.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwODIyNDMsIm5iZiI6MTczOTA4MTk0MywicGF0aCI6Ii8zNzUwMTYxLzQwNjgwNjk5NS0wNWQxYzMyZC1kZTU2LTQ0NmEtYjhiNy1lN2U1MWZhMzJiMTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMDYxOTAzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTA5NGYyZjc2NDZhNTE2ODUyMDIwN2I3MmM5YmY2ZTUzOWJiYTQyYzE5N2E3ZjkyMzIyNjRiZWQ5MWQ5MThjZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.c-_nuT-eNvLpTN6h7BR4-RC_7d9T8FVBgM5KZ4OBRtQ)
- 🤔 Force models to think longer and more thoroughly
- 🔄 Customizable reasoning extensions and thinking thresholds
- 🎯 Fine-grained control over model parameters (temperature, top-p, etc.)
- 💭 Visible thinking process with token count tracking
- 📝 LaTeX support for mathematical expressions
- 🖥️ Optimized for various VRAM configurations
- ♾️ Unlimited context length (VRAM-dependent)
- 🔄 Choose from multiple model sizes (1.5B to 70B parameters)
You can choose from any of the unsloth-optimized distilled DeepSeek R1 models:
- 1.5B parameters (Qwen): unsloth/DeepSeek-R1-Distill-Qwen-1.5B
- 7B parameters (Qwen): unsloth/DeepSeek-R1-Distill-Qwen-7B
- 14B parameters (Qwen): unsloth/DeepSeek-R1-Distill-Qwen-14B
- 32B parameters (Qwen): unsloth/DeepSeek-R1-Distill-Qwen-32B
- 8B parameters (LLaMA): unsloth/DeepSeek-R1-Distill-Llama-8B
- 70B parameters (LLaMA): unsloth/DeepSeek-R1-Distill-Llama-70B
Choose the model size based on your available VRAM and performance requirements. Larger models generally provide better quality responses but require more VRAM. Qwen and LLaMA architectures may perform differently on various tasks.
Note: You can run models up to 14B parameters on a free Google Colab T4 GPU.
The paper "s1: Simple test-time scaling" is an independent work by Niklas Muennighoff et al. that tests and validates the approach used in this repository. The key contributions of the paper include:
- Developing budget forcing to control test-time compute by forcefully terminating the model’s thinking process or lengthening it by appending “Wait” multiple times to the model’s generation.
- Curating a small dataset s1K of 1,000 questions paired with reasoning traces.
- Achieving strong reasoning performance and test-time scaling with the Qwen2.5-32B-Instruct language model.
For more details, see the paper's repository.
- Original idea and implementation - vgel's gist
- DeepSeek LLM - https://github.com/deepseek-ai/DeepSeek-LLM
- unsloth - https://github.com/unsloth/unsloth
- Gradio - https://github.com/gradio-app/gradio
This project is licensed under the MIT License. See the LICENSE file for details.