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

Method listModels

app/src/utils/ModelManager.ts:206–223  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

204 * List all models from all sources (remote + local)
205 */
206 public listModels(): ModelsResponse {
207 const localModels = this.getLocalModels();
208
209 // Sort: local models first, then user-managed servers, then Observer cloud, then skip model last
210 const sortedModels = [...this.remoteModels, ...localModels].sort((a, b) => {
211 const aScore = a.server === ModelManager.SKIP_MODEL ? 3
212 : this.isLocalModel(a.server) ? 0
213 : a.server.includes('api.observer-ai.com') ? 2
214 : 1;
215 const bScore = b.server === ModelManager.SKIP_MODEL ? 3
216 : this.isLocalModel(b.server) ? 0
217 : b.server.includes('api.observer-ai.com') ? 2
218 : 1;
219 return aScore - bScore;
220 });
221
222 return { models: sortedModels };
223 }
224
225 /**
226 * Get local models converted to the unified Model format.

Callers 13

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

Calls 2

getLocalModelsMethod · 0.95
isLocalModelMethod · 0.95

Tested by

no test coverage detected