SubtitleEdit/subtitleedit · error · InvalidOperationException
llama-server not found. Either: download llama.cpp in Subtit
Error message
llama-server not found. Either: download llama.cpp in Subtitle Edit ({guiDownloadHint}), install it on PATH (e.g. `brew install llama.cpp` or `winget install ggml.llamacpp`), or point {urlOption} at an already-running llama-server. What it means
Thrown by LlamaCppLocal.EnsureServerBinary when TryEnsureServerBinary returns false — meaning the llama-server executable was not found in any candidate location (portable SE folder next to seconv, the installed SE GUI data folder) nor on the system PATH. This blocks local LLM-based translation and OCR features that require a running llama-server. The message includes install instructions and the CLI option name to point at an external server.
Source
Thrown at src/seconv/Core/LlamaCppLocal.cs:23
/// <summary>
/// Locates a local llama-server binary for the llama.cpp translate/OCR engines without
/// downloading anything: the Subtitle Edit data folders are probed first (so an install done
/// via the SE GUI is picked up automatically), then the system PATH.
/// </summary>
internal static class LlamaCppLocal
{
/// <summary>
/// Resolves llama-server and points <see cref="LlamaCppServerManager"/> at it (folder or
/// executable override). Throws with download instructions when nothing is found;
/// <paramref name="guiDownloadHint"/> names the SE window that installs llama.cpp
/// (e.g. "Auto-translate > llama.cpp") and <paramref name="urlOption"/> the CLI option
/// that skips the local auto-start (e.g. "--translate-url").
/// </summary>
public static void EnsureServerBinary(string guiDownloadHint, string urlOption)
{
if (!TryEnsureServerBinary())
{
throw new InvalidOperationException(
$"llama-server not found. Either: download llama.cpp in Subtitle Edit ({guiDownloadHint}), " +
"install it on PATH (e.g. `brew install llama.cpp` or `winget install ggml.llamacpp`), " +
$"or point {urlOption} at an already-running llama-server.");
}
}
/// <summary>Same as <see cref="EnsureServerBinary"/> but returns false instead of throwing.</summary>
public static bool TryEnsureServerBinary()
{
// Folder candidates in priority order: portable SE (seconv sits next to SubtitleEdit,
// data folder = exe folder), then the installed GUI's data folder.
var candidates = new[]
{
Path.Combine(AppContext.BaseDirectory, "llama.cpp"),
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Subtitle Edit", "llama.cpp"),
};
var exeName = OperatingSystem.IsWindows() ? "llama-server.exe" : "llama-server";View on GitHub (pinned to 17a9f07487)
Solutions
- Install llama.cpp: `brew install llama.cpp` (macOS), `winget install ggml.llamacpp` (Windows), or build from source (Linux).
- Download llama.cpp from within the Subtitle Edit GUI (the window named by guiDownloadHint, e.g. 'Auto-translate > llama.cpp').
- Point seconv at an already-running server via the URL option (e.g. --translate-url=http://localhost:8080) to skip local binary resolution entirely.
- If already installed, verify the binary is on PATH (`which llama-server`) or placed in the SE data folder.
Defensive patterns
Strategy: validation
Validate before calling
if (!LlamaCppLocal.TryEnsureServerBinary())
{
Console.Error.WriteLine("llama-server not found. Install llama.cpp or pass --translate-url.");
return;
} Type guard
static bool HasLlamaServer() => LlamaCppLocal.TryEnsureServerBinary();
Try / catch
try { LlamaCppLocal.EnsureServerBinary("Auto-translate > llama.cpp", "--translate-url"); }
catch (InvalidOperationException ex) when (ex.Message.Contains("llama-server not found"))
{ /* install llama.cpp or point at an external server URL */ } Prevention
- Call TryEnsureServerBinary (the non-throwing variant) to check availability before committing to an LLM pipeline.
- For headless/CI environments, pre-install llama.cpp on PATH or use --translate-url to point at an external server.
- Document the llama.cpp dependency and install steps in your project setup.
When it happens
Trigger: Calling EnsureServerBinary when llama.cpp/llama-server has never been installed. The search checks: the portable SE data folder (seconv's exe directory), the SE GUI install data folder, and the system PATH. If none contains the binary, TryEnsureServerBinary returns false and this throws.
Common situations: First-time use of --translate or OCR features without having downloaded llama.cpp; a fresh machine or CI environment with no llama.cpp installed; llama.cpp was installed but the binary is not on PATH and not in the SE data folder; the binary name differs from the expected pattern.
Related errors
- No vision projector found next to {fullPath}. llama.cpp OCR
- llama-server executable not found - please download llama.cp
- llama.cpp returned {(int)resp.StatusCode}: {json}
- OCR model file not found: {name}
- OCR model '{name}' not found in {LlamaCppServerManager.GetAn
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/6d0e1dae44d830a2.
Report an issue: GitHub.