Skip to content

Add remote/external llama.cpp server (URL) option to translate (#11584)#11599

Open
muaz978 wants to merge 1 commit into
SubtitleEdit:mainfrom
muaz978:feature/llamacpp-remote-server
Open

Add remote/external llama.cpp server (URL) option to translate (#11584)#11599
muaz978 wants to merge 1 commit into
SubtitleEdit:mainfrom
muaz978:feature/llamacpp-remote-server

Conversation

@muaz978

@muaz978 muaz978 commented Jun 14, 2026

Copy link
Copy Markdown

Implements #11584 - lets the llama.cpp translate engine connect to an external/remote server via URL (e.g. a GPU box), instead of only managing a local instance.

Background

LlamaCppTranslate and LmStudioTranslate are functionally identical - both POST to an OpenAI-compatible /v1/chat/completions endpoint read from a settings URL. The translate core for llama.cpp already targets a configurable LlamaCppApiUrl; the engine just never exposed it, instead downloading a model and managing a local server pointed at localhost.

Change

Adds a "Use external server (URL)" checkbox to the llama.cpp engine in Auto-translate:

  • off (default) - unchanged: local model download + SE-managed server.
  • on - shows an editable API URL field; translation posts directly to that endpoint and skips the local download / EnsureServerRunningAsync path.

New setting AutoTranslate.LlamaCppUseRemoteServer (default false, so existing behaviour is untouched). The toggle swaps the panel live (a small guard prevents the programmatic re-setup from recursing). Mirrors how the Ollama/LM Studio engines present a URL field.

Notes

  • Builds clean (0 warnings / 0 errors).
  • Until this is merged, users can already do this today by selecting the LM Studio (local LLM) engine and pointing its URL at the remote llama.cpp server - same endpoint shape. This PR just makes it discoverable under llama.cpp.
  • I don't have a Windows/macOS GUI here, so I also produced portable Windows and macOS test builds from this branch to verify the toggle and a real remote translation. Happy to adjust naming/placement.

…tleEdit#11584)

The llama.cpp translate engine only managed a local server (download a model,
start a local process, point the URL at localhost), so it couldn't use an
existing GPU-accelerated llama.cpp server. The translate core already POSTs to
a configurable OpenAI-compatible endpoint (LlamaCppApiUrl) - same shape as the
LM Studio engine - so only the UI needed to expose it.

Add a "Use external server (URL)" checkbox to the llama.cpp engine:
- off (default): unchanged - local model download + managed server.
- on: shows an editable API URL field; translation posts directly to that
  endpoint and skips local server management.

New setting AutoTranslate.LlamaCppUseRemoteServer (default false). The toggle
swaps the panel live; a guard prevents the programmatic re-setup from recursing.
@niksedk

niksedk commented Jun 14, 2026

Copy link
Copy Markdown
Member

PRs with new language tags will have to wait for SE 5.0.1

@muaz978

muaz978 commented Jun 14, 2026

Copy link
Copy Markdown
Author

It is completely up to you and how you see things best fit for the sake of development of the SE, please tell me if there is anything I can do more when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants