Skip to content

Feature request: Type-to-search model picker for Telegram #23610

@freqyfreqy

Description

@freqyfreqy

Feature Description

Replace the paginated inline-keyboard model picker in Telegram with a type-to-search picker. Instead of scrolling through pages of model names, the user types part of a model name and gets filtered results.

Motivation

The /model picker currently uses a paginated inline keyboard with max_models per page. This breaks down for providers with large catalogs:

  • Nvidia has 136 models (confirmed via live API). Even with a live-fetch fix, that's 28 pages of keyboard navigation at 5 per page.
  • OpenRouter has hundreds. Copilot's catalog is tier-dependent and growing.
  • The curated list pattern exists because the picker UX can't handle large lists — it's a UX workaround that became policy.

A search-based picker eliminates the need for curation. Show everything, let the user filter.

Proposed Solution

Flow:

  1. /model → "Reply with a model name to search"
  2. User types nemeon
  3. Hermes fuzzy-matches against the full provider catalog (via live fetch_models())
  4. Returns top N matching results as inline keyboard buttons
  5. User taps one → model switch confirmed

Technical approach (Option A — stateful text input):

After /model, the gateway registers a temporary search state per chat. The next text message is captured as the query, fuzzy-matched, and results are returned as inline keyboard. State auto-expires after 60 seconds or on successful selection.

Technical approach (Option B — Telegram inline queries):

Uses Telegram's @botname query... inline query pattern. Type-as-you-search with real-time results. Requires gateway-level support for inline query handling via InlineQueryHandler.

Existing infrastructure:

  • Fuzzy matching exists in models.py:resolve_model_name() via difflib.get_close_matches
  • The ProviderProfile.fetch_models() call already returns full catalogs (tested: 136 models from Nvidia)

Alternatives Considered

  1. Status quo (curated list) — manual maintenance forever, users miss newly added models. Already known to be fragile ([Bug] _PROVIDER_MODELS["xai"] is stale — grok-4.20-reasoning renamed; broader fragility from hardcoded provider lists #16699, /model picker uses static Copilot list, ignores live catalog — newer/tier-gated models invisible #22990).
  2. Live fetch + bigger pages — still terrible UX for 136+ models. Pagination doesn't scale.
  3. Provider-level filtering first — pick provider, then pick model. Helps but doesn't solve the core problem for big single-provider catalogs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliveryplatform/telegramTelegram bot adaptertype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions