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
15 changes: 14 additions & 1 deletion engine/extensions/local-engine/local_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const std::unordered_set<std::string> kIgnoredParams = {
"user_prompt", "min_keep", "mirostat", "mirostat_eta",
"mirostat_tau", "text_model", "version", "n_probs",
"object", "penalize_nl", "precision", "size",
"stop", "tfs_z", "typ_p"};
"stop", "tfs_z", "typ_p", "caching_enabled"};

const std::unordered_map<std::string, std::string> kParamsMap = {
{"cpu_threads", "--threads"},
Expand Down Expand Up @@ -67,6 +67,19 @@ std::vector<std::string> ConvertJsonToParamsVector(const Json::Value& root) {
res.push_back("--embedding");
}
continue;
} else if (member == "cache_type") {
if (!root[member].isNull()) {
res.push_back("-ctk");
res.push_back(root[member].asString());
res.push_back("-ctv");
res.push_back(root[member].asString());
}
continue;
} else if (member == "use_mmap") {
if (!root[member].asBool()) {
res.push_back("--no-mmap");
}
continue;
}

res.push_back("--" + member);
Expand Down
12 changes: 10 additions & 2 deletions engine/services/engine_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,13 @@ EngineService::GetInstalledEngineVariants(const std::string& engine) const {
// try to find version.txt
auto version_txt_path = version_entry.path() / "version.txt";
if (!std::filesystem::exists(version_txt_path)) {
continue;
// create new one
std::ofstream meta(version_txt_path, std::ios::out);
meta << "name: " << entry.path().filename() << std::endl;
meta << "version: " << version_entry.path().filename() << std::endl;
meta.close();
CTL_INF("name: " << entry.path().filename().string() << ", version: "
<< version_entry.path().filename().string());
}

try {
Expand Down Expand Up @@ -865,7 +871,9 @@ void EngineService::RegisterEngineLibPath() {

// register deps
std::vector<std::filesystem::path> paths{};
paths.push_back(cuda_path);
if (std::filesystem::exists(cuda_path)) {
paths.push_back(cuda_path);
}
paths.push_back(engine_dir_path);

CTL_DBG("Registering dylib for "
Expand Down
Loading