先看一下 qwen3-4b模型的效果
SearXNG簡介:SearXNG 是一個免費的互聯網元搜索引擎,它匯總了來自各種搜索服務和數據庫的結果。用戶既不會被跟蹤,也不會被分析。
官方項目:https://github.com/searxng/searxng-docker
項目文檔:https://docs.searxng.org
open-webui簡介:Open WebUI 是一個可擴展、功能豐富且用戶友好的自托管 AI 平臺,旨在完全離線運行。它支持各種 LLM 運行器,如?Ollama?和?OpenAI 兼容的 API,并內置了 RAG 推理引擎,使其成為強大的 AI 部署解決方案。
官方項目:https://github.com/open-webui/open-webui
項目文檔:? Features | Open WebUI
安裝部署
open-webui的安裝方法非常簡單
命令行安裝:
#安裝
pip install open-webui
#運行
open-webui serve
#這將啟動 Open WebUI 服務器,您可以在 http://localhost:8080
open-webui的使用可以參考項目文檔
docker安裝:
docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
如何與模型對接也可以參考我的其它文檔:?快速搭建大模型web對話環境指南(open-webUI)_大模型 webui 框架-CSDN博客
本次文檔主要介紹searxng安裝與使用
searxng 安裝是支持 k8s 部署 docker compose部署 與命令行腳本安裝或手動安裝
本人都體驗了一下
k8s是通過helm安裝的,項目地址: https://github.com/searxng/searxng-helm-chart 該項目更新貌似不積極,而且也不是裝好就能用也需要調整,適合k8s能力強者部署
命令行手動與腳本安裝 需要提前準備好centos9 或ubuntu22以及以上的系統 python3.10以上環境才能安裝成功,也需要自己配置nginx代理 自己配置開機自啟動,而且容易很多報錯,適合動手動能力強體驗一下 參考官方文檔:Installation Script — SearXNG Documentation (2025.7.9+2fe854090)
本次文檔介紹docker compose安裝 簡單方便
官方配置:https://github.com/searxng/searxng-docker/blob/master/docker-compose.yaml
(文檔建立在默認配置好docker環境的服務器中,并有能力拉取dockerhub鏡像倉庫)
進入searxng-docker項目目錄后 修改docker-compose.yaml 文件配置
本次配置做了一些修改:
刪除了caddy相關配置,這是一個類似nginx的反向代理服務,這個一般企業內安裝是不需要的,根據個人所需決定是否安裝
version: "3.7"services:redis:container_name: redisimage: docker.io/valkey/valkey:8-alpinecommand: valkey-server --save 30 1 --loglevel warningrestart: unless-stoppednetworks:- searxngvolumes:- valkey-data2:/datalogging:driver: "json-file"options:max-size: "1m"max-file: "1"searxng:container_name: searxngimage: searxng/searxng:latestrestart: unless-stoppednetworks:- searxngports:- "0.0.0.0:8080:8080"volumes:- engines-file:/usr/local/searxng/searx/engines #這里將搜引擎目錄持久化出來 是因為searxng docker鏡像默是缺失國內搜索引擎的配置的- ./searxng:/etc/searxng:rwenvironment:- SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost}/- UWSGI_WORKERS=${SEARXNG_UWSGI_WORKERS:-4}- UWSGI_THREADS=${SEARXNG_UWSGI_THREADS:-4}- SEARXNG_SETTINGS_PATH=/etc/searxng/settings.ymllogging:driver: "json-file"options:max-size: "1m"max-file: "1"networks:searxng:#卷持久化路徑需要配置一下 不了解可以問一下ai都是什么意思
volumes:valkey-data2:driver: localdriver_opts:type: noneo: binddevice: /data/searxng-docker/redis/valkey engines-file:driver: localdriver_opts:type: noneo: binddevice: /data/searxng-docker/engines-file
修改配置文件searxng-docker/searxng/settings.yml (這是一次正確配置 大家可以參考)
# see https://docs.searxng.org/admin/settings/settings.html#settings-use-default-settings
use_default_settings: true
server:# base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.ymlsecret_key: "34788b49b8f9d819cfcb09da447b0d8586c63ad1acd469a1e446" #這個可以復用 也可以自己生成limiter: falseimage_proxy: true
ui:static_use_hash: true
redis:url: redis://redis:6379/0
search:formats:- html- json ##開啟json模式 方便被llm調用engines:
# 啟用默認禁用的國內引擎- name: baiducategories:- web- news- generalengine: baidushortcut: bdtimeout: 9.0disabled: false- name: 360searchcategories:- web- news- generalengine: 360searchshortcut: 360sotimeout: 9.0disabled: false# 禁用默認啟用的外國搜索引擎- name: archlinuxwikiengine: archlinuxdisabled: true- name: duckduckgoengine: duckduckgodistabled: true- name: githubengine: githubshortcut: ghdisabled: true- name: wikipediaengine: wikipediadisabled: true- name: wikidataengine: wikidatadisabled: true- name: googleengine: googledisabled: true- name: youtubeengine: youtube_noapidisabled: true- name: duckduckgoengine: duckduckgodisabled: true- name: qwantengine: qwantdisabled: true- name: braveengine: bravedisabled: true- name: startpageengine: startpagedisabled: true- name: currencyengine: currencydisabled: true
這里重點說一下 searxng/searxng:latest 這個鏡像 是沒有自帶國內搜索引擎的,看網上很多人并不需要特殊配置就可以用國內引擎,我是存疑的
會報錯
Errno 2] No such file or directory: '/usr/local/searxng/searx/engines/baidu.py
這也是為什么我將engines-file:/usr/local/searxng/searx/engines 持久化到/data/searxng-docker/engines-file
嘗試第一次啟動:
docker compose up -d
之后訪問該機器8080端口 可以看到如下頁面:
配置默認國內搜索引擎
點擊首選項
查看搜索引擎
確認是否有國內的搜索引擎
如果沒有就需要將 國內的引擎配置文件導入 (另外 上圖首選項的哪些配置只保存在客戶端的cookie中,并不是全局生效的)
導入步驟如下:
打開項目:https://github.com/searxng/searxng-docker/tree/master/searxng
找到引擎文件 并下載
將下載好的引擎導入到容器持久化目錄/data/searxng-docker/engines-file
重啟容器:
docker compose stop
docker compose up -d
再次確認國內引擎是否可以選中
確認搜索內容 引擎加載正常
之后打開open-webui 設置-管理員設置-聯網搜索-searxng查詢URL
http://<IP地址或域名>:8080/search?q=<query>
之后測試對話: