Add reusable native model package manager - #230
Conversation
|
@mirek190 I don’t think we should remove the Python model_manager_v2.py or rewrite the docs around the assumption that the native UI/server is the only model-download path. The native manager is a good addition, but the Python manager is still a useful alternative, especially for CLI, Docker, remote, and scripted/headless workflows. It feels odd to require users to start the UI or call server management endpoints just to download a model. I’d prefer to keep model_manager_v2.py for now and present the native manager as an additional path used by the built-in UI. Long term, I think the C++ package management logic should live in a dedicated reusable library instead of being owned by the server. The server can expose it for the native UI, but CLI, Docker, remote, and scripted/headless users should not need to start audiocpp_server just to download models. Once there is a native standalone manager with similar list / info / install / clean coverage, then removing the Python v2 manager would make much more sense. |
|
So download manager should exist as a library available for server, cli and docker? |
For the C++-based manager, I mean making the core functionality a framework library so both the server and CLI can use it, while exposing an interface for model downloads (e.g., |
ca0f282 to
a98b9cb
Compare
|
Updated this PR in response to the architecture feedback. The Python v2 manager has been restored and remains supported. The native implementation is now additive and split into a reusable framework component rather than being owned by the server:
The dependency direction is therefore: Validation completed locally:
The updated commit is |
|
Too late - already done. :) As I had a fully working model manager I needed only few changes so that could works for server, cli, doker. |
|
Fixed the Nix failures in The failure was caused by the new native package-manager target calling I also corrected the install phase discovered while tracing this failure: it copied the native
Fresh CPU and Vulkan Nix checks are running now. |
|
I can’t keep up 😂! |
Are you working on MiniMax audio ? I'm asking because I already have working importation and will be testing tomorrow. |
|
@mirek190 Yes! End to end done and do some finetuning of code now |
|
Cool 👍 |
|
@mirek190 Have you test your impl for longform (5min song) generation? Update: the current blocker for me is longform can't do realtime. |
|
I uploaded the GGUFs to HF and and push the code to branch Serveral unsolved issues: (1) longform performance (2) further memory optimizations for memory saver mode. (3) compoent quant combo and best layers to quant while preserving quality. One challenge for me is to define the quality metrics. When bf16, if we force the the sampler output to match python, then python and cpp produce the high similar wav. After performance and memory optimizations like change precision, the song may change dramatically. It's still valid to me, but I just can't tell it's better or worse than the baseline. Still need to more exepriments so the current code bypass spec v1 and the json entirely. Feel free to change the code. I need to go back to PRs and issues... |
|
@mirek190 The main blocker is that this PR introduces a mandatory external networking dependency, so audio.cpp is no longer self-contained for normal builds. In the init test, my local configure failed because the machine does not have the system My preferred direction is closer to llama.cpp’s approach: use a small vendored HTTP client such as After fixing the initial build blocker, quick validation suggests that both |
You actually right. We need something more universal. |
9e500d7 to
0c6bae3
Compare
|
Updated the networking layer and synchronized this PR with current The native package manager no longer has separate WinHTTP and libcurl implementations. It now follows the llama.cpp-style self-contained arrangement:
For reproducible/sandboxed builds, CMake also accepts The first post-update Nix run exposed one packaging-specific issue: Nix injects a global Validation completed after rebasing:
Current head: |
|
Follow-up on the Nix CI correction: The initial Nix failures were not caused by the native package-manager transport itself. audio.cpp enables strict warning flags globally ( The first correction covered the main Final verification on
This keeps the bundled cpp-httplib + static BoringSSL transport, avoids a libcurl/system-OpenSSL development dependency, and is now clean across the full PR build matrix. |
|
@mirek190 Lightning speed ⚡ ! Could you scope the build and dependency? My original plan (which I didn’t get a chance to implement 😄), was: Build native HTTP/TLS dependency: Default OFF Basically, only pull and build the dependency when the user intends to use it. I think we only need one flag controlling whether to build audiocpp_model_manager: Different cases: Server/cli only. No downloads. No build cmd change. Server + UI + config mode. No download. Server + normal UI. Need download by default Manager alone Then for packager wants system OpenSSL instead of bundled BoringSSL |
|
OK we can change it to more modular
The server should conditionally include model_installer.cpp, link audiocpp_package_manager, and expose management |
Keep normal CLI and server builds free of HTTP and TLS dependencies. Build the reusable package manager, standalone manager executable, managed WebUI endpoints, and bundled BoringSSL only when AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER is enabled. Allow packagers to select system OpenSSL explicitly, and make Docker and Nix opt into the managed configuration.
|
Implemented the opt-in architecture requested in commit 8eadb4c.
Additional Windows portability fixes replace CreateFile2 with the equivalent CreateFileW mapping path and define the supported Windows API target for MinGW. Validation completed:
This leaves the downloader as a reusable opt-in library for the server and standalone manager while keeping normal CLI/server inference builds dependency-free. |
Avoid compiling bundled BoringSSL concurrently with Vulkan shader generation in Nix builds. Use the Nix-provided OpenSSL package through the native manager's explicit system TLS override while retaining bundled BoringSSL for portable non-Nix builds.
|
Follow-up fix pushed in 61a00e7 for the failed Nix Vulkan check. The failure was a late Vulkan link error for missing generated subgroup-matmul shader symbols. Enabling the native manager made Nix compile bundled BoringSSL concurrently with ggml's internally parallel Vulkan shader generation; individual glslc failures are swallowed by the upstream generator, so the visible symptom was an incomplete shader source and undefined references at link time. Nix now uses its packaged OpenSSL through AUDIOCPP_USE_SYSTEM_OPENSSL=ON instead of building bundled BoringSSL. Native manager HTTPS remains enabled, while the Nix build avoids the extra compiler workload and uses the normal reproducible Nix TLS dependency. Portable Docker and ordinary opt-in builds continue to use bundled BoringSSL by default. The Nix expression passes diff/syntax structure checks locally; a local Nix installation is not available on this Windows host, so the newly triggered CPU/Vulkan Nix jobs are the authoritative build verification. |
|
Thanks! I wil test it tomorrow. |
Resolves #222
What changed
audiocpp_package_manager.audiocpp_model_managerexecutable for CLI, Docker, and headless workflows.audiocpp_serverto call the same library directly while retaining its asynchronous HTTP job API for the native WebUI.tools/model_manager_v2.pyavailable and supported during the migration.Architecture
model_specs/*.jsonremains the editable source of truth. CMake embeds the active package catalog into the reusable library, while an explicitly supplied external catalog can still override it.The standalone executable exposes:
list [--remote]info PACKAGE [--remote]install PACKAGE [--overwrite]clean PACKAGEremove PACKAGElistandinfoproduce machine-readable JSON. The native executable is intentionally lightweight and does not link the inference runtime.Validation
check_loader_catalog_sync.py --self-testpassed.list, single-packageinfo, unknown-package failure, and portable execution without external specs passed.audiocpp_model_manager.exeandaudiocpp_server.exe.git diff --checkpassed.