Skip to content

Expose quiet logging for embedded GGML/Metal inference #27

Description

@andimarafioti

Problem

qwentts-cpp-python is very noisy when embedded through its Python API, particularly with the macOS Metal wheel. With qwentts-cpp-python==0.4.1 and faster-qwen3-tts==0.5.2, loading a CustomVoice GGUF pair and synthesizing one short sentence emits hundreds of native lines to stderr: ggml_metal_device_init, Metal kernel compilation, [Prompt], [Pipeline], [Sample], and [Perf].

The faster-qwen3-tts CLI is quieter because it temporarily redirects the process-wide stderr file descriptor unless --verbose is set. Applications that import the Python API do not go through that CLI path. Redirecting stderr inside a long-running, multithreaded application risks hiding unrelated diagnostics.

What I checked

  • The existing QwenLibrary.set_log_callback() can intercept qwentts.cpp messages, but it does not cover GGML/Metal output. In a local Apple M3 Pro probe, registering it before model loading captured 18 qwentts messages while 146 GGML/Metal lines still reached stderr.
  • qt_log_set and GGML's ggml_log_set are separate process-wide native logging interfaces. The bundled macOS libggml-base.dylib exports ggml_log_set.
  • The callback lifecycle should remain safe when multiple QwenTTS contexts are created in one process, as covered by the resolved Segfault in qt_init() when a log callback (set_log_callback/qt_log_set) is registered across more than one QwenTTS context #17.

Request

Expose a supported quiet/log-level option through the Python API that can be configured before native model initialization. When set to warnings/errors, it should filter both qwentts.cpp and GGML/Metal routine output while preserving warnings and errors. Keep a verbose/debug setting for diagnostics, and document the process-wide scope of the native callbacks.

Ideally faster-qwen3-tts could then use this API instead of redirecting stderr, and embedding applications could select the same behavior without implementing native logging themselves.

Acceptance checks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions