add --models-allow-extra-args for security

This commit is contained in:
Xuan Son Nguyen
2025-11-24 12:01:16 +01:00
parent 5ef3f990b9
commit 6ed192b4dd
5 changed files with 22 additions and 4 deletions

View File

@@ -2488,6 +2488,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.models_max = value;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_MODELS_MAX"));
add_opt(common_arg(
{"--models-allow-extra-args"},
string_format("for router server, allow extra arguments for models; important: some arguments can allow users to access local file system, use with caution (default: %s)", params.models_allow_extra_args ? "enabled" : "disabled"),
[](common_params & params) {
params.models_allow_extra_args = true;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_MODELS_ALLOW_EXTRA_ARGS"));
add_opt(common_arg(
{"--no-models-autoload"},
"disables automatic loading of models (default: enabled)",