Skip to content

Instantly share code, notes, and snippets.

@leosuncin
Last active October 21, 2024 15:12
Show Gist options
  • Save leosuncin/a819587d3ffc2cffffacc0679ec5a627 to your computer and use it in GitHub Desktop.
Save leosuncin/a819587d3ffc2cffffacc0679ec5a627 to your computer and use it in GitHub Desktop.
AnythingLLM

Click the "Download ZIP" button and extract the files somewhere in your PC

Requirement

[1] In case you have a NVIDIA card

Run

Inside the extracted folder create a searxng folder and move the files settings.yml and limiter.toml inside it.

mkdir -p searxng && mv settings.yml limiter.toml $_

Start the services

docker compose up -d

Pull models

Optional pull manually the models

docker compose exec ollama ollama pull llama3:latest
docker compose exec ollama ollama pull mxbai-embed-large:latest
docker compose exec ollama ollama pull codellama:7b-code-q6_K

Extra

To enable Web Search skill, go to Agent Skill setting, then turn on "Web Search", pick SearXNG from the providers, and save the changes.

Agent Skill screen

services:
redis:
image: docker.io/valkey/valkey:8-alpine
container_name: redis
command: valkey-server --save 30 1 --loglevel warning
restart: unless-stopped
volumes:
- valkey-data:/data
healthcheck:
test: ['CMD-SHELL', 'redis-cli ping | grep PONG']
interval: 1s
timeout: 3s
retries: 5
cap_drop:
- ALL
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
chroma:
image: ghcr.io/chroma-core/chroma:latest
container_name: chroma
environment:
IS_PERSISTENT: TRUE
command: '--workers 4 --host 0.0.0.0 --port 9000 --proxy-headers --timeout-keep-alive 30'
volumes:
- chroma-data:/chroma/chroma/
ports:
- '9000:9000'
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:9000/api/v1/heartbeat']
interval: 30s
timeout: 10s
retries: 3
searxng:
image: docker.io/searxng/searxng:latest
container_name: searxng
restart: unless-stopped
volumes:
- ./searxng:/etc/searxng:rw
ports:
- '8080:8080'
environment:
- BASE_URL=http://searxng:8080
- BIND_ADDRESS=0.0.0.0:8080
depends_on:
redis:
condition: service_healthy
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
ollama:
image: ollama/ollama
container_name: ollama
restart: unless-stopped
volumes:
- ollama-data:/root/.ollama
ports:
- 11434:11434
healthcheck:
test: ollama list || exit 1
interval: 10s
timeout: 30s
retries: 5
start_period: 10s
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- gpu
pull_models:
image: alpine/curl
restart: "no"
command: |
curl -X POST http://ollama:11434/api/pull -H 'Content-Type: application/json' -d '{"name": "llama3:latest"}'
curl -X POST http://ollama:11434/api/pull -H 'Content-Type: application/json' -d '{"name": "mxbai-embed-large:latest"}'
curl -X POST http://ollama:11434/api/pull -H 'Content-Type: application/json' -d '{"name": "codellama:7b-code-q6_K"}'
depends_on:
ollama:
condition: service_healthy
anythingllm:
image: mintplexlabs/anythingllm
container_name: anythingllm
restart: unless-stopped
volumes:
- anythingllm-data:/app/server/storage
ports:
- '3001:3001'
cap_add:
- SYS_ADMIN
environment:
# Adjust for your environment
- STORAGE_DIR=/app/server/storage
- JWT_SECRET="make this a large list of random numbers and letters 20+"
- LLM_PROVIDER=ollama
- OLLAMA_BASE_PATH=http://ollama:11434
- OLLAMA_MODEL_PREF=llama3:latest
- OLLAMA_MODEL_TOKEN_LIMIT=4096
- EMBEDDING_ENGINE=ollama
- EMBEDDING_BASE_PATH=http://ollama:11434
- EMBEDDING_MODEL_PREF=mxbai-embed-large:latest
- EMBEDDING_MODEL_MAX_CHUNK_LENGTH=8192
- VECTOR_DB=chroma
- CHROMA_ENDPOINT=http://chroma:9000
- WHISPER_PROVIDER=local
- TTS_PROVIDER=native
- PASSWORDMINCHAR=8
- AGENT_SEARXNG_API_URL=http://searxng:8080
# Add any other keys here for services or settings
# you can find in the docker/.env.example file
depends_on:
ollama:
condition: service_healthy
chroma:
condition: service_healthy
volumes:
valkey-data:
chroma-data:
ollama-data:
anythingllm-data:
# This configuration file updates the default configuration file
# See https://github.com/searxng/searxng/blob/master/searx/limiter.toml
[botdetection.ip_limit]
# activate link_token method in the ip_limit method
link_token = true
# 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.yml
secret_key: "ultrasecretkey" # change this!
limiter: true # can be disabled for a private instance
image_proxy: true
ui:
static_use_hash: true
redis:
url: redis://redis:6379/0
search:
autocomplete: 'google'
formats:
- html
- json
engines:
- name: wolframalpha
disabled: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment