Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .devops/cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ARG GCC_VERSION=14
# Install build toolchain
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc-${GCC_VERSION} g++-${GCC_VERSION} make cmake libgomp1 && \
gcc-${GCC_VERSION} g++-${GCC_VERSION} make cmake libgomp1 ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -43,12 +43,14 @@ RUN cmake -S . -B build \
-DENGINE_ENABLE_CUDA=OFF \
-DENGINE_ENABLE_VULKAN=OFF \
-DENGINE_ENABLE_OPENMP=ON \
-DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON \
-DENGINE_BUILD_EXAMPLES=OFF \
-DENGINE_BUILD_TESTS=OFF \
-DENGINE_BUILD_WARMBENCH=OFF && \
cmake --build build --parallel $(nproc) \
--target audiocpp_cli \
--target audiocpp_server \
--target audiocpp_model_manager \
--target model_perf \
--target miocodec_wavlm_parity

Expand All @@ -58,7 +60,7 @@ RUN mkdir -p /app/lib && \

# Collect binaries + multiplexer into /app/full
RUN mkdir -p /app/full && \
cp build/bin/audiocpp_cli build/bin/audiocpp_server \
cp build/bin/audiocpp_cli build/bin/audiocpp_server build/bin/audiocpp_model_manager \
build/bin/model_perf build/bin/miocodec_wavlm_parity /app/full/ && \
cp .devops/entrypoint.sh /app/full/entrypoint.sh && \
chmod +x /app/full/entrypoint.sh
Expand Down
6 changes: 4 additions & 2 deletions .devops/cuda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ARG GCC_VERSION=14
# Install build toolchain
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc-${GCC_VERSION} g++-${GCC_VERSION} cmake && \
gcc-${GCC_VERSION} g++-${GCC_VERSION} cmake ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -39,13 +39,15 @@ RUN cmake -S . -B build \
-DENGINE_ENABLE_CUDA_GRAPHS=ON \
-DENGINE_ENABLE_VULKAN=OFF \
-DENGINE_ENABLE_OPENMP=ON \
-DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON \
-DENGINE_BUILD_EXAMPLES=OFF \
-DENGINE_BUILD_TESTS=OFF \
-DENGINE_BUILD_WARMBENCH=OFF \
-DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined && \
cmake --build build --parallel $(nproc) \
--target audiocpp_cli \
--target audiocpp_server \
--target audiocpp_model_manager \
--target model_perf \
--target miocodec_wavlm_parity

Expand All @@ -55,7 +57,7 @@ RUN mkdir -p /app/lib && \

# Collect binaries + multiplexer into /app/full
RUN mkdir -p /app/full && \
cp build/bin/audiocpp_cli build/bin/audiocpp_server \
cp build/bin/audiocpp_cli build/bin/audiocpp_server build/bin/audiocpp_model_manager \
build/bin/model_perf build/bin/miocodec_wavlm_parity /app/full/ && \
cp .devops/entrypoint.sh /app/full/entrypoint.sh && \
chmod +x /app/full/entrypoint.sh
Expand Down
4 changes: 3 additions & 1 deletion .devops/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if [[ "$arg1" == "cli" ]]; then
exec ./audiocpp_cli "$@"
elif [[ "$arg1" == "server" ]]; then
exec ./audiocpp_server "$@"
elif [[ "$arg1" == "model-manager" ]]; then
exec ./audiocpp_model_manager "$@"
elif [[ "$arg1" == "perf" ]]; then
exec ./model_perf "$@"
elif [[ "$arg1" == "parity" ]]; then
Expand All @@ -24,8 +26,8 @@ else
echo "Available commands:"
echo " cli Run audio tasks (TTS, ASR, VAD, VC, diar, etc.)"
echo " server Run the HTTP server"
echo " model-manager List, install, clean, or remove model packages"
echo " perf Run model performance benchmarks"
echo " parity Run Miocodec WavLM parity tests"
exit 1
fi

18 changes: 14 additions & 4 deletions .devops/nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
cmake,
ninja,
pkg-config,
openssl,
rocmPackages,
cudaPackages,
vulkan-headers,
Expand All @@ -23,6 +24,7 @@
rocmSupport ? config.rocmSupport or false,
rocmGpuTargets ? (lib.optionals rocmSupport rocmPackages.clr.gpuTargets),
strixHaloOptimizations ? (rocmSupport && rocmGpuTargets == [ "gfx1151" ]),
nativeModelManagerSupport ? true,
# Model selection: if non-empty, only these model targets are built.
# See CMakeLists.txt AUDIOCPP_MODEL_SET / AUDIOCPP_MODELS.
models ? [ ],
Expand All @@ -45,6 +47,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
python-scripts
]
++ lib.optional nativeModelManagerSupport openssl
++ lib.optionals vulkanSupport [
vulkan-headers
vulkan-loader
Expand All @@ -66,6 +69,10 @@ stdenv.mkDerivation (finalAttrs: {
"-DENGINE_ENABLE_NATIVE_CPU=ON"
"-DENGINE_ENABLE_LLAMAFILE=ON"
]
++ lib.optionals nativeModelManagerSupport [
"-DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON"
"-DAUDIOCPP_USE_SYSTEM_OPENSSL=ON"
]
++ (
if models != [ ] then
[
Expand Down Expand Up @@ -95,14 +102,17 @@ stdenv.mkDerivation (finalAttrs: {

# Copy the built C++ executables directly from the bin directory
cp bin/audiocpp_cli bin/audiocpp_server bin/audiocpp_gguf $out/bin/
${lib.optionalString nativeModelManagerSupport ''
cp bin/audiocpp_model_manager $out/bin/
''}

# Install the supported spec-backed model manager and the catalog it reads
# relative to its installed location.
install -Dm755 $src/tools/model_manager_v2.py $out/bin/audiocpp_model_manager
# Keep the supported Python v2 manager available during migration without
# overwriting the native audiocpp_model_manager executable copied above.
install -Dm755 $src/tools/model_manager_v2.py $out/bin/audiocpp_model_manager_v2.py
cp -R $src/model_specs $out/model_specs

# Patch the shebang to use our python environment with torch/safetensors/pyyaml
patchShebangs $out/bin/audiocpp_model_manager
patchShebangs $out/bin/audiocpp_model_manager_v2.py

runHook postInstall
'';
Expand Down
79 changes: 68 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ option(AUDIOCPP_DEPLOYMENT_BUILD
file(GLOB AUDIOCPP_MODEL_SPEC_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/model_specs/*.json")
set(AUDIOCPP_BUILTIN_MODEL_SPEC_ENTRIES "")
set(AUDIOCPP_CONVERTER_MODEL_SPEC_ENTRIES "")
set(AUDIOCPP_NATIVE_PACKAGE_SPEC_ENTRIES "")
foreach(AUDIOCPP_MODEL_SPEC_FILE IN LISTS AUDIOCPP_MODEL_SPEC_FILES)
get_filename_component(AUDIOCPP_MODEL_SPEC_FAMILY "${AUDIOCPP_MODEL_SPEC_FILE}" NAME_WE)
file(READ "${AUDIOCPP_MODEL_SPEC_FILE}" AUDIOCPP_MODEL_SPEC_JSON)
string(APPEND AUDIOCPP_CONVERTER_MODEL_SPEC_ENTRIES
" {\"${AUDIOCPP_MODEL_SPEC_FAMILY}\", R\"AUDIOCPP_SPEC(${AUDIOCPP_MODEL_SPEC_JSON})AUDIOCPP_SPEC\"},\n")
string(APPEND AUDIOCPP_NATIVE_PACKAGE_SPEC_ENTRIES
" {\"${AUDIOCPP_MODEL_SPEC_FAMILY}\", R\"AUDIOCPP_SPEC(${AUDIOCPP_MODEL_SPEC_JSON})AUDIOCPP_SPEC\"},\n")
if (AUDIOCPP_DEPLOYMENT_BUILD)
string(APPEND AUDIOCPP_BUILTIN_MODEL_SPEC_ENTRIES
" {\"${AUDIOCPP_MODEL_SPEC_FAMILY}\", R\"AUDIOCPP_SPEC(${AUDIOCPP_MODEL_SPEC_JSON})AUDIOCPP_SPEC\"},\n")
Expand All @@ -38,6 +41,9 @@ file(GENERATE
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/gguf_converter_model_specs.inc"
CONTENT "${AUDIOCPP_CONVERTER_MODEL_SPEC_ENTRIES}")
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/native_package_specs.inc"
CONTENT "${AUDIOCPP_NATIVE_PACKAGE_SPEC_ENTRIES}")

if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type" FORCE)
Expand Down Expand Up @@ -89,6 +95,16 @@ option(ENGINE_HIP_STRIX_HALO_OPTIMIZATIONS
OFF)
option(ENGINE_ENABLE_NATIVE_CPU "Build ggml CPU kernels with native host ISA flags" ${ENGINE_DEFAULT_ENABLE_NATIVE_CPU})
option(ENGINE_ENABLE_OPENMP "Build host code with OpenMP support" ON)
option(AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER
"Build native model-manager tools and server download/install support"
OFF)
option(AUDIOCPP_USE_SYSTEM_OPENSSL
"Use system OpenSSL for native model management instead of bundled BoringSSL"
OFF)
if (AUDIOCPP_USE_SYSTEM_OPENSSL AND NOT AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER)
message(FATAL_ERROR
"AUDIOCPP_USE_SYSTEM_OPENSSL requires AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON")
endif()
option(ENGINE_ENABLE_CPU_ALL_VARIANTS
"Build CPU backends as dynamic libraries with per-ISA variants (for Docker/portable builds)"
OFF)
Expand Down Expand Up @@ -1274,6 +1290,29 @@ target_include_directories(cjson_vendor PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/external/cJSON
)

# Native package management is deliberately opt-in. Normal CLI and server
# builds do not configure an HTTP/TLS dependency. When enabled, package specs
# remain embedded so the standalone manager and managed WebUI do not require a
# source checkout or an external model_specs directory.
if (AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER)
add_subdirectory(external/cpp-httplib)
add_library(audiocpp_package_manager STATIC
src/framework/package_manager/manager.cpp
src/framework/io/json.cpp
src/framework/io/filesystem.cpp
)
target_include_directories(audiocpp_package_manager PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_include_directories(audiocpp_package_manager PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/generated"
)
target_link_libraries(audiocpp_package_manager PRIVATE
cjson_vendor
audiocpp_cpp_httplib
)
endif()

add_library(yaml_vendor STATIC
external/libyaml/src/api.c
external/libyaml/src/reader.c
Expand Down Expand Up @@ -1416,7 +1455,6 @@ add_executable(audiocpp_server
app/server/base64.cpp
app/server/config.cpp
app/server/http.cpp
app/server/model_installer.cpp
app/server/multipart.cpp
app/server/runtime.cpp
app/server/ui_assets.cpp
Expand All @@ -1427,6 +1465,11 @@ add_executable(audiocpp_server
)

target_link_libraries(audiocpp_server PRIVATE engine_runtime ggml)
if (AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER)
target_sources(audiocpp_server PRIVATE app/server/model_installer.cpp)
target_link_libraries(audiocpp_server PRIVATE audiocpp_package_manager)
target_compile_definitions(audiocpp_server PRIVATE AUDIOCPP_HAS_NATIVE_MODEL_MANAGER=1)
endif()
target_include_directories(audiocpp_server PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated")
if (WIN32)
target_link_libraries(audiocpp_server PRIVATE ws2_32)
Expand All @@ -1444,6 +1487,13 @@ if (ENGINE_ENABLE_OPENMP)
target_link_libraries(audiocpp_gguf PRIVATE OpenMP::OpenMP_CXX)
endif()

if (AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER)
add_executable(audiocpp_model_manager
app/model_manager/main.cpp
)
target_link_libraries(audiocpp_model_manager PRIVATE audiocpp_package_manager)
endif()

add_executable(model_perf
tests/perf/model_perf.cpp
app/cli/args.cpp
Expand Down Expand Up @@ -2246,17 +2296,24 @@ if (ENGINE_BUILD_TESTS)
target_link_libraries(parakeet_parity_dump PRIVATE OpenMP::OpenMP_CXX)
endif()

add_executable(server_model_installer_test
tests/unittests/test_server_model_installer.cpp
app/server/model_installer.cpp
)
target_include_directories(server_model_installer_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/app/server)
target_link_libraries(server_model_installer_test PRIVATE Threads::Threads)
if (AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER)
add_executable(server_model_installer_test
tests/unittests/test_server_model_installer.cpp
app/server/model_installer.cpp
)
target_include_directories(server_model_installer_test PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/app/server
${CMAKE_CURRENT_BINARY_DIR}/generated)
target_link_libraries(server_model_installer_test PRIVATE
Threads::Threads engine_runtime audiocpp_package_manager)
target_compile_definitions(server_model_installer_test PRIVATE
AUDIOCPP_NATIVE_MANAGER_FIXTURE="${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/native_model_manager_server.py")

add_test(
NAME server_model_installer_test
COMMAND server_model_installer_test
)
add_test(
NAME server_model_installer_test
COMMAND server_model_installer_test
)
endif()
endif()

if (ENGINE_BUILD_EXAMPLES)
Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@ Use `tools/model_manager_v2.py` for normal model downloads. It reads
`model_specs/*.json` and installs the default package for each family, preferring
ready-to-use GGUF packages when they are available.

Native builds configured with `-DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON` also
provide `audiocpp_model_manager`, a standalone headless
frontend over the same reusable C++ package-management library used by the
server and embedded WebUI. It supports list, info, install, clean, and remove
without starting `audiocpp_server`; this is the preferred native path for CLI,
Docker, remote provisioning, and other scripted environments. The Python v2
manager remains available as an alternative during migration.

```bash
audiocpp_model_manager list
audiocpp_model_manager install qwen3_asr_0_6b_q8_0 --models-dir models
```

The old safetensors/converter catalog has been renamed to
`tools/model_manager_deprecated.py`. Use it only for legacy model layouts that
have not moved to spec-backed GGUF packages yet.
Expand All @@ -160,13 +173,13 @@ generation, conversion, separation, VAD, diarization, and alignment workflows. T
into the server binary, so using it requires neither Python nor separate frontend files:

```bash
audiocpp_server --ui --backend cuda
audiocpp_server --ui --ui-management --backend cuda
```

Open `http://127.0.0.1:8080`. Starting with `--ui` and no server config enables on-demand model
load/unload and temporary browser uploads. Existing static server configurations also expose the UI by default;
in that mode the UI only offers models declared by the server config. Add `--ui-management` when that instance
should permit catalog browsing, downloads, temporary uploads, and dynamic model switching.
Open `http://127.0.0.1:8080`. The command above requires a build configured with
`-DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON` and enables catalog browsing, downloads, temporary uploads, and
dynamic model switching. A normal build has no HTTP/TLS model-manager dependency and can still serve the UI with
`--ui` from an existing server configuration; in that mode the UI only offers models declared by the config.

The native UI also exposes background model download/preparation, long-text split-and-merge synthesis, a
browser-local saved voice library, microphone recording, and near-live ASR input. Some model preparation jobs invoke
Expand Down Expand Up @@ -382,6 +395,8 @@ Run with `--backend hip` (`rocm` is accepted as an alias). For GPU target select
| `ENGINE_BUILD_EXAMPLES` | Build example binaries. | `OFF` |
| `ENGINE_BUILD_TESTS` | Build framework unit tests. | `OFF` |
| `ENGINE_BUILD_WARMBENCH` | Build warmbench helper binaries. | `OFF` |
| `AUDIOCPP_BUILD_NATIVE_MODEL_MANAGER` | Build the standalone native model manager and enable server-side WebUI downloads/install management. This opt-in feature builds the HTTP/TLS dependency. | `OFF` |
| `AUDIOCPP_USE_SYSTEM_OPENSSL` | Use system OpenSSL instead of bundled BoringSSL when native model management is enabled. | `OFF` |
| `AUDIOCPP_DEPLOYMENT_BUILD` | Compile package specs into CLI/server binaries for standalone GGUF and package-spec fallback loading. Script builds expose this as `--deployment-build` on Linux/macOS and `-DeploymentBuild` on Windows. | `OFF` |
| `AUDIOCPP_MODEL_SET` | Model composite to build: `full`, `core`, or `custom`. Script builds expose this as `--model-set` on Linux/macOS and `-ModelSet` on Windows. | `full` |
| `AUDIOCPP_MODELS` | Comma or semicolon separated model target names when `AUDIOCPP_MODEL_SET=custom`, such as `qwen3_tts,pocket_tts,qwen3_asr`. Script builds expose this as `--models` on Linux/macOS and `-Models` on Windows. | empty |
Expand Down
Loading
Loading