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

Method listAvailableModels

src/llm/router.ts:181–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179 }
180
181 listAvailableModels(): Array<{ provider: string; model: string; info: ModelInfo; local: boolean }> {
182 // Use the stored provider + model id directly instead of parsing index keys.
183 // The index holds each model under both `${provider}/${id}` and `${id}`, and an
184 // id can itself contain a '/' (e.g. LM Studio's `qwen/qwen3-coder-next`), so
185 // splitting the key produced bogus/truncated rows like `openai/qwen`.
186 const seen = new Set<string>();
187 const out: Array<{ provider: string; model: string; info: ModelInfo; local: boolean }> = [];
188 for (const val of this.modelIndex.values()) {
189 const provider = val.provider.name;
190 const model = val.info.id;
191 const tag = `${provider}/${model}`;
192 if (seen.has(tag)) continue;
193 seen.add(tag);
194 out.push({ provider, model, info: val.info, local: val.provider.isLocal });
195 }
196 return out;
197 }
198
199 resolveModel(modelId: string): { provider: Provider; modelInfo: ModelInfo; resolvedId: string } | null {
200 // Try exact match first

Callers 4

routeMethod · 0.95
index.tsFile · 0.80
BootSplashFunction · 0.80
WelcomeFunction · 0.80

Calls 3

addMethod · 0.80
hasMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected