Skip to content

Function: searchServingEndpoints()

searchServingEndpoints(input, endpoints, options?): ScoredEndpoint[]

Fuzzy-rank endpoints by how closely their name matches input, best (lowest score) first, keeping only those within threshold:

  1. An exact name match short-circuits to a single score: 0 result.
  2. Otherwise the input is tokenized (dashes / underscores / spaces become separators) and fed through Fuse.js extended search, which AND-s each token with fuzzy matching enabled - the “tokenized fuzzy match” a caller reaches for when they type "claude sonnet" instead of the full endpoint name.

Returns [] for an empty endpoint list or when input tokenizes to nothing, so callers fall back to the raw input and let Databricks surface a clean 404. This multi-result core is shared by resolveModelId (single best) and the ranked rankModels selector.

string

readonly object[]

ResolveModelOptions = {}

ScoredEndpoint[]