之前刷论坛看到了这个项目,感觉可以在pplx不能c后作为替代
于是部署了一下并写了个部署教程,方便各位参考
自建Perplexica
Perplexica 是开源的Perplexity替代品,一个AI驱动的搜索引擎
写在安装前的话
注意,本项目使用到的searxng需要连接google等搜索引擎,需要开全局魔法!
需要提前准备好nginx和new-api,还需要一个域名
下面假设你的域名是xx.com,并且new-api.xx.com已经正确的反代理到new-api上面了
设置dns
在域名dns控制面板新增两个子域名:searxng.xx.com和pplx.xx.com
设置nginx
我这里为了偷懒,nginx使用的是nginx-proxy-manager-zh,这里假设你服务器的内网ip是192.168.50.2
searxng.xx.com的反向代理这样设置- 记得设置ssl
pplx.xx.com的反向代理这样设置- 记得设置ssl
开始部署
-
克隆 Perplexica 仓库
-
git clone https://github.com/ItzCrazyKns/Perplexica.git
-
-
克隆后,进入至包含项目文件的目录
-
将
sample.config.toml文件重命名为config.toml-
编辑
config.toml -
[API_KEYS] OPENAI = "" GROQ = "" ANTHROPIC = "" [API_ENDPOINTS] OLLAMA = "" SEARXNG = "https://searxng.xx.com" [GENERAL] PORT = 3_001 SIMILARITY_MEASURE = "cosine"
-
-
编辑
docker-compose.yaml-
services: searxng: image: docker.io/searxng/searxng:latest volumes: - ./searxng:/etc/searxng:rw ports: - 8080:8080 networks: - perplexica-network restart: unless-stopped perplexica-backend: build: context: . dockerfile: backend.dockerfile image: itzcrazykns1337/perplexica-backend:main environment: - SEARXNG_API_URL=http://192.168.50.2:8080 depends_on: - searxng ports: - 3001:3001 volumes: - backend-dbstore:/home/perplexica/data - ./config.toml:/home/perplexica/config.toml extra_hosts: - 'host.docker.internal:host-gateway' networks: - perplexica-network restart: unless-stopped perplexica-frontend: build: context: . dockerfile: app.dockerfile args: - NEXT_PUBLIC_API_URL=https://pplx.xx.com/api - NEXT_PUBLIC_WS_URL=wss://pplx.xx.com/ws image: itzcrazykns1337/perplexica-frontend:main depends_on: - perplexica-backend ports: - 3000:3000 networks: - perplexica-network restart: unless-stopped networks: perplexica-network: volumes: backend-dbstore:
-
-
部署(注意!必须自己构建镜像)
sudo docker compose up -d --build
然后你就可以打开https://pplx.xx.com,查看是否可以正常显示了
如果部署正确,你可以看到类似于下图的界面
设置ai
打开上图左下角的齿轮图标,设置
分别填写你想要使用的ai模型名称(名称请以new-api中显示的为准),api的密钥和bash_url
注意,bash_url请写成https://new-api.xx.com/v1








