MCPcopy Create free account
hub / github.com/Icecubesaad/OpenLLM-Studio / getModelDisplayName

Function getModelDisplayName

src/components/ChatInput.tsx:132–142  ·  view source on GitHub ↗

* Extracts a clean display name from a model filename. * "gemma-4-e2b-it-uncensored-gguf-q4-k-m" → "gemma-4-e2b-it-uncensored" * "llama3.2:1b" → "llama3.2:1b"

(model: string)

Source from the content-addressed store, hash-verified

130 * "llama3.2:1b""llama3.2:1b"
131 */
132function getModelDisplayName(model: string): string {
133 // Strip quantization suffixes like -gguf-q4-k-m, -Q4_K_M, etc.
134 const clean = model
135 .replace(/[-_](gguf|ggml)([-_][a-zA-Z0-9]+)*/i, '')
136 .replace(/[-_][qiQI]\d[_-]?[a-zA-Z0-9_]*/g, '')
137 .replace(/[-_]+$/, '')
138 .trim();
139
140 if (clean.length <= 30) return clean;
141 return clean.slice(0, 30) + '…';
142}

Callers 1

ChatInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected