You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.8 KiB

11 months ago
  1. # Common Issues with Ollama
  2. If you encounter an error stating `llama:streaming - could not stream chat. Error: connect ECONNREFUSED 172.17.0.1:11434` when using AnythingLLM in a Docker container, this indicates that the IP of the Host inside of the virtual docker network does not bind to port 11434 of the host system by default, due to Ollama's restriction to localhost and 127.0.0.1. To resolve this issue and ensure proper communication between the Dockerized AnythingLLM and the Ollama service, you must configure Ollama to bind to 0.0.0.0 or a specific IP address.
  3. ### Setting Environment Variables on Mac
  4. If Ollama is run as a macOS application, environment variables should be set using `launchctl`:
  5. 1. For each environment variable, call `launchctl setenv`.
  6. ```bash
  7. launchctl setenv OLLAMA_HOST "0.0.0.0"
  8. ```
  9. 2. Restart the Ollama application.
  10. ### Setting Environment Variables on Linux
  11. If Ollama is run as a systemd service, environment variables should be set using `systemctl`:
  12. 1. Edit the systemd service by calling `systemctl edit ollama.service`. This will open an editor.
  13. 2. For each environment variable, add a line `Environment` under the section `[Service]`:
  14. ```ini
  15. [Service]
  16. Environment="OLLAMA_HOST=0.0.0.0"
  17. ```
  18. 3. Save and exit.
  19. 4. Reload `systemd` and restart Ollama:
  20. ```bash
  21. systemctl daemon-reload
  22. systemctl restart ollama
  23. ```
  24. ### Setting Environment Variables on Windows
  25. On Windows, Ollama inherits your user and system environment variables.
  26. 1. First, quit Ollama by clicking on it in the taskbar.
  27. 2. Edit system environment variables from the Control Panel.
  28. 3. Edit or create new variable(s) for your user account for `OLLAMA_HOST`, `OLLAMA_MODELS`, etc.
  29. 4. Click OK/Apply to save.
  30. 5. Run `ollama` from a new terminal window.