Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 89fcf34

Browse files
CameronNgCameronNg
andauthored
feat: cortex-cpp with cortex.tensorrt-llm (#719)
Co-authored-by: CameronNg <cameron@jan.ai>
1 parent 5f57033 commit 89fcf34

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

cortex-cpp/controllers/server.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace {
1717
constexpr static auto kLlamaEngine = "cortex.llamacpp";
1818
constexpr static auto kPythonRuntimeEngine = "cortex.python";
1919
constexpr static auto kOnnxEngine = "cortex.onnx";
20+
constexpr static auto kTensorrtLlmEngine = "cortex.tensorrt-llm";
2021
} // namespace
2122

2223
server::server(){
@@ -264,6 +265,8 @@ void server::LoadModel(const HttpRequestPtr& req,
264265
return cortex_utils::kLlamaLibPath;
265266
} else if(e == kOnnxEngine) {
266267
return cortex_utils::kOnnxLibPath;
268+
} else if(e == kTensorrtLlmEngine) {
269+
return cortex_utils::kTensorrtLlmPath;
267270
}
268271
return cortex_utils::kLlamaLibPath;
269272
};
@@ -371,4 +374,4 @@ void server::UnloadEngines() {
371374
}
372375
}
373376

374-
} // namespace inferences
377+
} // namespace inferences

cortex-cpp/controllers/server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@ class server : public drogon::HttpController<server>,
149149
std::unordered_map<std::string, EngineInfo> engines_;
150150
std::string cur_engine_type_;
151151
};
152-
}; // namespace inferences
152+
}; // namespace inferences

cortex-cpp/utils/cortex_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace cortex_utils {
2828
constexpr static auto kLlamaLibPath = "/engines/cortex.llamacpp";
2929
constexpr static auto kPythonRuntimeLibPath = "/engines/cortex.python";
3030
constexpr static auto kOnnxLibPath = "/engines/cortex.onnx";
31+
constexpr static auto kTensorrtLlmPath = "/engines/cortex.tensorrt-llm";
3132

3233
inline std::string models_folder = "./models";
3334

0 commit comments

Comments
 (0)