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

Function detectAllLocalModels

src/setup/model-detector.ts:150–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148
149/** Run all detectors in parallel; combine + sort results. */
150export async function detectAllLocalModels(): Promise<DetectedModel[]> {
151 const [ollama, lmStudio] = await Promise.all([
152 detectOllamaModels(),
153 detectLMStudioModels(),
154 ]);
155 // Sort: native-tool-calling first, then larger models first within each tier.
156 // This is what humans actually want: "show me my best option first".
157 const all = [...ollama, ...lmStudio];
158 all.sort((a, b) => {
159 const aTC = a.toolCallsLikely ? 1 : 0;
160 const bTC = b.toolCallsLikely ? 1 : 0;
161 if (aTC !== bTC) return bTC - aTC;
162 return (b.paramsB ?? 0) - (a.paramsB ?? 0);
163 });
164 return all;
165}
166
167/** Try to extract parameter count in billions from a model id. */
168function parseParamsFromId(id: string): number | undefined {

Callers 1

runSetupFunction · 0.85

Calls 2

detectOllamaModelsFunction · 0.85
detectLMStudioModelsFunction · 0.85

Tested by

no test coverage detected