MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / parseParamsFromId

Function parseParamsFromId

src/setup/model-detector.ts:168–181  ·  view source on GitHub ↗

Try to extract parameter count in billions from a model id.

(id: string)

Source from the content-addressed store, hash-verified

166
167/** Try to extract parameter count in billions from a model id. */
168function parseParamsFromId(id: string): number | undefined {
169 // Patterns: ":32b", "-32b", "70B", "8x22b", ":3b", "qwen3-coder:30b"
170 const colonOrDash = id.match(/[:\-](\d+(?:\.\d+)?)b\b/i);
171 if (colonOrDash) return parseFloat(colonOrDash[1]!);
172 const xMatch = id.match(/(\d+)x(\d+)b/i);
173 if (xMatch) {
174 // MoE: experts × size, with rough "active params" heuristic of 30% for routing
175 return parseInt(xMatch[1]!, 10) * parseInt(xMatch[2]!, 10);
176 }
177 // Some HF-style ids embed the size in name: "Qwen3-Coder-30B-Instruct"
178 const bareMatch = id.match(/(\d+(?:\.\d+)?)[bB]\b/);
179 if (bareMatch) return parseFloat(bareMatch[1]!);
180 return undefined;
181}
182
183/** Heuristic: does this model id look like it has native tool-call training? */
184function looksLikeToolCallCapable(id: string): boolean {

Callers 2

detectOllamaModelsFunction · 0.85
detectLMStudioModelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected