services:
  llm:
    build: .
    container_name: 15_llm-denai-llm
    user: 0:0
    command: >
      -m /models/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf --ctx-size 4096 --parallel 1 --batch-size 512 --ubatch-size 256 --threads 6 --mmap --host 0.0.0.0 --port 8080
    volumes:
      - /home/docker/DenAI/llm/models:/models:ro
    read_only: true
    tmpfs:
      - /tmp
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    restart: unless-stopped
    networks:
      tan-network:
        ipv4_address: 10.10.0.150
  qdrant:
    image: qdrant/qdrant
    container_name: 15_llm-denai-qdrant
    volumes:
      - /home/docker/DenAI/qdrant/storage:/qdrant/storage
    ports:
      - 6333:6333
    networks:
      tan-network:
        ipv4_address: 10.10.0.151
    restart: unless-stopped
  searxng:
    image: searxng/searxng
    container_name: denai-searxng
    environment:
      - BASE_URL=http://denai-searxng:8080/
      - INSTANCE_NAME=DenAI
    volumes:
      - /home/docker/DenAI/searxng:/etc/searxng
    networks:
      tan-network:
        ipv4_address: 10.10.0.152
    restart: unless-stopped
  webui:
    image: ghcr.io/open-webui/open-webui:v0.6.34
    container_name: 15_llm-denai-webui
    environment:
      - OPENAI_API_BASE_URL=http://denai-llm:8080/v1
      - OPENAI_API_KEY=sk-denai-local
      - VECTOR_DB=qdrant
      - QDRANT_URI=http://denai-qdrant:6333
      - ENABLE_OLLAMA=false
    volumes:
      - /home/docker/DenAI/webui/data:/app/backend/data
      - /home/docker/DenAI/conversations:/app/backend/conversations
    ports:
      - 8097:8080
    networks:
      tan-network:
        ipv4_address: 10.10.0.153
    restart: unless-stopped
networks:
  tan-network:
    external: true
