Skip to content

Function: rankModels()

rankModels(endpoints, query?): object[]

Rank the live catalogue against a ModelQuery, best-first.

Candidates are the classified endpoints in the eligible classes: classesAtOrBelow the requested modelClass, or - when none is given

  • the chat bands only (CHAT_CLASS_ORDER), so a general ask never surfaces an embedding endpoint. Each class bucket is already best-first from classify.classifyEndpoints. Ranking is match then class:
  1. With a search, only endpoints matching it survive, ordered by match distance (bucketed via matchBucket so near-identical scores tie), then by class (more capable first), then by the stable within-class rank.
  2. Without a search, the class-then-rank candidate order stands.

A limit truncates the result. Returns [] when nothing is eligible or matches - callers layer their own fallback.

readonly object[]

number = ...

ChatThinking | ChatBalanced | ChatFast | Embedding = ...

boolean = ...

string = ...

number = ...

object[]