rashadphz / farfalle

🔍 AI search engine - self-host with local or cloud LLMs
https://www.farfalle.dev/
Apache License 2.0
2.21k stars 166 forks source link

UI can only be used on local machine. #51

Closed airdogvan closed 2 weeks ago

airdogvan commented 2 weeks ago

Installed with docker-compose. Runs very well on local machine (using local AI).

If I try to access from other machine on the LAN, I get the UI, everything looks normal. But when I ask a question, the question simply gets posted in the page instead of generating answer.

In the docker-compose the address of Ollama is : http://192.168.5.53:11434, which, again, works very well if I access from the browser at local machine with http://192.168.5.53:3000 and, in the UI, choosing "local".

But from other machine if I access http://192.168.5.53:3000, I get the behavior described above. i.e.: when I ask a question, the question simply gets posted in the page but no answer is generated.

My docker-compose

services:
  backend:
    build:
      context: .
      dockerfile: ./src/backend/Dockerfile
    restart: always
    ports:
      - "8000:8000"
    environment:
      - OLLAMA_HOST=${OLLAMA_HOST:-http://192.168.5.73:11434}
#      - TAVILY_API_KEY=${TAVILY_API_KEY}
#      - BING_API_KEY=${BING_API_KEY}
#      - SERPER_API_KEY=${SERPER_API_KEY}
#      - OPENAI_API_KEY=${OPENAI_API_KEY}
#      - GROQ_API_KEY=${GROQ_API_KEY}
      - ENABLE_LOCAL_MODELS=${ENABLE_LOCAL_MODELS:-True}
      - SEARCH_PROVIDER=${SEARCH_PROVIDER:-tavily}
      - SEARXNG_BASE_URL=${SEARXNG_BASE_URL:-http://host.docker.internal:8080}
#      - REDIS_URL=${REDIS_URL}
    develop:
      watch:
        - action: sync
          path: ./src/backend
          target: /workspace/src/backend
    extra_hosts:
      - "host.docker.internal:host-gateway"
  frontend:
    depends_on:
      - backend
    build:
      context: .
      dockerfile: ./src/frontend/Dockerfile
    restart: always
    environment:
      - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000}
      - NEXT_PUBLIC_LOCAL_MODE_ENABLED=${NEXT_PUBLIC_LOCAL_MODE_ENABLED:-true}
    ports:
      - "3000:3000"
    develop:
      watch:
        - action: sync
          path: ./src/frontend
          target: /app
          ignore:
            - node_modules/

  searxng:
    container_name: searxng
    image: docker.io/searxng/searxng:latest
    restart: unless-stopped
    networks:
      - searxng
    ports:
      - "8080:8080"
    volumes:
      - ./searxng:/etc/searxng:rw
    environment:
      - SEARXNG_BASE_URL=https://${SEARXNG_BASE_URL:-localhost}/

networks:
  searxng:
arsaboo commented 2 weeks ago

Change http://localhost:8000 to the private IP of the machine you are running.

airdogvan commented 2 weeks ago

Great!  That works fine for me.  Many thanks!!!

On 2024-06-14 15:01, Alok Saboo 'notifications at github.com' wrote:

This email was sent to @. from @. Click here https://app.addy.io/deactivate/022cc3db-6fd8-4177-8ee9-e7c2e50b7a0f?signature=c71858ffacf8d3e9be43c2aa0cb6d980030174651ae2fda2b9e769c21abf2a88 to deactivate this alias

Change |http://localhost:8000| to the private IP of the machine you are running.

— Reply to this email directly, view it on GitHub https://github.com/rashadphz/farfalle/issues/51#issuecomment-2168817490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRKLJ327TYLKVEHJVTZSK3ZHNR2TAVCNFSM6AAAAABJK4WWDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRYHAYTONBZGA. You are receiving this because you authored the thread.Message ID: @.***>