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

Function parseQuantizationType

src/lib/utils.ts:103–118  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

101 * @returns Quantization type or null
102 */
103export function parseQuantizationType(filename: string): string | null {
104 const patterns = [
105 'Q8_0', 'Q6_K', 'Q5_K_M', 'Q5_K_S', 'Q5_1', 'Q5_0',
106 'Q4_K_M', 'Q4_K_S', 'Q4_1', 'Q4_0',
107 'Q3_K_L', 'Q3_K_M', 'Q3_K_S', 'Q2_K',
108 'F32', 'F16'
109 ];
110
111 const upperFilename = filename.toUpperCase();
112 for (const pattern of patterns) {
113 if (upperFilename.includes(pattern)) {
114 return pattern;
115 }
116 }
117 return null;
118}
119
120/**
121 * Get hardware compatibility badge for a model file

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected