Remove display_name from local model API and use model ID everywhere (#7382)

This commit is contained in:
jh-block
2026-02-20 14:11:56 +01:00
committed by GitHub
parent c8c8a1237c
commit 966bbba819
7 changed files with 18 additions and 52 deletions
@@ -123,7 +123,6 @@ pub fn get_registry() -> &'static Mutex<LocalModelRegistry> {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LocalModelEntry {
pub id: String,
pub display_name: String,
pub repo_id: String,
pub filename: String,
pub quantization: String,
@@ -306,14 +305,3 @@ impl LocalModelRegistry {
pub fn model_id_from_repo(repo_id: &str, quantization: &str) -> String {
format!("{}:{}", repo_id, quantization)
}
/// Generate a display name from repo_id and quantization.
pub fn display_name_from_repo(repo_id: &str, quantization: &str) -> String {
let model_name = repo_id
.split('/')
.next_back()
.unwrap_or(repo_id)
.trim_end_matches("-GGUF")
.trim_end_matches("-gguf");
format!("{} ({})", model_name, quantization)
}