English | 简体中文
A Tampermonkey userscript that adds an AI reading panel to Reddit thread pages. It summarizes the visible post and comments, then lets you ask follow-up questions with your own OpenAI-compatible Chat Completions endpoint.
- Adds a lightweight floating button on Reddit thread pages.
- Opens a Shadow DOM sidebar that avoids polluting Reddit page styles.
- Extracts the currently visible thread title, post body, subreddit, author metadata, and visible comments.
- Generates structured Markdown summaries with streaming output when supported.
- Supports follow-up Q&A based on the extracted thread context.
- Provides local settings for API URL, API key, model, prompts, streaming, theme, and comment limits.
- Stores configuration in Tampermonkey local storage through userscript APIs.
This project is a page-level reading assistant, not a Reddit automation or data collection tool.
- It only works with the Reddit thread page the user is already viewing.
- It only reads visible page content from the browser DOM.
- It does not use the Reddit API.
- It does not batch crawl Reddit pages.
- It does not post, reply, vote, message, follow, or operate accounts.
- It does not include a backend service for storing Reddit content.
- It is not intended for model training datasets or automated monitoring.
- Install a userscript manager such as Tampermonkey.
- Open
userscripts/reddit-thread-ai.user.js. - Install or update the script in the userscript manager.
- Open a Reddit thread page such as
https://www.reddit.com/r/<subreddit>/comments/<id>/.... - Use the
Reddit AI Readerbutton to open the sidebar.
Open the Settings tab in the sidebar and configure:
API URL: an OpenAI-compatible Chat Completions endpoint.API Key: stored locally by the userscript manager.Model: the model name supported by your endpoint.Summary Prompt: instructions for thread summaries.Chat Prompt: instructions for follow-up Q&A.Streaming: whether to use streamed responses when available.Max visible comments: the maximum number of visible comments to include.
Do not commit real API keys, private endpoints, screenshots with secrets, or personal account data.
The script targets Reddit thread pages on:
https://www.reddit.com/*https://new.reddit.com/*https://old.reddit.com/*
Reddit changes its frontend markup over time, so extraction selectors may need maintenance.
The main userscript lives at:
userscripts/reddit-thread-ai.user.js
When changing extraction or LLM behavior, verify:
- The sidebar opens on a Reddit thread page.
- Title, body, and visible comments are extracted.
- Missing API configuration is handled gracefully.
- Summaries and follow-up answers stay grounded in the visible thread context.
- API keys never appear in source code, logs, screenshots, or documentation.