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
2 changes: 1 addition & 1 deletion docs/docs/cli/cortex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ For example:
- [cortex embeddings](/docs/cli/embeddings): Create an embedding vector representing the input text.
- [cortex engines](/docs/cli/engines): Manage Cortex.cpp engines.
- [cortex pull|download](/docs/cli/pull): Download a model.
- [cortex run](/docs/cli/run): Shortcut to start a model and chat.
- [cortex run](/docs/cli/run): Shortcut to pull, start and chat with a model.
- [cortex update](/docs/cli/update): Update the Cortex.cpp version.
- [cortex start](/docs/cli/start): Start the Cortex.cpp API server.
- [cortex stop](/docs/cli/stop): Stop the Cortex.cpp API server.
38 changes: 19 additions & 19 deletions engine/cli/command_line_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ constexpr const auto kCommonCommandsGroup = "Common Commands";
constexpr const auto kInferenceGroup = "Inference";
constexpr const auto kModelsGroup = "Models";
constexpr const auto kEngineGroup = "Engines";
constexpr const auto kSystemGroup = "System";
constexpr const auto kSystemGroup = "Server";
constexpr const auto kSubcommands = "Subcommands";
} // namespace

CommandLineParser::CommandLineParser()
: app_("Cortex.cpp CLI"),
: app_("\nCortex.cpp CLI\n"),
download_service_{std::make_shared<DownloadService>()},
model_service_{ModelService(download_service_)},
engine_service_{EngineService(download_service_)} {}
Expand All @@ -55,12 +55,12 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) {

SetupSystemCommands();

app_.add_flag("--verbose", log_verbose, "Verbose logging");
app_.add_flag("--verbose", log_verbose, "Get verbose logs");

// Logic is handled in main.cc, just for cli helper command
std::string path;
app_.add_option("--config_file_path", path, "Configuration file path");
app_.add_option("--data_folder_path", path, "Data folder path");
app_.add_option("--config_file_path", path, "Configure .rc file path");
app_.add_option("--data_folder_path", path, "Configure data folder path");

// cortex version
auto cb = [&](int c) {
Expand All @@ -70,7 +70,7 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) {
CLI_LOG("default");
#endif
};
app_.add_flag_function("-v,--version", cb, "Cortex version");
app_.add_flag_function("-v,--version", cb, "Get Cortex version");

CLI11_PARSE(app_, argc, argv);
if (argc == 1) {
Expand All @@ -91,9 +91,9 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) {
commands::CheckNewUpdate(commands::kTimeoutCheckUpdate);
latest_version.has_value() &&
*latest_version != CORTEX_CPP_VERSION) {
CLI_LOG("\nA new release of cortex is available: "
CLI_LOG("\nNew Cortex release available: "
<< CORTEX_CPP_VERSION << " -> " << *latest_version);
CLI_LOG("To upgrade, run: " << commands::GetRole()
CLI_LOG("To update, run: " << commands::GetRole()
<< commands::GetCortexBinary()
<< " update");
}
Expand All @@ -115,7 +115,7 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) {
void CommandLineParser::SetupCommonCommands() {
auto model_pull_cmd = app_.add_subcommand(
"pull",
"Download a model by URL (or HuggingFace ID) "
"Download models by HuggingFace Repo/ModelID"
"See built-in models: https://huggingface.co/cortexso");
model_pull_cmd->group(kCommonCommandsGroup);
model_pull_cmd->usage("Usage:\n" + commands::GetCortexBinary() +
Expand All @@ -138,7 +138,7 @@ void CommandLineParser::SetupCommonCommands() {
}
});

auto run_cmd = app_.add_subcommand("run", "Shortcut to start a model");
auto run_cmd = app_.add_subcommand("run", "Shortcut: pull, start & chat with a model");
run_cmd->group(kCommonCommandsGroup);
run_cmd->usage("Usage:\n" + commands::GetCortexBinary() +
" run [options] [model_id]");
Expand Down Expand Up @@ -215,7 +215,7 @@ void CommandLineParser::SetupModelCommands() {
});

auto list_models_cmd =
models_cmd->add_subcommand("list", "List all models locally");
models_cmd->add_subcommand("list", "List all local models");
list_models_cmd->add_option("filter", cml_data_.filter, "Filter model id");
list_models_cmd->add_flag("-e,--engine", cml_data_.display_engine,
"Display engine");
Expand All @@ -232,7 +232,7 @@ void CommandLineParser::SetupModelCommands() {
});

auto get_models_cmd =
models_cmd->add_subcommand("get", "Get info of {model_id} locally");
models_cmd->add_subcommand("get", "Get a local model info by ID");
get_models_cmd->usage("Usage:\n" + commands::GetCortexBinary() +
" models get [model_id]");
get_models_cmd->group(kSubcommands);
Expand All @@ -251,7 +251,7 @@ void CommandLineParser::SetupModelCommands() {
});

auto model_del_cmd =
models_cmd->add_subcommand("delete", "Delete a model by ID locally");
models_cmd->add_subcommand("delete", "Delete a local model by ID");
model_del_cmd->usage("Usage:\n" + commands::GetCortexBinary() +
" models delete [model_id]");
model_del_cmd->group(kSubcommands);
Expand All @@ -272,13 +272,13 @@ void CommandLineParser::SetupModelCommands() {

std::string model_alias;
auto model_alias_cmd =
models_cmd->add_subcommand("alias", "Add alias name for a modelID");
models_cmd->add_subcommand("alias", "Add a model alias instead of ID");
model_alias_cmd->usage("Usage:\n" + commands::GetCortexBinary() +
" models alias --model_id [model_id] --alias [alias]");
model_alias_cmd->group(kSubcommands);
model_alias_cmd->add_option(
"--model_id", cml_data_.model_id,
"Can be modelID or model alias to identify model");
"Can be a model ID or model alias");
model_alias_cmd->add_option("--alias", cml_data_.model_alias,
"new alias to be set");
model_alias_cmd->callback([this, model_alias_cmd]() {
Expand All @@ -299,7 +299,7 @@ void CommandLineParser::SetupModelCommands() {

std::string model_path;
auto model_import_cmd = models_cmd->add_subcommand(
"import", "Import a gguf model from local file");
"import", "Import a model from a local filepath");
model_import_cmd->usage(
"Usage:\n" + commands::GetCortexBinary() +
" models import --model_id [model_id] --model_path [model_path]");
Expand Down Expand Up @@ -418,7 +418,7 @@ void CommandLineParser::SetupSystemCommands() {
});

auto ps_cmd =
app_.add_subcommand("ps", "Show running models and their status");
app_.add_subcommand("ps", "Show active model statuses");
ps_cmd->group(kSystemGroup);
ps_cmd->usage("Usage:\n" + commands::GetCortexBinary() + "ps");
ps_cmd->callback([&]() {
Expand Down Expand Up @@ -495,7 +495,7 @@ void CommandLineParser::EngineUninstall(CLI::App* parent,
}

void CommandLineParser::EngineGet(CLI::App* parent) {
auto get_cmd = parent->add_subcommand("get", "Get an engine info");
auto get_cmd = parent->add_subcommand("get", "Get engine info");
get_cmd->usage("Usage:\n" + commands::GetCortexBinary() +
" engines get [engine_name] [options]");
get_cmd->group(kSubcommands);
Expand Down Expand Up @@ -528,7 +528,7 @@ void CommandLineParser::EngineGet(CLI::App* parent) {

void CommandLineParser::ModelUpdate(CLI::App* parent) {
auto model_update_cmd =
parent->add_subcommand("update", "Update configuration of a model");
parent->add_subcommand("update", "Update model configurations");
model_update_cmd->group(kSubcommands);
model_update_cmd->add_option("--model_id", cml_data_.model_id, "Model ID")
->required();
Expand Down
2 changes: 1 addition & 1 deletion engine/cli/commands/cortex_upd_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void CortexUpdCmd::Exec(const std::string& v, bool force) {
if (!GetNightly(v))
return;
}
CLI_LOG("Update cortex sucessfully");
CLI_LOG("Updated cortex successfully");
}

bool CortexUpdCmd::GetStable(const std::string& v) {
Expand Down
4 changes: 2 additions & 2 deletions engine/cli/commands/ps_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void PsCmd::Exec(const std::string& host, int port) {

auto res = cli.Get("/inferences/server/models");
if (!res || res->status != httplib::StatusCode::OK_200) {
CLI_LOG("No model loaded!");
CLI_LOG("No models loaded!");
return;
}

Expand Down Expand Up @@ -44,7 +44,7 @@ void PsCmd::Exec(const std::string& host, int port) {
void PsCmd::PrintModelStatusList(
const std::vector<ModelLoadedStatus>& model_status_list) const {
if (model_status_list.empty()) {
CLI_LOG("No model loaded!");
CLI_LOG("No models loaded!");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion engine/controllers/swagger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ constexpr auto ScalarUi = R"(
<!doctype html>
<html>
<head>
<title>Scalar API Reference</title>
<title>Cortex API Reference</title>
<meta charset="utf-8" />
<meta
name="viewport"
Expand Down
Loading