mudler/LocalAI · error

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

Error message

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

What it means

mtl_load() rejects the call because tokenizer_path is NULL or empty (return 3), after local_path and codec_path passed. Moss TTS needs a tokenizer file as its third mandatory artifact; without it the load is refused before moss_local_load runs.

Source

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

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

float *mtl_tts(const char *text, const char *reference_wav, int seed,
               int *out_n, int *out_sr) {

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Provide the tokenizer file path as the third argument.
  2. Add a Go-side pre-check that all three paths are non-empty and the files exist.

Example fix

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

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: Calling mtl_load(model, codec, "") — tokenizer file missing from the call. Any config that supplies only model and codec hits this.

Common situations: Tokenizer artifact not included in the gallery entry; user-supplied config forgets the third path.

Related errors


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