From b1e42d062e2893ea897c92219180309372910864 Mon Sep 17 00:00:00 2001 From: Ivan Charapanau Date: Tue, 3 Sep 2024 12:21:07 +0200 Subject: [PATCH] feat: perplexica service --- .gitignore | 6 +++++- README.md | 2 +- compose.perplexica.yml | 36 ++++++++++++++++++++++++++++++++ compose.x.perplexica.ollama.yml | 4 ++++ compose.x.perplexica.searxng.yml | 4 ++++ default.env | 4 ++++ harbor.sh | 5 +++++ perplexica/override.env | 2 ++ perplexica/source.config.toml | 1 + searxng/settings.yml.new | 2 +- 10 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 compose.perplexica.yml create mode 100644 compose.x.perplexica.ollama.yml create mode 100644 compose.x.perplexica.searxng.yml create mode 100644 perplexica/override.env create mode 100644 perplexica/source.config.toml diff --git a/.gitignore b/.gitignore index 845336e..8604093 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,8 @@ textgrad/workspace/* chatui/data/ # ComfyUI -comfyui/workspace/ \ No newline at end of file +comfyui/workspace/ + +# Perplexica +perplexica/data/ +perplexica/config.toml \ No newline at end of file diff --git a/README.md b/README.md index 8ab5048..5dee728 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ harbor open ##### Satellites -[SearXNG](https://github.com/av/harbor/wiki/Services#searxng) ⦁︎ [Dify](https://github.com/av/harbor/wiki/Services#dify) ⦁︎ [Plandex](https://github.com/av/harbor/wiki/Services#plandex) ⦁︎ [LiteLLM](https://github.com/av/harbor/wiki/Services#-litellm) ⦁︎ [LangFuse](https://github.com/av/harbor/wiki/Services#langfuse) ⦁︎ [Open Interpreter](https://github.com/av/harbor/wiki/Services#-open-interpreter) ⦁︎ [cloudflared](https://github.com/av/harbor/wiki/Services#cloudflared) ⦁︎ [cmdh](https://github.com/av/harbor/wiki/Services#cmdh) ⦁︎ [fabric](https://github.com/av/harbor/wiki/Services#fabric) ⦁︎ [txtai RAG](https://github.com/av/harbor/wiki/Services#txtai-rag) ⦁︎ [TextGrad](https://github.com/av/harbor/wiki/Services#textgrad) ⦁︎ [Aider](https://github.com/av/harbor/wiki/Services#aider) +[SearXNG](https://github.com/av/harbor/wiki/Services#searxng) ⦁︎ [Perplexica](https://github.com/av/harbor/wiki/Services#perplexica) ⦁︎ [Dify](https://github.com/av/harbor/wiki/Services#dify) ⦁︎ [Plandex](https://github.com/av/harbor/wiki/Services#plandex) ⦁︎ [LiteLLM](https://github.com/av/harbor/wiki/Services#-litellm) ⦁︎ [LangFuse](https://github.com/av/harbor/wiki/Services#langfuse) ⦁︎ [Open Interpreter](https://github.com/av/harbor/wiki/Services#-open-interpreter) ⦁︎ [cloudflared](https://github.com/av/harbor/wiki/Services#cloudflared) ⦁︎ [cmdh](https://github.com/av/harbor/wiki/Services#cmdh) ⦁︎ [fabric](https://github.com/av/harbor/wiki/Services#fabric) ⦁︎ [txtai RAG](https://github.com/av/harbor/wiki/Services#txtai-rag) ⦁︎ [TextGrad](https://github.com/av/harbor/wiki/Services#textgrad) ⦁︎ [Aider](https://github.com/av/harbor/wiki/Services#aider) ## Why? diff --git a/compose.perplexica.yml b/compose.perplexica.yml new file mode 100644 index 0000000..4d32482 --- /dev/null +++ b/compose.perplexica.yml @@ -0,0 +1,36 @@ +services: + perplexica: + image: andypenno/perplexica-frontend + container_name: ${HARBOR_CONTAINER_PREFIX}.perplexica + env_file: + - ./.env + - ./perplexica/override.env + depends_on: + - perplexica-be + ports: + - ${HARBOR_PERPLEXICA_HOST_PORT}:3000 + networks: + - harbor-network + environment: + - BACKEND_API_URL=http://localhost:${HARBOR_PERPLEXICA_BACKEND_HOST_PORT}/api + - BACKEND_WS_URL=ws://localhost:${HARBOR_PERPLEXICA_BACKEND_HOST_PORT} + + perplexica-be: + image: andypenno/perplexica-backend + container_name: ${HARBOR_CONTAINER_PREFIX}.perplexica-be + env_file: + - ./.env + - ./perplexica/override.env + ports: + - ${HARBOR_PERPLEXICA_BACKEND_HOST_PORT}:3001 + volumes: + - ./perplexica/data:/home/perplexica/data + - ./perplexica/source.config.toml:/home/perplexica/config.toml + networks: + - harbor-network + environment: + - PORT=3001 + - SIMILARITY_MEASURE=cosine + - OPENAI_API_KEY=${HARBOR_OPENAI_KEY} + - GROQ_API_KEY=${HARBOR_GROQ_KEY} + - ANTHROPIC_API_KEY=${HARBOR_ANTHROPIC_KEY} diff --git a/compose.x.perplexica.ollama.yml b/compose.x.perplexica.ollama.yml new file mode 100644 index 0000000..988e5fd --- /dev/null +++ b/compose.x.perplexica.ollama.yml @@ -0,0 +1,4 @@ +services: + perplexica-be: + environment: + - OLLAMA_API_ENDPOINT=http://ollama:11434 \ No newline at end of file diff --git a/compose.x.perplexica.searxng.yml b/compose.x.perplexica.searxng.yml new file mode 100644 index 0000000..0094032 --- /dev/null +++ b/compose.x.perplexica.searxng.yml @@ -0,0 +1,4 @@ +services: + perplexica-be: + environment: + - SEARXNG_API_ENDPOINT=http://searxng:8080 \ No newline at end of file diff --git a/default.env b/default.env index 58f3037..5de03ac 100644 --- a/default.env +++ b/default.env @@ -242,6 +242,10 @@ HARBOR_COMFYUI_PASSWORD="sk-comfyui" HARBOR_COMFYUI_ARGS="" HARBOR_COMFYUI_PROVISIONING="https://raw.githubusercontent.com/av/harbor/main/comfyui/provisioning.sh" +# Perplexica +HARBOR_PERPLEXICA_HOST_PORT=34041 +HARBOR_PERPLEXICA_BACKEND_HOST_PORT=34042 + # ============================================ # Service Configuration. # You can specify any of the service's own environment variables here. diff --git a/harbor.sh b/harbor.sh index d8ffd82..6f96b6b 100755 --- a/harbor.sh +++ b/harbor.sh @@ -42,12 +42,17 @@ show_help() { echo " mistralrs - Configure mistral.rs service" echo " cfd - Run cloudflared CLI" echo " airllm - Configure AirLLM service" + echo " txtai - Configure txtai service" + echo " chatui - Configure HuggingFace ChatUI service" + echo " comfyui - Configure ComfyUI service" echo echo "Service CLIs:" echo " parllama - Launch Parllama - TUI for chatting with Ollama models" echo " plandex - Launch Plandex CLI" + echo " aider - Launch Aider CLI" echo " interpreter|opint - Launch Open Interpreter CLI" echo " fabric - Run Fabric CLI" + echo " cmdh - Run cmdh CLI" echo " hf - Run the Harbor's Hugging Face CLI. Expanded with a few additional commands." echo " hf dl - HuggingFaceModelDownloader CLI" echo " hf parse-url - Parse file URL from Hugging Face" diff --git a/perplexica/override.env b/perplexica/override.env new file mode 100644 index 0000000..ee5f2c2 --- /dev/null +++ b/perplexica/override.env @@ -0,0 +1,2 @@ +# Can contain overrides for Perplexica's environment variables +# SEARXNG_API_ENDPOINT=http://localhost:5000 \ No newline at end of file diff --git a/perplexica/source.config.toml b/perplexica/source.config.toml new file mode 100644 index 0000000..72e428c --- /dev/null +++ b/perplexica/source.config.toml @@ -0,0 +1 @@ +# This config will be overridden by Perplexica on save \ No newline at end of file diff --git a/searxng/settings.yml.new b/searxng/settings.yml.new index cb29e38..7f2d5f8 100644 --- a/searxng/settings.yml.new +++ b/searxng/settings.yml.new @@ -88,7 +88,7 @@ server: # If your instance owns a /etc/searxng/settings.yml file, then set the following # values there. - secret_key: "e47be161cc49ae2dd9bd8da4c3beeff7715b041491ba67204ab99589f64239dd" # Is overwritten by ${SEARXNG_SECRET} + secret_key: "5419595d1f587d40277d2dcf202f9333254299316dec253731b0a0fa0f1eb8b9" # Is overwritten by ${SEARXNG_SECRET} # Proxy image results through SearXNG. Is overwritten by ${SEARXNG_IMAGE_PROXY} image_proxy: false # 1.0 and 1.1 are supported