Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
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
14 changes: 14 additions & 0 deletions engine/controllers/models.cc
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,20 @@ void Models::StartModel(
params_override.cache_type = o.asString();
}

if (auto& o = (*(req->getJsonObject()))["mmproj"]; !o.isNull()) {
params_override.mmproj = o.asString();
}

// Support both llama_model_path and model_path for backward compatible
// model_path has higher priority
if (auto& o = (*(req->getJsonObject()))["llama_model_path"]; !o.isNull()) {
params_override.model_path = o.asString();
}

if (auto& o = (*(req->getJsonObject()))["model_path"]; !o.isNull()) {
params_override.model_path = o.asString();
}

auto model_entry = model_service_->GetDownloadedModel(model_handle);
if (!model_entry.has_value()) {
Json::Value ret;
Expand Down
2 changes: 2 additions & 0 deletions engine/services/model_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@ cpp::result<bool, std::string> ModelService::StartModel(
ASSIGN_IF_PRESENT(json_data, params_override, n_parallel);
ASSIGN_IF_PRESENT(json_data, params_override, ctx_len);
ASSIGN_IF_PRESENT(json_data, params_override, cache_type);
ASSIGN_IF_PRESENT(json_data, params_override, mmproj);
ASSIGN_IF_PRESENT(json_data, params_override, model_path);
#undef ASSIGN_IF_PRESENT;

CTL_INF(json_data.toStyledString());
Expand Down
2 changes: 2 additions & 0 deletions engine/services/model_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ std::optional<int> n_parallel;
std::optional<int> ctx_len;
std::optional<std::string> custom_prompt_template;
std::optional<std::string> cache_type;
std::optional<std::string> mmproj;
std::optional<std::string> model_path;
};
class ModelService {
public:
Expand Down
Loading