Skip to content

Model Selection Queries #416

@bosconian-dynamics

Description

@bosconian-dynamics

I'm not too familiar with AI Horde yet and I've only recently begun reading up on the TOP 10 debate, and the need for NEW N etc., but it all makes me wonder if support for a more robust model query logic might be favorable. It seems like the list of desirable "meta instruction" selectors could continue to expand, and it could be convenient to facilitate combinations of criteria (e.g. TOP 10 NEW SMALL NONXL SFW, as an extreme).

This could take the form of an esoteric query language - perhaps even derived from the current meta instructions. But I can't think of a reason to not support a structured query object directly, given that should a query language come to be it would likely make sense to parse it into such an object to pass as an input to consolidated selection/filtration logic, anyway.

In my head, it looks something like this (albeit some fairly convoluted examples):

# "<=25 most popular non-xl, non-SD2 SFW models this month, smaller than 4GB a piece"
- query:
    ref.size_on_disk_in_bytes:
      lt: 4000000000
    ref.baseline:
      not:
        - "stable_diffusion_xl"
        - "stable diffusion 2"
    ref.nsfw: false
  limit: 25
  orderby:
    stats.generations.month: "DESC"

# "<=100GB total of the smallest models in the reference under 3gb a piece"
- query:
    ref.size_on_disk_in_bytes:
      lt: 3000000000
  limit:
    ref.size_on_disk_in_bytes: 100000000000
  orderby:
    ref.size_on_disk_in_bytes: "ASC"

# "All the ponies"
- query:
    ref.name:
      pattern: "\b[Pp]ony"

# "The 11th-25th least popular models in use which are either XL, NSFW, anime-styled, or any combination of the three"
- query:
    or:
      ref.baseline: "stable_diffusion_xl"
      ref.nsfw: true
      ref.style: "anime"
    stats.generations.month:
      gt: 0
  limit: 15
  offset: 10
  orderby:
    stats.generations.month: "ASC"

This was inspired by #382 and #353, and would be one means of pretty directly facilitating the objective stated in #267. It doesn't diminish the need for or utility of meta instructions, but may simplify implementation of more complex instructions moving forward in exchange for some added complexity for the near future. I think it may have some limited potential in enabling workers to provide more adaptive model selections in response to changing conditions, as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions