#8373 [localllm] Cannot connect to http://localhost:11434/v1. Check network access or verify local server deployment.Request t

94.139**8 Posted at: 2 hours ago

[localllm] Cannot connect to http://localhost:11434/v1. Check network access or verify local server deployment.
Request timed out.
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.ReadTimeout: timed out

The a
......
ns
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 97, in _item_task
videotrans.configure.excepts.StopTask: [localllm] Cannot connect to http://localhost:11434/v1. Check network access or verify local server deployment.
Request timed out.

trk=[TransCreate]: uuid='77333a0eef', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/kimnh/OneDrive/Máy tính/youtobe/Traffickers Turn a Child Into a ‘Wolf Boy’ With Asphalt yt.mp4,
输出结果保存到文件夹: C:/Users/kimnh/OneDrive/Máy tính/youtobe/_video_out/Traffickers Turn a Child Into a ‘Wolf Boy’ With Asphalt yt-mp4,
临时文件夹: C:/Users/kimnh/Downloads/win-pyvideotrans-v4.16/tmp/13224/77333a0eef
已选 清理已存在
未启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), small, 发音语言: Simplified Chinese,
TranslateSrt:Local LLM (OpenAI-compatible),原始语言:Simplified Chinese,目标语言:English, 未选 SendSRT
TTS Service:Edge-TTS (Free), 角色:Brian(Male/US), 配音语言:English, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 已选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: No Subtitles , 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='', should_recogn2=False, do_diarize=True
video_duration_ms=912040


=
system:Windows-10-10.0.26200-SP0
version:v4.16
frozen:True
language:en_US
root_dir:C:/Users/kimnh/Downloads/win-pyvideotrans-v4.16

1 Replies

#1 DeepSeek reply at 2 hours ago

Local LLM (OpenAI-compatible) channel 是外部的 Ollama/openai 兼容服务,超时是因为软件连上了 http://localhost:11434/v1,但该服务未启动,或模型加载/推理太慢,未在客户端超时时间内返回。这属于本地服务端的问题,不是软件本身的问题。

排查与解决步骤:

  1. 确认 Ollama 服务在运行

    • 在 CMD 执行 ollama list,能列出模型即服务正常。
    • 或执行 curl http://127.0.0.1:11434/v1/models,能返回 JSON 即接口可达。
  2. 确认模型名称完全一致

    • 打开 菜单 -> 翻译设置 -> 本地大模型/兼容AI,检查填写的模型名是否与 ollama list 中显示的名称一字不差(如 qwen2.5:7b,缺少 tag 会导致长时间等待后超时)。
  3. 预热模型,排除首次加载超时

    • 先在 CMD 执行 ollama run <模型名>,让它完成首次加载并生成一句话,确认能正常响应后再回软件重试。大模型冷启动常需数十秒至数分钟,必然超过客户端超时阈值。
    • 可选:设置环境变量 OLLAMA_KEEP_ALIVE=-1,让模型常驻显存,避免每批字幕都重新加载。
  4. 地址与端口规范

    • 地址中的 0.0.0.0 必须改为 127.0.0.1。
    • 若 Ollama 运行在另一台机器或 Docker 内,localhost 不会指向它,需填写实际 IP。
    • 清空主界面右侧的网络代理文本框(本地服务不应走代理),填写无效代理也会导致请求失败。
  5. 降低单次请求负担(避免长时间推理触发超时)

    • 菜单 -> 工具 -> 高级选项 -> 字幕翻译:将 AI翻译渠道每批字幕行数(Batch size (lines) for AI translation) 改为 10 或更小。
    • 保持翻译并发数为 1,避免多路请求同时压满显存。
  6. 硬件/模型匹配

    • 未启用 CUDA 且本地模型较大时,纯 CPU 推理一行字幕就可能超过超时阈值。改用更小的模型(如 3B/7B 量化版)或启用 GPU 加速。
    • 检查任务管理器显存/内存是否已占满,占满会导致推理停滞并最终超时。
  7. 翻译质量附带问题

    • 本地小模型指令跟随能力弱,若后续出现输出提示词、 标签或空行,需精简 软件目录/videotrans/prompts/srt/localllm.txt(选中 SendSRT 时使用)和 text/localllm.txt,注意保留 {} 包裹的变量。

若完成以上配置后仍报超时,请提供 ollama list 的输出、所用模型名称,以及 logs/ 目录下最新日志底部约 30 行内容。

请查阅相关文档:

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