Add CLI model management commands - #9
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces first-class vox model subcommands to manage local model lifecycle (list/download/verify/repair/remove), centralizing model manifest metadata and status inspection, and updating documentation and tests to cover the new workflow.
Changes:
- Added a
vox_model_managerlibrary implementing model manifest + status inspection and CLI subcommands. - Wired
vox model ...routing into the mainvoxCLI and updated missing-model guidance to point atvox model download .... - Added README documentation and a new test covering verify/list/remove behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
apps/model_manager.h | Declares model manifest/status types and the run_model_command entrypoint. |
apps/model_manager.cpp | Implements supported model manifest, status inspection, and vox model command handling. |
apps/CMakeLists.txt | Adds vox_model_manager static library and links it into the vox executable. |
apps/vox.cpp | Routes vox model ... to the model manager; updates missing-model download hints. |
CMakeLists.txt | Ensures the apps subdirectory is included so the model manager target exists for tests. |
README.md | Documents the new model management CLI workflow and verification behavior. |
tests/model_manager_test.cpp | Adds a focused test for model inspection and vox model subcommands. |
tests/CMakeLists.txt | Builds and registers the new vox_model_manager_test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| add_subdirectory(llama_runtime) | ||
| add_subdirectory(asr) | ||
| add_subdirectory(translate) | ||
| add_subdirectory(tts) | ||
| add_subdirectory(pipeline) | ||
| if(VOX_BUILD_APPS) | ||
| add_subdirectory(apps) | ||
| endif() | ||
| add_subdirectory(apps) | ||
Uh oh!
There was an error while loading. Please reload this page.
| for (const ManagedModel & model : supported_models()) { | ||
| const ManagedModelStatus status = inspect_model(model, project_root); | ||
| if (installed_only && !status.complete) { | ||
| continue; | ||
| } | ||
| out << model.name << "\t" << status_name(status) << "\t" << model.version << "\t"; |
| const int result = std::system(model.download_command.c_str()); | ||
| std::filesystem::current_path(previous, ec); | ||
| if (result != 0) { | ||
| err << "Download command failed for " << model.name << ".\n"; | ||
| return 1; | ||
| } | ||
| return 0; | ||
| } |
| #include "model_manager.h" | ||
| #include <filesystem> | ||
| #include <fstream> | ||
| #include <iostream> | ||
| #include <sstream> | ||
| namespace { | ||
| bool expect(bool condition, const std::string & message) { | ||
| if (!condition) { | ||
| std::cerr << message << "\n"; | ||
| return false; | ||
| } | ||
| return true; | ||
| } | ||
| } // namespace | ||
| int main() { | ||
| namespace fs = std::filesystem; | ||
| bool ok = true; | ||
| const fs::path root = fs::temp_directory_path() / "vox_model_manager_test"; |
Uh oh!
There was an error while loading. Please reload this page.
| out << "Downloading " << model->name << " using: " << model->download_command << "\n"; | ||
| return run_download_command(*model, project_root, err); |
There was a problem hiding this comment.
After a successful download, the model is now re-inspected and a non-zero exit is returned with a clear message when it's still incomplete (410a13e).
| if (command == "repair") { | ||
| std::error_code ec; | ||
| const ManagedModelStatus status = inspect_model(*model, project_root); | ||
| for (size_t i = 0; i < model->files.size(); ++i) { | ||
| const std::filesystem::path path = status.files[i].path; | ||
| if (status.files[i].exists && !status.files[i].complete) { | ||
| std::filesystem::remove(path, ec); | ||
| if (ec) { | ||
| err << "Could not remove incomplete file " << path << ": " << ec.message() << "\n"; | ||
| return 1; | ||
| } | ||
| out << "Removed incomplete file: " << path.string() << "\n"; | ||
| } | ||
| std::filesystem::remove(path.string() + ".part", ec); | ||
| } | ||
| } |
acc1aa6 to
8afcc29CompareUh oh!
There was an error while loading. Please reload this page.
Model setup and recovery were only discoverable through scripts and README instructions. This adds first-class
vox modelcommands for listing, downloading, verifying, repairing, and removing local models.CLI model lifecycle
vox model list [--installed]vox model download <model-name>vox model verify <model-name>vox model repair <model-name>vox model remove <model-name>Model manifest and validation
.partdownloads.Discoverability
vox --help.vox model download ....Example: