option to deploy single model from local storage without versioning#4209
Open
dtrawins wants to merge 5 commits into
Open
option to deploy single model from local storage without versioning#4209dtrawins wants to merge 5 commits into
dtrawins wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for configuring a model base_path as a single local model file (instead of a versioned directory structure), exposing a synthetic version 1. This fits into OVMS’s classic model repository workflow by simplifying deployments where model artifacts are stored as standalone files (e.g., local exports / hub downloads).
Changes:
- Extend model version discovery to treat certain local regular files as a single-model repository (synthetic version
1). - Update model file discovery and config path handling to work when
base_pathis a file (including mapping config lookup). - Add unit tests and update docs to describe the new single-file
base_pathmode.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/modelmanager.cpp |
Detects local regular-file base_path and returns synthetic version 1 for supported extensions. |
src/modelinstance.cpp |
Adds file-path handling in model file discovery (IR/ONNX/Paddle/TF/TFLite). |
src/modelconfig.cpp |
Adjusts getPath() and mapping config lookup behavior for file-based local paths. |
src/test/modelmanager_test.cpp |
Adds tests for single-file version discovery and config-based startup using an .xml file path. |
docs/parameters.md |
Documents that local base_path may point directly to a single model file and exposes version 1. |
docs/models_repository_classic.md |
Documents the single-file alternative for local filesystem classic repositories. |
Comments suppressed due to low confidence (1)
src/modelinstance.cpp:1131
- For PaddlePaddle single-file paths (.pdmodel/.pdiparams), switching to the parent directory and searching by extension can select a different pair when multiple variants exist. Resolve the companion file corresponding to the explicitly provided file (e.g., same stem) so the configured variant is deterministically loaded.
if (extension == ".pdmodel" || extension == ".pdiparams") {
path = modelDirectory;
bool found = false;
fetchModelFiles(found, PADDLE_MODEL_FILES_EXTENSIONS);
if (!found) {
Comment on lines
+1104
to
+1106
| std::error_code ec; | ||
| if (FileSystem::isLocalFilesystem(path) && std::filesystem::is_regular_file(path, ec)) { | ||
| const auto modelFile = std::filesystem::path(path); |
Comment on lines
+1111
to
+1115
| if (extension == ".xml") { | ||
| path = modelDirectory; | ||
| bool found = false; | ||
| fetchModelFiles(found, OV_MODEL_FILES_EXTENSIONS); | ||
| if (!found) { |
|
|
||
| if (!found) { | ||
| SPDLOG_ERROR("Could not find file for model: {} version: {} in path: {}", getName(), getVersion(), path); | ||
| SPDLOG_ERROR("Error loading model. Invalid model file."); |
| - Each model directory should include a sub-folder for each of its versions (1,2, etc). The versions and their folder names should be positive integer values. | ||
| **Note:** In execution, the versions are enabled according to a pre-defined version policy. If the client does not specify | ||
| the version number in parameters, by default, the latest version is served. | ||
| - As an alternative for local filesystem only, `model_path` / `base_path` can point directly to a single model file (`.xml`, `.bin`, `.onnx`, `.pdmodel`, `.pdiparams`, `.pb`, `.tflite`). In this mode, Model Server exposes synthetic version `1`. |
Comment on lines
+1295
to
+1301
| static const std::set<std::string> supportedSingleFileModelExtensions = { | ||
| ".xml", | ||
| ".onnx", | ||
| ".pdmodel", | ||
| ".pdiparams", | ||
| ".pb", | ||
| ".tflite"}; |
mzegla
approved these changes
May 19, 2026
Collaborator
mzegla
left a comment
There was a problem hiding this comment.
Looks good in general - please look into copilot comments
dkalinowski
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary
This option can be useful for deploying models from hugging face which typically include a set of model variances with different quantizations. It could be combined with image processing parameters based on preprocessing_config.json
🧪 Checklist
``