mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #20909] [CLOSED] feat(functions): Add "Neural Log" Visualizer for Reasoning Models (DeepSeek R1) #64680
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20909
Author: @sjhddh
Created: 1/23/2026
Status: ❌ Closed
Base:
dev← Head:feat/deepseek-r1-neural-log-dev📝 Commits (1)
f6cda04feat(functions): Add DeepSeek R1 Neural-Log Visualizer📊 Changes
1 file changed (+116 additions, -0 deletions)
View changed files
➕
examples/filters/r1_neural_log.py(+116 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch will lead to immediate closure of the PR.Changelog Entry
Description
This PR introduces a new Function/Filter (
examples/filters/r1_neural_log.py) designed to enhance the Developer Experience (DX) when working with reasoning models like DeepSeek R1.Problem:
Reasoning models output their internal thought process within
<think>tags. Currently, this is displayed as raw text or hidden, making it difficult to distinguish between the "reasoning trace" and the final answer.Solution:
The Neural Log Visualizer intercepts these tags and transforms the content into a stylized "System Log" or "Cyberpunk Terminal" block. This visual separation allows users to inspect the logic chain without it cluttering the final response.
Added
examples/filters/r1_neural_log.py: A new filter that visualizes<think>tags as a styled terminal log.<think>tags (even if unclosed during streaming).[NEURAL]) to each line of reasoning.Additional Information
This filter is implemented as a standalone Python file in the
examples/filtersdirectory and does not modify core system files. It is intended to be used via the Functions interface.Screenshots or Videos
(Description of the visual effect)
The output replaces the raw
<think>...</think>content with a Markdown code block (language:logorbash).The block contains a "Boot Sequence" header (e.g.,
> INITIALIZING NEURAL PATHWAYS...) followed by the reasoning text, where each line is prefixed with a timestamp and a status tag (e.g.,[00:00:01.450] [NEURAL] ...).Testing Confirmation
✅ You have personally tested ALL changes in this PR
I have manually tested this filter by:
r1_neural_log.pycode to the Functions interface in a local Open WebUI instance.<think>tags (simulated and actual DeepSeek R1 output).<think>content is correctly intercepted and formatted into the code block.Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.