mudler/LocalAI · critical

[moss-tts-cpp] FATAL: moss_local_load failed\n

Error message

[moss-tts-cpp] FATAL: moss_local_load failed\n

What it means

mtl_load() passed argument validation but moss_local_load() returned NULL (return 4). This is the real engine-level failure: the runtime could not load the main model + codec + tokenizer trio. The engine's own logging (routed through ggml_log_cb) appears above this line and carries the precise cause.

Source

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

        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;
}

float *mtl_tts(const char *text, const char *reference_wav, int seed,
               int *out_n, int *out_sr) {
    if (out_n)
        *out_n = 0;
    if (out_sr)
        *out_sr = 0;
    if (!g_local) {
        fprintf(stderr, "[moss-tts-cpp] ERROR: model not loaded\n");
        return nullptr;
    }
    if (!text || text[0] == '\0') {
        fprintf(stderr, "[moss-tts-cpp] ERROR: text is required\n");

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Read the engine log lines above the FATAL — moss_local_load logs the exact failing artifact or allocation.
  2. Verify all three files exist with expected sizes and come from the same release.
  3. Free other loaded backends or add RAM/swap if OOM.
  4. Re-download the model set from the gallery to rule out corruption.
Defensive patterns

Strategy: validation

Validate before calling

for _, p := range []string{modelPath, codecPath, tokenizerPath} {
    if fi, err := os.Stat(p); err != nil || fi.Size() == 0 {
        return fmt.Errorf("moss artifact invalid: %s", p)
    }
}

Prevention

When it happens

Trigger: Any of the three supplied paths pointing to missing, truncated, or incompatible files; version mismatch between main model and codec/tokenizer artifacts; ggml backend allocation failure (OOM) during weight loading.

Common situations: Mixing artifacts from different Moss TTS releases; interrupted downloads; loading on a host with insufficient RAM for the full model; missing CPU feature (AVX etc.) causing backend init failure inside the engine.

Related errors


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