mirror of
https://github.com/open-webui/open-webui
synced 2024-11-17 14:02:51 +00:00
Merge pull request #3107 from TheTerrasque/defect/ollama-long-response-timeout
Fix: ollama long response timeout
This commit is contained in:
commit
26505079b8
@ -18,6 +18,10 @@ If you're experiencing connection issues, it’s often due to the WebUI docker c
|
|||||||
docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
|
docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error on Slow Reponses for Ollama
|
||||||
|
|
||||||
|
Open WebUI has a default timeout of 15 minutes for Ollama to finish generating the response. If needed, this can be adjusted via the environment variable AIOHTTP_CLIENT_TIMEOUT, which sets the timeout in seconds.
|
||||||
|
|
||||||
### General Connection Errors
|
### General Connection Errors
|
||||||
|
|
||||||
**Ensure Ollama Version is Up-to-Date**: Always start by checking that you have the latest version of Ollama. Visit [Ollama's official site](https://ollama.com/) for the latest updates.
|
**Ensure Ollama Version is Up-to-Date**: Always start by checking that you have the latest version of Ollama. Visit [Ollama's official site](https://ollama.com/) for the latest updates.
|
||||||
|
@ -46,6 +46,7 @@ from config import (
|
|||||||
SRC_LOG_LEVELS,
|
SRC_LOG_LEVELS,
|
||||||
OLLAMA_BASE_URLS,
|
OLLAMA_BASE_URLS,
|
||||||
ENABLE_OLLAMA_API,
|
ENABLE_OLLAMA_API,
|
||||||
|
AIOHTTP_CLIENT_TIMEOUT,
|
||||||
ENABLE_MODEL_FILTER,
|
ENABLE_MODEL_FILTER,
|
||||||
MODEL_FILTER_LIST,
|
MODEL_FILTER_LIST,
|
||||||
UPLOAD_DIR,
|
UPLOAD_DIR,
|
||||||
@ -154,7 +155,9 @@ async def cleanup_response(
|
|||||||
async def post_streaming_url(url: str, payload: str):
|
async def post_streaming_url(url: str, payload: str):
|
||||||
r = None
|
r = None
|
||||||
try:
|
try:
|
||||||
session = aiohttp.ClientSession(trust_env=True)
|
session = aiohttp.ClientSession(
|
||||||
|
trust_env=True, timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT)
|
||||||
|
)
|
||||||
r = await session.post(url, data=payload)
|
r = await session.post(url, data=payload)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
|
@ -425,6 +425,7 @@ OLLAMA_API_BASE_URL = os.environ.get(
|
|||||||
)
|
)
|
||||||
|
|
||||||
OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "")
|
OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "")
|
||||||
|
AIOHTTP_CLIENT_TIMEOUT = int(os.environ.get("AIOHTTP_CLIENT_TIMEOUT", "900"))
|
||||||
K8S_FLAG = os.environ.get("K8S_FLAG", "")
|
K8S_FLAG = os.environ.get("K8S_FLAG", "")
|
||||||
USE_OLLAMA_DOCKER = os.environ.get("USE_OLLAMA_DOCKER", "false")
|
USE_OLLAMA_DOCKER = os.environ.get("USE_OLLAMA_DOCKER", "false")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user