inference
rank
Rank passages against a query.
strata inference rankdb.ai.rank(query: 'str', passages: 'Sequence[str]', *, model: 'str') -> 'Any'wire inference_rank
Scores each candidate passage against a query with a ranking model and returns one outcome per passage. Each item carries the passage's original index and either a relevance score or a per-item error with a stable code and a redacted message, so callers can reorder passages by score while keeping them tied to their inputs. Ranking is a local-only operation: it requires a build with the local execution feature and a ranking-capable model.
To see the complete help for this command, run:
strata inference rank --helphelp(db.ai.rank)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Model spec. |
| request | RankRequest | yes | Ranking request. |
Returns
RankResponse
- dataRankResponse
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| not_found.engine.branch | never | not_applicable |
| inference.unsupported_operation | never | not_applicable |
| inference.missing_model | after_state_change | not_applicable |
| inference.model_load_failed | after_state_change | not_applicable |
| inference.local_runtime_failed | unknown | not_applicable |
| inference.registry_corrupt | never | not_applicable |