Skip to main content

apply_query

Function apply_query 

Source
pub fn apply_query(models: Vec<Model>, query: &ModelListQuery) -> Vec<Model>
Expand description

Apply a ModelListQuery to a model list, returning a filtered and sorted copy.

§Filter rules

  • min_params/max_params: model’s param_count_b must fall within the range (inclusive).
  • min_context/max_context: model’s context_length must fall within the range when it is set. Models without a context length are not excluded by a context range filter.
  • quantizations: model’s quantization must match one of the listed values. Models with no quantization are excluded when this filter is active.
  • tags: model must have all listed tags (AND semantics).
  • min_speed/max_speed: model’s benchmark_summary.latest_tg_tps must be within the range. Models with no benchmark data are excluded when either speed bound is active.

§Sort behaviour

Default: AddedAt Desc (most recently added first). When sorting by LatestTgTps, models without benchmark data sort last in both ascending and descending orders.