anything-llm icon indicating copy to clipboard operation
anything-llm copied to clipboard

[FEAT]: Add network proxy settings to route all network requests through the proxy.

Open ilxqx opened this issue 9 months ago • 9 comments

What would you like to see?

As is well known, there are some restrictions on the internet in certain countries, which lead to the inability to directly access some well-known websites such as Github, Google and so on. Accessing these sites requires the use of a proxy. I wonder if this app can add network proxy configuration options to meet this need?

ilxqx avatar Apr 29 '24 16:04 ilxqx

Proxy for which features in particular?

timothycarambat avatar Apr 29 '24 16:04 timothycarambat

Thank you for your reply.

image image And access to the LLM providers server... In short, whenever there is a need to send network requests in the application, there should be an opportunity to proxy them.

ilxqx avatar Apr 30 '24 02:04 ilxqx

+1

I also have the following errors in log when trying to start AnythingLLM behind a proxy:

npm ERR! code ECONNRESET
npm ERR! network Client network socket disconnected before secure TLS connection was established
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! A complete log of this run can be found in: /app/.npm/_logs/2024-05-10T11_50_06_115Z-debug-0.log

Working without a proxy, I'm trying to get it to work by using the same, following docker config:

networks:
  llm-network:
    external: true

services:
  anything-llm:
    container_name: anything-llm
    image: mintplexlabs/anythingllm:latest
    restart: unless-stopped
    #user: "${UID:-1000}:${GID:-1000}"
    cap_add:
      - SYS_ADMIN
    environment:
      - SERVER_PORT
      - STORAGE_DIR
      - GENERATE_SOURCEMAP
      - VITE_API_BASE
      - LLM_PROVIDER
      - OLLAMA_BASE_PATH
      - OLLAMA_MODEL_PREF
      - OLLAMA_MODEL_TOKEN_LIMIT
      - VECTOR_DB
      - CHROMA_ENDPOINT
      - DISABLE_TELEMETRY
      - PASSWORDMINCHAR
      - PASSWORDMAXCHAR
      - PASSWORDLOWERCASE
      - PASSWORDUPPERCASE
      - PASSWORDNUMERIC
      - PASSWORDSYMBOL
      - PASSWORDREQUIREMENTS
      #- NODE_TLS_REJECT_UNAUTHORIZED
      - HTTPS_PROXY
      - HTTP_PROXY
      - https_proxy
      - http_proxy
    volumes:
      - /srv/docker/anything-llm/storage:/app/server/storage
      - /srv/docker/anything-llm/.env:/app/server/.env
      - /srv/certs/LINEG-Fullchain.pem:/etc/ssl/certs/LINEG-Fullchain.pem
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
      - "com.centurylinklabs.watchtower.monitor-only=true"
    networks:
      - llm-network
    #ports:
    #  - 127.0.0.1:1337:${SERVER_PORT-3000}
    extra_hosts:
      - host.docker.internal:host-gateway
    healthcheck:
      test: [ "CMD", "curl", "-f", "http://localhost:3000/api/ping" ]
      interval: 10s
      timeout: 10s
      retries: 10
      start_period: 5s
  chromadb:
    image: chromadb/chroma:latest
    container_name: chromadb
    volumes:
      - /srv/docker/chromadb:/chroma/chroma
    environment:
      - IS_PERSISTENT=TRUE
      - ANONYMIZED_TELEMETRY=False
    restart: unless-stopped
    ports:
      - 8000:${CHROMA_PORT}
    networks:
      - llm-network
    extra_hosts:
      - host.docker.internal:host-gateway
    # healthcheck not working for chromadb...
    #healthcheck:
    #  # Adjust below to match your container port
    #  test: [ "CMD", "curl", "-f", "http://localhost:8000/api/v1/heartbeat" ]
    #  interval: 30s
    #  timeout: 10s
    #  retries: 3

I would love to have a setting within AnythingLLM to make npm use the proxy for its traffic towards the internet .. Otherwise, what can we do to properly setup a proxy for AnythingLLM to use successfully?

lineg-it avatar May 10 '24 11:05 lineg-it

+1 and a check whether the agent is working using search or scrape webpage. mine doesn't work, thinking maybe network problem

chapterv avatar May 21 '24 18:05 chapterv

@chapterv That is unrelated to this issue. Also the agent says what tool it is calling so it is not a mystery. it will explicitly say if it is using web-scraping or web-browsing

timothycarambat avatar May 21 '24 19:05 timothycarambat

+1 can't test AnythingLLM in an environment that has outbound network proxy I need to configure in the app.

jorgeorchilles avatar Jun 12 '24 15:06 jorgeorchilles

+1 any news about this?

jorgelloret avatar Jul 19 '24 09:07 jorgelloret

+1 any news about this?

zen010101 avatar Sep 14 '24 04:09 zen010101