{"record":{"id":"81c815e5c63e2d58","repo":"mudler/LocalAI","slug":"3","errorCode":"3","errorMessage":"[omnivoice-cpp] FATAL: ov_init failed: %s\\n","messagePattern":"\\[omnivoice-cpp\\] FATAL: ov_init failed: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"backend/go/omnivoice-cpp/cpp/gomnivoicecpp.cpp","lineNumber":53,"sourceCode":"    }\n    if (!codec_path || codec_path[0] == '\\0') {\n        fprintf(stderr, \"[omnivoice-cpp] ERROR: codec_path is required\\n\");\n        return 2;\n    }\n\n    ov_init_params p;\n    ov_init_default_params(&p);\n    p.model_path = model_path;\n    p.codec_path = codec_path;\n    p.use_fa = use_fa != 0;\n    p.clamp_fp16 = clamp_fp16 != 0;\n\n    fprintf(stderr, \"[omnivoice-cpp] Loading model=%s codec=%s\\n\", model_path,\n            codec_path);\n\n    g_ctx = ov_init(&p);\n    if (!g_ctx) {\n        fprintf(stderr, \"[omnivoice-cpp] FATAL: ov_init failed: %s\\n\",\n                ov_last_error());\n        return 3;\n    }\n    fprintf(stderr, \"[omnivoice-cpp] Model loaded (%s)\\n\", ov_version());\n    return 0;\n}\n\n// Fill an ov_tts_params from the flat wrapper arguments.\nstatic void fill_params(ov_tts_params *tp, const char *text, const char *lang,\n                        const char *instruct, const float *ref_samples,\n                        int ref_n, const char *ref_text, long long seed,\n                        int denoise) {\n    ov_tts_default_params(tp);\n    tp->text = text ? text : \"\";\n    tp->lang = lang ? lang : \"\";\n    if (instruct && instruct[0] != '\\0')\n        tp->instruct = instruct;\n    if (ref_samples && ref_n > 0) {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/omnivoice-cpp/cpp/gomnivoicecpp.cpp#L35-L71","documentation":"ov_init() returned NULL after params were filled (model_path, codec_path, use_fa, clamp_fp16). This is the engine-level load failure (return code 3); unlike moss-tts, the OmniVoice engine exposes the reason through ov_last_error(), which the message prints. Causes range from unreadable files to flash-attention (use_fa) or fp16 options unsupported on the current backend.","triggerScenarios":"ov_init failing on missing/corrupt model or codec files, incompatible quantization, use_fa=1 on a backend without flash-attention support, or clamp_fp16 interactions with an fp16-incompatible device; also plain OOM during weight load.","commonSituations":"use_fa enabled on CPU-only or older GPU builds; model/codec from different OmniVoice releases; truncated downloads; memory-constrained containers.","solutions":["Read the ov_last_error() text in the FATAL line — it names the exact cause; fix that first.","Retry with use_fa=0 if the error mentions flash attention.","Verify model and codec files exist, match the same release, and have expected sizes.","Disable clamp_fp16 or free memory if the error indicates allocation/precision problems."],"exampleFix":"// before\nrc := C.omni_load(m, c, 1, 1) // fa + fp16 clamp on unsupported backend\n// after\nrc := C.omni_load(m, c, 0, 0) // conservative flags first, then re-enable","handlingStrategy":"retry","validationCode":"for _, p := range []string{modelPath, codecPath} {\n    if _, err := os.Stat(p); err != nil {\n        return fmt.Errorf(\"omnivoice artifact missing: %w\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the ov_last_error() text in the error surfaced to the user — it names the real cause.","Start with use_fa=0 and clamp_fp16=0; enable flags only after a baseline load succeeds.","Keep model and codec from the same release; verify sizes against the manifest."],"tags":["omnivoice-cpp","tts","model-loading","flash-attention","fp16"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}