MCPcopy
hub / github.com/Doorman11991/smallcode / matchProfile

Function matchProfile

src/model/profiles.js:98–109  ·  view source on GitHub ↗

* Match a model name to a known profile using fuzzy prefix matching. * @param {string} modelName - The model name from config (e.g. "huihui-gemma-4-e4b-it-abliterated") * @returns {object|null} Profile or null if no match

(modelName)

Source from the content-addressed store, hash-verified

96 * @returns {object|null} Profile or null if no match
97 */
98function matchProfile(modelName) {
99 const name = modelName.toLowerCase();
100
101 // Try exact key matches first (longest match wins)
102 const keys = Object.keys(KNOWN_PROFILES).sort((a, b) => b.length - a.length);
103 for (const key of keys) {
104 if (name.includes(key)) {
105 return { ...KNOWN_PROFILES[key], matched_key: key };
106 }
107 }
108 return null;
109}
110
111/**
112 * Get the effective profile for a model, with defaults for unknowns.

Callers 1

getProfileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected