#4353 TaskCfgSTS(is_cuda=False, uuid='220dccb85b', cache_folder=None, target_dir='E:/PH/krenz comp 16/cn LLM', source_language

202.150* Posted at: 1 hour ago 👁6

Trans Error [Local/Compatible AI] Network connection failed
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\connection.py", line 101, in handle_request
File "httpcore\_sync\http11.py", line 143, in handle_request
File "httpcore\_sync\http11.py", line 113, in handle_request
File "httpcore\_sync\http11.py", line 186, in _receive_response_headers
File "httpcore\_sync\http11.py", line 238, in _receive_event
httpcore.RemoteProtocolError: Server disconnected without sending a response.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "openai\_base_client.py", line 1005, in request
File "httpx\_client.py", line 914, in send
File "httpx\_client.py", line 942, in _send_handling_auth
File "httpx\_client.py", line 979, in _send_handling_redirects
File "httpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.RemoteProtocolError: Server disconnected without sending a response.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\task\job.py", line 174, in run
File "videotrans\task\_translate_srt.py", line 45, in trans
File "videotrans\translator\__init__.py", line 970, in run
File "videotrans\translator\_base.py", line 105, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_localllm.py", line 55, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1192, in create
File "openai\_base_client.py", line 1297, in post
File "openai\_base_client.py", line 1037, in request
openai.APIConnectionError: Connection error.
TaskCfgSTS(is_cuda=False, uuid='220dccb85b', cache_folder=None, target_dir='E:/PH/krenz comp 16/cn LLM', source_language=None, source_language_code='Simplified Chinese', source_sub='E:/PH/krenz comp 16/cn LLM/250611.srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='English', target_sub='E:/PH/krenz comp 16/cn LLM/250611.English.srt', target_wav=None, target_wav_output=None, name='E:/PH/krenz comp 16/cn LLM/250611.srt', noextname='250611', basename='250611.srt', ext='srt', dirname='E:/PH/krenz comp 16/cn LLM', shound_del_name=None, translate_type=8)


=
system:Windows-10-10.0.26200-SP0
version:v3.97
frozen:True
language:en
root_dir:E:/ytrans

1 Replies

This error occurs because the local AI translation service (e.g., Ollama) disconnected unexpectedly while processing the request. The server closed the connection without sending a response.

Solutions (try in order):

  1. Verify the local LLM service is running

    • If you are using Ollama, open a terminal and check with ollama list. If it's not running, start it.
    • For other local APIs, ensure the web service (e.g., http://127.0.0.1:11434) is active.
  2. Check the API address and model name

    • In pyVideoTrans, go to Menu → Translation Settings → Local Large Model Settings.
    • Confirm the API URL (default for Ollama: http://localhost:11434/v1).
    • Make sure the Model field matches exactly the model you have pulled (e.g., qwen2:7b, deepseek-r1:7b). Do not add extra spaces or suffixes.
  3. Reduce workload on the local server

    • Large models may time out when processing many lines simultaneously.
    • Go to Menu → Tools/Options → Advanced Options and adjust:

      • AI翻译渠道每批字幕行数 → lower to 5–10
      • 翻译后暂停秒 → increase to 5–10 seconds
    • This prevents flooding the server and gives it time to handle each batch.
  4. Update pyVideoTrans to the latest version

    • You are using v3.97. The current version is v3.99, which may include fixes for connection handling.
    • Download the latest full package from here and overwrite your installation.
  5. Network and firewall

    • If the local server runs on a different machine, ensure the firewall allows the port.
    • For a local service, using 127.0.0.1 avoids firewall issues.

Please refer to the following document for detailed setup:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource