#8858 Error during subtitle translation stage [Local LLM (OpenAI-compatible)] [localllm] Cannot connect to http://127.0.0.1:80

188.192**8 Posted at: 2 hours ago

Error during subtitle translation stage [Local LLM (OpenAI-compatible)] [localllm] Cannot connect to http://127.0.0.1:8081/v1. Check network access or verify local server deployment.
Connection error.
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 224, in _receive_event

File "httpcore\_backends\sync.py", line 124, in read

File "contextlib.py", line 153, in exit

File "httpcore\_exceptions.py", line 14, in map_exceptions

httpcore.ReadError: [WinError 10054] Eine vorhandene Verbindung wurde vom Remotehost geschlossen

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

Traceback (most recent call last):

File "openai\_base_client.py", line 1037, in request

File "openai\_client.py", line 440, in _send_request

File "openai\_client.py", line 418, in _send_with_auth_retry

File "openai\_base_client.py", line 964, in _send_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.ReadError: [WinError 10054] Eine vorhandene Verbindung wurde vom Remotehost geschlossen

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

Traceback (most recent call last):

File "videotrans\translator\_openaicompat.py", line 89, in _item_task

File "videotrans\translator\_openaicompat.py", line 41, in _create_completion

File "openai\_utils\_utils.py", line 298, in wrapper

File "openai\resources\chat\completions\completions.py", line 1215, in create

File "openai\_base_client.py", line 1332, in post

File "openai\_base_client.py", line 1072, in request

openai.APIConnectionError: Connection error.

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

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 136, in process_task

File "videotrans\task\_stage_translate.py", line 31, in trans

File "videotrans\translator\_runner.py", line 71, in run

File "videotrans\translator\_base.py", line 79, in run

File "videotrans\translator\_base.py", line 117, in _run_text

File "tenacity\__init__.py", line 338, in wrapped_f

File "tenacity\__init__.py", line 477, in call

File "tenacity\__init__.py", line 378, in iter

File "tenacity\__init__.py", line 400, in

File "concurrent\futures\_base.py", line 451, in result

File "concurrent\futures\_base.py", line 403, in __get_result

File "tenacity\__init__.py", line 480, in call

File "videotrans\translator\_openaicompat.py", line 96, in _item_task

videotrans.configure.excepts.StopTask: [localllm] Cannot connect to http://127.0.0.1:8081/v1. Check network access or verify local server deployment.
Connection error.
trk=[TransCreate]: uuid='6515c77442', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式 每批1个
原始输入文件名: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/Episode 36_ Critical Thinker Chris Shelton Part 2.mp4,
输出结果保存到文件夹: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/Episode 36_ Critical Thinker Chris Shelton Part 2-mp4,
临时文件夹: C:/vTrans/tmp/16476/6515c77442
未选 清理已存在
已启用CUDA加速
已选 降噪, 降噪模型:dpdfnet2.onnx
已选 识别说话人,最大说话人数量不限制
STT Service:openai-whisper(Built-in), large-v3-turbo, 发音语言: English, , 数据类型:float16
TranslateSrt:Local LLM (OpenAI-compatible),原始语言:English,目标语言:German, 未选 SendSRT, settings.get('trans_thread')=1, settings.get('aitrans_thread')=1
TTS Service:F5-TTS(Built-in), 角色:clone, 配音语言:German
音量:-1%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: Hard Subtitles
已选 分离人声与背景声, 分离模型为:UVR-MDX-NET-Inst_1, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件, precent=12, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='C:/vTrans/tmp/16476/6515c77442/vocal.wav', should_recogn2=False, do_diarize=False


=
system:Windows-10-10.0.26300-SP0
version:v4.17
frozen:True
language:en_US
root_dir:C:/vTrans

1 Replies

#1 DeepSeek reply at 2 hours ago

The TCP connection to 127.0.0.1:8081 was actually established: WinError 10054 (remote host closed the connection) means the local inference server accepted the request and then terminated it. This is not a firewall, proxy or port problem — the local OpenAI-compatible service is closing the connection itself (model not loaded, crash/VRAM overflow, wrong endpoint path, or mismatched model name).

Troubleshooting steps:

  1. Verify the endpoint by hand. In a terminal:
    curl http://127.0.0.1:8081/v1/models
    If this fails or returns nothing, the server is not serving OpenAI-compatible routes at /v1. In pyVideoTrans the address must end with /v1 and the server must implement /v1/chat/completions (LM Studio, llama.cpp server, vLLM, one-api, etc.). A WebUI port (Gradio/Streamlit) will close the connection.
  2. Watch the server console while starting the translation. If it prints OOM / CUDA error / model load failure, the request is too large or the model does not fit in VRAM. Fix by using a smaller model or a lower quantization, and by lowering Advanced Options – Subtitle Translation – AI Translation Batch Size (Lines) to 10 or even 1.
  3. Confirm the model name matches exactly the id returned by /v1/models (the model name field is case-sensitive). An unknown model name makes several local servers drop the connection instead of returning an error.
  4. Set Advanced Options – Subtitle Translation – AI Translation Batch Size (Lines) = 10~20 and concurrency to 1, then retry. Very long context requests against a small local server often cause exactly this 10054.
  5. Find the local LLM prompt in software directory/videotrans/prompts/srt/localllm.txt (SendSRT checked) or .../prompts/text/localllm.txt (unchecked). Do not delete {lang} / {batch_input} placeholders. If the model is a 7B-class model, trim the prompt, since small local models often fail to follow it.
  6. Check the software log logs/.log for the full request/response around the failure, and confirm the model does not require a different path such as /v1/chat/completions versus /api/chat.
  7. Unrelated but recommended: the input file C:/Private Filez/.../Episode 36_ Critical Thinker Chris Shelton Part 2.mp4 contains spaces and a non-ASCII character (Ü). Rename it to a short alphanumeric name in a shallow directory (e.g. D:/videos/ep36.mp4) before retrying, to avoid later FFmpeg-stage failures.

If the above still fails, provide the last 30 lines of logs/.log plus the server console output at the moment of failure.

Please refer to the related documentation:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource