--- START OF FILE docs.html --- AI Hub Pro - User Manual
AI Hub Pro Docs v2.0

1. 项目简介1. Introduction

AI Hub Pro 是一个全栈 AI 聚合客户端。它提供了一个类似 ChatGPT 的现代化界面,支持流式对话、文档解析 (RAG)、多模态展示以及深度思考模型支持。 AI Hub Pro is a full-stack AI aggregation client. It offers a ChatGPT-like modern interface, supporting streamed chat, document parsing (RAG), multi-modal display, and deep reasoning models.

本项目作为连接器,您需要自备 API Key(支持 OpenAI/Claude/Gemini 等标准格式)。 This project acts as a connector. You need to provide your own API Key (supports OpenAI/Claude/Gemini standard formats).

2 安装与启动Installation & Startup

Windows (Recommended)

双击运行项目根目录下的 run.bat。它会自动创建环境、安装依赖并启动浏览器。 Double-click run.bat in the root directory. It automatically sets up the environment, installs dependencies, and opens the browser.

Mac / Linux

1. 安装依赖1. Install Dependencies

pip install -r requirements.txt

2. 启动服务2. Start Server

python app.py

3 API 配置API Configuration

点击左下角头像 -> 系统设置 Click Avatar (bottom left) -> Settings.

API Endpoint

接口地址,例如:Service URL, e.g.:

  • https://api.openai.com/v1
  • https://your-oneapi-domain.com/v1

API Key

以 sk- 开头的密钥。Key starting with sk-.

已加密存储 (Fernet Encryption)Encrypted Storage

4 核心功能Core Features

流式对话 & 深度思考Stream Chat & Reasoning

支持 Markdown、代码高亮。自动识别 DeepSeek R1 等模型的 <think> 标签,并将其折叠显示,保持界面整洁。 Supports Markdown, Syntax Highlighting. Automatically detects and folds <think> tags from reasoning models like DeepSeek R1.

系统提示词 (Persona)System Prompts (Persona)

点击输入框上方的按钮,设定 AI 的人设(如“翻译官”、“Python 专家”)。支持一键清空和预设切换。 Set the AI's persona (e.g., "Translator", "Python Expert") via the button above the input box.

文档解析 (RAG)Doc Parsing (RAG)

上传 PDF/Word/TXT,系统会自动提取文本发送给 AI。AI 将基于文档内容回答您的问题。 Upload PDF/Word/TXT files. The system extracts text and sends it to the AI for context-aware answers.

5 设置与优化Settings & Optimization

上下文长度控制 (Context Length)Context Length Control

在设置中,通过滑块调整发送给 AI 的历史消息数量(默认为 20 条)。 Adjust the number of historical messages sent to the AI via the slider in Settings (Default: 20).

  • 调小数值 (如 2): 节省 Token,适合单次问答。Low (e.g., 2): Saves tokens, good for single-turn Q&A.
  • 调大数值 (如 60): 增强记忆,适合长文写作或复杂任务。High (e.g., 60): Better memory, good for long contexts.

7 常见问题FAQ

Q: 为什么每次重启都要重新登录? Q: Why do I have to relogin after restart?
这通常发生在生产环境。系统现在会在根目录自动生成一个 key 文件来固定 Secret Key。请确保该文件未被删除。 The system now auto-generates a key file in root to fix the Secret Key. Ensure this file is not deleted.
Q: 报错 400 Context Length Exceeded? Q: Error 400 Context Length Exceeded?
这是因为对话历史太长了。请进入设置,减小“上下文长度控制”的数值(建议 20 左右),或者开启新对话。 Conversation history is too long. Go to Settings, reduce "Context Length" (recommend ~20), or start a new chat.