#6158 [localllm] Unable to connect to http://localhost:11434/v1. This may be because the API is currently inaccessible on the

105.154* Posted at: 4 hours ago

[localllm] Unable to connect to http://localhost:11434/v1. This may be because the API is currently inaccessible on the network. If it's a local service, please ensure it's deployed and running.
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\_e
......
openai\_base_client.py", line 1055, in request
openai.APITimeoutError: Request timed out.

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

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 67, in run
File "videotrans\task\trans_create.py", line 608, in trans
File "videotrans\translator\__init__.py", line 860, in run
File "videotrans\translator\_base.py", line 68, in run
File "videotrans\translator\_base.py", line 142, in _run_srt
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 71, in _item_task
videotrans.configure.excepts.StopTask: [localllm] Unable to connect to http://localhost:11434/v1. This may be because the API is currently inaccessible on the network. If it's a local service, please ensure it's deployed and running.
Request timed out.

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: C:/Users/CYBORG/Videos/4K Video Downloader+/Use Claude to find winning dropshipping products with ONE skill.mp4,
输出结果保存到文件夹: C:/Users/CYBORG/Videos/4K Video Downloader+/Use Claude to find winning dropshipping products with ONE skill-mp4,
临时文件夹: C:/Users/CYBORG/Downloads/tmp/24304/e8350b6837
已选 清理已存在
已选 启用CUDA加速
未选 降噪
ASR Channel:faster-whisper(LocalBuilt-in), model_name: large-v3, 发音语言: English, 断句方式:默认断句
Trans Channel:Local/Compatible AI,原始语言:English,目标语言:Arabic, 已选 Send SRT
Dubb Channel:Edge-TTS(Free), 角色:Hamed(Male/SA), 配音语言:Arabic, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: No Subs
代理地址:


=
system:Windows-10-10.0.26200-SP0
version:v4.03
frozen:True
language:en
root_dir:C:/Users/CYBORG/Downloads

1 Replies

The error occurs because the local AI translation service at http://localhost:11434/v1 (likely Ollama) is not running or unreachable, causing a request timeout.

Solution:

  1. Ensure Ollama is installed and running.

    • Download and install Ollama from ollama.com.
    • Start the Ollama service (it usually runs as a background service).
    • Verify it's accessible by opening http://localhost:11434 in your browser. You should see a JSON response like {"message":"Ollama is running"}.
  2. Pull the required model (if not already downloaded).

    • In a terminal, run ollama pull <model-name> (e.g., ollama pull qwen2.5:7b).
    • The model you specify in pyVideoTrans must match a pulled model name.
  3. Check the model name in pyVideoTrans settings.

    • Go to Menu → Translation Settings → Local/Compatible AI.
    • Ensure the "Model" field contains an exact model name that exists in Ollama (e.g., qwen2.5:7b).
  4. Increase the timeout if the model is slow.

    • In Menu → Tools/Options → Advanced Options → Caption Translation Settings, increase AI translation channel batch rows and increase Post-translation pause seconds if needed.
    • Alternatively, reduce the batch size to avoid long processing.
  5. If you don't need a local model, switch to a cloud-based translation channel (e.g., Google, Microsoft, DeepSeek) which do not require a local service.

Important:

  • The localllm channel requires an OpenAI-compatible API. Ollama provides this at http://localhost:11434/v1.
  • The service must be running before you start a translation task in pyVideoTrans.

See Relevant Documentation:

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource