mudler/LocalAI · error

[moss-tts-cpp] ERROR: codec_path is required\n

Error message

[moss-tts-cpp] ERROR: codec_path is required\n

What it means

mtl_load() rejects the call because codec_path is NULL or empty (return 2), after local_path already passed validation. Moss TTS requires a companion codec model in addition to the main model; this check enforces that the codec file path is supplied before moss_local_load is attempted.

Source

Thrown at backend/go/moss-tts-cpp/cpp/mossttscpp.cpp:39

    case GGML_LOG_LEVEL_WARN:  lvl = "WARN";  break;
    case GGML_LOG_LEVEL_ERROR: lvl = "ERROR"; break;
    default: break;
    }
    fprintf(stderr, "[%-5s] %s", lvl, log);
    fflush(stderr);
}

int mtl_load(const char *local_path, const char *codec_path,
             const char *tokenizer_path) {
    ggml_log_set(ggml_log_cb, nullptr);
    ggml_backend_load_all();

    if (!local_path || local_path[0] == '\0') {
        fprintf(stderr, "[moss-tts-cpp] ERROR: local_path is required\n");
        return 1;
    }
    if (!codec_path || codec_path[0] == '\0') {
        fprintf(stderr, "[moss-tts-cpp] ERROR: codec_path is required\n");
        return 2;
    }
    if (!tokenizer_path || tokenizer_path[0] == '\0') {
        fprintf(stderr, "[moss-tts-cpp] ERROR: tokenizer_path is required\n");
        return 3;
    }

    fprintf(stderr,
            "[moss-tts-cpp] Loading local=%s codec=%s tokenizer=%s\n",
            local_path, codec_path, tokenizer_path);

    g_local = moss_local_load(local_path, codec_path, tokenizer_path);
    if (!g_local) {
        fprintf(stderr, "[moss-tts-cpp] FATAL: moss_local_load failed\n");
        return 4;
    }
    fprintf(stderr, "[moss-tts-cpp] Model loaded (%s)\n", moss_tts_version());
    return 0;

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Download and configure the codec companion file, pass it as codec_path.
  2. Validate all three paths on the Go side before calling mtl_load.

Example fix

// before
rc := C.mtl_load(m, C.CString(""), t);
// after
rc := C.mtl_load(m, C.CString(cfg.CodecPath), t);
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(codecPath) == "" {
    return errors.New("moss-tts-cpp: codec_path is required")
}

Prevention

When it happens

Trigger: Calling mtl_load(model, "", tokenizer) — codec companion file not configured. The codec is a separate artifact from the main model, so a config that only lists the model triggers this.

Common situations: Backend config omits the codec companion entry (separate download from the main model); gallery entry only installs the main weights.

Related errors


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/2b59d43fb4b1ba68. Report an issue: GitHub.