okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
1237d9a5f
main
1/** 2* A short name for a downloaded optimized model: the family and the quantization ("Swift IQ2_XS", "Gyro-S", "IQ3_S"), made from the id the 3* installation gives it (the family tag in front of the lower-cased quantization). The long name stays available as a tooltip. 4*/ 5const FAMILIES :[ string , string ][] = [[ 'swift-' , 'Swift' ], [ 'coder-' , 'Coder' ], [ 'unsloth-' , 'Unsloth' ], [ 'gyro-gyro-' , 'Gyro' ], [ 'gyro-' , 'Gyro' ], [ 'nvfp4-' , 'NVFP4' ], [ 'qwen36-' , 'Qwen3.6' ]]; 6 7/** 8* The three NVFP4 versions, named by who made the weights (the plain model names NVFP4 / NVFP4-NVIDIA / NVFP4-QAD looked like the same thing): 9* - NVFP4: Strata's own GPTQ conversion of Qwen's weights, the best quality of the three; 10* - NVFP4-NVIDIA: NVIDIA's own NVFP4 checkpoint (plain rounding), converted for Strata, the same size and speed; 11* - NVFP4-QAD: NVIDIA's FP4 checkpoint that was trained for FP4 (quantization-aware distillation), slightly faster on short prompts. 12* `note` is the one line that says how they differ. 13*/ 14export const NVFP4_VERSIONS :Record < string , { name :string ; note :string }> = { 15'NVFP4' :{ name :'NVFP4 (Strata’s version)' , note :'Strata’s own conversion. The best quality of the NVFP4 versions.' }, 16'NVFP4-NVIDIA' :{ name :'NVFP4 (NVIDIA’s version)' , note :'NVIDIA’s own NVFP4 checkpoint, converted for Strata. Same size and speed.' }, 17'NVFP4-QAD' :{ name :'NVFP4 (NVIDIA, trained for FP4)' , note :'NVIDIA’s FP4 checkpoint, trained for FP4. Slightly faster on short prompts.' }, 18}; 19export const nvfp4Version = ( model :string ) => NVFP4_VERSIONS [ String ( model ?? '' ). toUpperCase ()]; 20 21export function nativeShortName ( id :string ) :string { 22const lower = String ( id ?? '' ). toLowerCase (); 23for ( const [ prefix , label ] of FAMILIES ) { 24if ( ! lower . startsWith ( prefix )) continue ; 25const rest = lower . slice ( prefix . length ). toUpperCase (); 26if ( ! rest ) return label ; 27if ( label === 'NVFP4' ) return nvfp4Version ( rest )?. name ?? ` ${ label } ${ rest } ` ; 28return label === 'Gyro' ?`Gyro- ${ rest . replace ( / ^GYRO- / , '' )} ` :` ${ label } ${ rest } ` ; 29} 30return lower . toUpperCase () || String ( id ); 31}