set hf_repo/docker_repo as model alias when posible

This commit is contained in:
Xuan Son Nguyen
2025-11-26 15:57:20 +01:00
parent e40f35fb61
commit e2731c3767
5 changed files with 12 additions and 4 deletions

View File

@@ -3353,7 +3353,6 @@ public:
}
models_json.push_back(json {
{"id", meta.name},
{"name", meta.name},
{"object", "model"}, // for OAI-compat
{"owned_by", "llamacpp"}, // for OAI-compat
{"created", t}, // for OAI-compat
@@ -3822,6 +3821,11 @@ int main(int argc, char ** argv, char ** envp) {
params.kv_unified = true;
}
// for consistency between server router mode and single-model mode, we set the same model name as alias
if (params.model_alias.empty() && !params.model.name.empty()) {
params.model_alias = params.model.name;
}
common_init();
// struct that contains llama context and inference