MCPcopy Create free account
hub / github.com/Roy3838/Observer / listModels

Method listModels

app/src/utils/ModelManager.ts:194–211  ·  view source on GitHub ↗

* List all models from all sources (remote + local)

()

Source from the content-addressed store, hash-verified

192 * List all models from all sources (remote + local)
193 */
194 public listModels(): ModelsResponse {
195 const localModels = this.getLocalModels();
196
197 // Sort: local models first, then user-managed servers, then Observer cloud, then skip model last
198 const sortedModels = [...this.remoteModels, ...localModels].sort((a, b) => {
199 const aScore = a.server === ModelManager.SKIP_MODEL ? 3
200 : this.isLocalModel(a.server) ? 0
201 : a.server.includes('api.observer-ai.com') ? 2
202 : 1;
203 const bScore = b.server === ModelManager.SKIP_MODEL ? 3
204 : this.isLocalModel(b.server) ? 0
205 : b.server.includes('api.observer-ai.com') ? 2
206 : 1;
207 return aScore - bScore;
208 });
209
210 return { models: sortedModels };
211 }
212
213 /**
214 * Get local models converted to the unified Model format.

Callers 12

fetchModelsMethod · 0.95
sendPromptMethod · 0.95
notifyListenersMethod · 0.95
sendMessagesMethod · 0.95
sendToolMessagesMethod · 0.95
getCustomServerModelsFunction · 0.80
handleToggleFunction · 0.80
fetchModelsFunction · 0.80
lookupModelFunction · 0.80
getServerForModelFunction · 0.80
listModelsFunction · 0.80
registry.tsFile · 0.80

Calls 2

getLocalModelsMethod · 0.95
isLocalModelMethod · 0.95

Tested by

no test coverage detected