Skip to content

ZenWayne/llmsearch

Repository files navigation

LLMSearch - LLM智能搜索增强

License: MIT Python 3.10+ English

基于Haystack框架构建的智能搜索增强语言模型系统,结合最新大语言模型与实时网络搜索能力。

主要特性

  • 🔍 实时网络搜索集成(支持Google/Serper/Bing等)
  • 🤖 多LLM支持(OpenAI/Groq/SiliconFlow等)
  • 🧩 模块化设计,易于扩展
  • ⚡ 支持流式响应
  • 🔌 兼容各大openai前端(如cherry studio、Chatbox、AnythingLLM)
  • 📊 搜索结果智能排序与过滤
  • 🌐 支持多语言(中文/英文)

DEMO

DEMO

快速开始

安装依赖

  1. 安装SearxNG,用于获取网络搜索结果 SearxNG 需要安装并运行在您的机器上,或者您可以使用默认的 searxng.io 服务。
mkdir my-instance
cd my-instance
export PORT=8080
docker pull searxng/searxng
docker run --rm \
             -d -p ${PORT}:8080 \
             -v "${PWD}/searxng:/etc/searxng" \
             -e "BASE_URL=http://localhost:$PORT/" \
             -e "INSTANCE_NAME=my-instance" \
             searxng/searxng
  1. 安装python库crawl4ai,用于爬虫和解析网页
# Install the package
pip install -U crawl4ai

# For pre release versions
pip install crawl4ai --pre

# Run post-installation setup
crawl4ai-setup

# Verify your installation
crawl4ai-doctor
  1. 安装项目依赖
git clone https://github.com/yourusername/llmsearch.git
cd llmsearch
pip install -r requirements.txt

环境配置

  1. 创建一个.env文件到当前目录并输入以下配置
LANG=zh_CN
HOST=127.0.0.1
PORT=8001
SILICONFLOW_API_KEY=your-siliconflow-api-key
GROQ_API_KEY=your-groq-api-key
OPENAI_API_BASE_URL=your-openai-api-base-url
MODEL=your-model
SEARXNG_URL=your-searxng-url
USE_SILICONFLOW_EMBEDDER=true
  1. export 环境变量
export LANG=zh_CN
export HOST=127.0.0.1
export PORT=8001
export SILICONFLOW_API_KEY=your-siliconflow-api-key
export GROQ_API_KEY=your-groq-api-key
export OPENAI_API_BASE_URL=your-openai-api-base-url
export MODEL=your-model
export SEARXNG_URL=your-searxng-url
export USE_SILICONFLOW_EMBEDDER=true

USE_SILICONFLOW_EMBEDDER 是可选的,用于切换嵌入模型从本地到远程硅基流动平台。

基础使用

python api_server.py

许可证

本项目采用 MIT License

About

llm model with online search powered by haystack

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages