Tiny QA 是一个完全本地化的智能文档问答系统,基于 Ollama 本地大语言模型构建。它能够处理 PDF、Word、Excel、TXT、Markdown 等多种格式的文档,通过向量化技术实现语义搜索,并基于相关文档内容生成准确的回答。
在开始使用 Tiny QA 之前,您需要先安装以下三个核心工具:
Git 是一个分布式版本控制系统,用于下载和管理项目代码。
Windows:
ounter(lineounter(lineounter(lineounter(line#下载并安装GitforWindows#访问:https://git-scm.com/download/win#或使用wingetwingetinstallGit.Git
macOS:
ounter(lineounter(lineounter(lineounter(lineounter(line# 使用 Homebrew 安装brew install git# 或使用官方安装包# 访问: https://git-scm.com/download/mac
Linux (Ubuntu/Debian):
ounter(lineounter(linesudoaptupdatesudoaptinstallgit
Linux (CentOS/RHEL):
ounter(lineounter(lineounter(linesudoyuminstallgit#或sudodnfinstallgit
ounter(linegit--version
Python 是 Tiny QA 的主要开发语言,用于运行 Web 服务和 AI 处理逻辑。
Windows:
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(line# 下载并安装 Python# 访问: https://www.python.org/downloads/# 或使用 wingetwinget install Python.Python.3.11# 验证安装python --versionpip --version
macOS:
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(line# 使用 Homebrew 安装brew install python@3.11# 或使用官方安装包# 访问: https://www.python.org/downloads/macos/# 验证安装python3 --versionpip3 --version
Linux (Ubuntu/Debian):
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(linesudo apt updatesudo apt install python3 python3-pip python3-venv# 验证安装python3 --versionpip3 --version
Linux (CentOS/RHEL):
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(linesudo yum install python3 python3-pip# 或sudo dnf install python3 python3-pip# 验证安装python3 --versionpip3 --version
ounter(lineounter(lineounter(lineounter(lineounter(line# 使用清华大学镜像源pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/# 或使用阿里云镜像源pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
Ollama 是一个强大的本地大语言模型运行框架,支持多种开源模型。
Windows:
ounter(lineounter(lineounter(lineounter(line#下载并安装Ollama#访问:https://ollama.ai/download#或使用wingetwingetinstallOllama.Ollama
macOS:
ounter(lineounter(lineounter(lineounter(lineounter(line# 使用 Homebrew 安装brew install ollama# 或使用官方安装脚本curl -fsSL https://ollama.ai/install.sh | sh
Linux:
ounter(lineounter(line#使用官方安装脚本curl-fsSLhttps://ollama.ai/install.sh|sh
ounter(lineollama--version
ounter(lineollamaserve
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(line# 下载推荐的对话模型ollama pull deepseek-r1:1.5b# 或下载其他模型ollama pull qwen3:4bollama pull llama3:latest
ounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(lineounter(line# 1. 克隆项目git clone https://gitee.com/hu9001/tiny-qa.gitcd tiny-qa# 2. 创建 Python 虚拟环境python -m venv envsource env/bin/activate # Linux/macOS# env\Scripts\activate # Windows# 3. 安装 Python 依赖pip install -r requirements.txt# 4. 启动服务ollama serve &python app.py
ounter(lineounter(lineounter(lineounter(line文档处理→向量搜索→AI问答↓↓↓PDF/Word/Excel→语义向量→Ollama模型TXT/Markdown→相似度搜索→智能回答
Q: 首次启动很慢?A: 系统需要下载 AI 模型,首次启动会较慢。建议提前下载模型:ollama pull deepseek-r1:1.5b
Q: 数据安全吗?A: 完全本地化部署,数据不会上传到任何服务器。
Q: 支持哪些语言?A: 支持中文、英文等多种语言,取决于选择的模型。
Q: Git 安装失败怎么办?A: 确保网络连接正常,或访问 https://git-scm.com/downloads 手动下载安装包。
Q: Python 版本不兼容?A: 确保安装 Python 3.8+ 版本,推荐使用 Python 3.9 或 3.11。
Q: pip 安装包很慢?A: 配置国内镜像源:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
Q: Ollama 服务启动失败?A: 检查端口 11434 是否被占用,或重启 Ollama 服务:ollama serve
Q: 模型下载很慢?A: 可以使用国内镜像源,或选择较小的模型如deepseek-r1:1.5b(约1GB)。
Q: 内存不足怎么办?A: 选择较小的模型,或增加系统内存。推荐至少 8GB RAM。
Tiny QA 为个人和企业提供了一个安全、高效的本地知识管理解决方案。通过结合现代 AI 技术和向量搜索,它能够快速处理大量文档并提供智能问答服务,是构建个人知识库的理想工具。
如果您对本地化 AI 应用感兴趣,Tiny QA 是一个很好的起点。
| 欢迎光临 链载Ai (https://www.lianzai.com/) | Powered by Discuz! X3.5 |