Skip to content

Forces DeepSeek R1 models to engage in extended reasoning by intercepting early termination tokens.

Notifications You must be signed in to change notification settings

latent-variable/r1_reasoning_effort

Repository files navigation

R1 Reasoning Effort

Overview

R1 Reasoning Effort is a multi-API reasoning pipeline within open-webui that integrates OpenAI and Ollama, enabling responses with varying levels of reasoning depth. It supports iterative refinement, allowing multiple reasoning cycles with context-aware adjustments.

The Reasoning Effort parameter controls how long the model spends thinking before finalizing a response. Ranging from 1 to 100, each increment forces an additional reasoning iteration, enhancing depth and coherence in the generated output.

Reasoning Effort Demo

This project is inspired by r1-overthinker, extending its concepts to support multiple APIs and provide an improved structured reasoning pipeline.

Features

  • Multi-API Support: Choose between OpenAI and Ollama APIs for reasoning.
  • Configurable Reasoning Iterations: Set effort levels to control the depth of reasoning.
  • Dynamic Response Refinement: Iteratively refine responses with extended reasoning.
  • Customizable End Tokens & Prompts: Define how and when reasoning phases end.
  • Logging & Error Handling: Provides robust logging and handling for API errors.

Usage

Basic Example

The core pipeline is implemented in the Pipe class. It processes messages, determines reasoning effort, and interacts with the chosen API.

Configuration

Modify the Valves with in the open-webui function after setup: Blog post on how to set a pipe up

License

This project is based on r1-overthinker and extends its functionality.

MIT License. See LICENSE for details.

About

Forces DeepSeek R1 models to engage in extended reasoning by intercepting early termination tokens.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages