/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
routefm
Опубликована
29 сен 2026

RouteFM

Ранжирование текстаТекст → score

RouteFM ранжирует заданные модели-кандидаты для маршрутизации запроса на основе контекстных наблюдений об их качестве и относительной стоимости.

63скачиваний за 30 дней2лайкавеса обновлены3 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

RouteFM — разработанная Гуаннанем Лаем и Хань-Цзя Е из Нанкинского университета предварительно обученная модель-маршрутизатор для выбора LLM из заданного пула кандидатов. Она использует эмбеддинг целевого запроса и контекстные наблюдения о качестве и относительной стоимости кандидатов, чтобы предсказать их пригодность для этого запроса. Модель адаптируется к новой среде через контекст без обновления параметров и не использует явные идентификаторы провайдеров или моделей.

Опубликованы два варианта: RouteFM-Qwen с 12 781 059 параметрами для совместного текстового и визуального запроса и RouteFM-BGE с 11 070 467 параметрами для текста. Архитектура включает 24 токена профиля возможностей, скрытый размер 256 и permutation-equivariant Transformer. Эмбеддеры запросов — внешние замороженные компоненты, не входящие в репозиторий; для работы нужен совместимый энкодер или сервис эмбеддингов.

Модель предназначена для исследований маршрутизации запросов между пользовательскими моделями-кандидатами. Она ранжирует их по предсказанному качеству и относительной стоимости, но сама кандидатов не вызывает и не генерирует эмбеддинги. Стоимость не является калиброванной оценкой денег или задержки; каждому кандидату нужно хотя бы одно корректное наблюдение в контексте. Результаты могут меняться в зависимости от энкодера, языка, предметной области, пула кандидатов и размера контекста. Лицензия — Apache-2.0.

Сценарии применения

  • выбор LLM для нового запроса из заданного пула кандидатов
  • адаптация маршрутизатора к новой среде по примерам качества моделей
  • сравнение кандидатов по ожидаемому качеству ответа
  • исследование маршрутизации с учетом относительной стоимости моделей

Ограничения

Нужны совместимый внешний энкодер запросов и хотя бы одно валидное контекстное наблюдение для каждого кандидата; оценка стоимости относительная и не калибрована в деньгах или задержке. Качество может меняться при смене энкодера, языка, области, пула моделей и размера контекста.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

RouteFM: Pretrain Once, Route Anywhere

Pretrain Once, Route Anywhere: Towards a Foundation Model for LLM Routing Guannan Lai and Han-Jia Ye · Nanjing University

GitHub · Paper · PDF

RouteFM overview

RouteFM is a pretrained in-context model router. Given an anonymous candidate pool, behavioral observations of candidate quality and relative cost, and a new target query, it predicts the target-specific quality and relative cost of every candidate. A frozen RouteFM adapts to new routing environments through context alone, without target-domain parameter updates.

On MMR-Bench, which is excluded from pretraining, RouteFM outperforms the strongest non-RouteFM baseline by 2.23 quality points with only eight observations per candidate.

Model description

RouteFM turns LLM routing from repeated local fitting into global routing pretraining. Candidate identities, providers, parameter counts, and other explicit identity features are never exposed to the router. Instead, it:

  1. builds a compact capability profile for every anonymous candidate from behavioral context;
  2. retrieves complementary evidence from both the profile and the original observations for each target query;
  3. compares the current pool jointly with a permutation-equivariant Transformer; and
  4. predicts target-specific quality and relative cost.

RouteFM architecture

The released architecture uses 24 capability tokens, hidden dimension 256, and episodic pretraining with candidate-slot permutation. The training objective combines point prediction, pairwise ranking, and routing regret. See the paper for the complete method.

Released variants

VariantCompatible query encoderDimensionQuery modalityParameters
RouteFM-QwenQwen3-VL-Embedding-8B4096Joint text and image12,781,059
RouteFM-BGEBAAI/bge-base-en-v1.5, CLS pooling768Text only11,070,467

Each variant contains a canonical model.safetensors and config.json. The legacy/ directory contains the exact PyTorch checkpoint bytes from the GitHub v1.0.0 release. manifest.json records sizes, configurations, immutable revisions, and SHA-256 digests.

The query encoders are frozen external feature extractors. They are not included in this repository, and RouteFM is not a fine-tune of either encoder. Users must obtain the encoders or compatible embedding services separately and comply with their licenses and access terms.

Usage

Install the official package directly from GitHub:

python -m pip install git+https://github.com/LAMDA-Model-Reuse/RouteFM.git

The package downloads the correct safetensors checkpoint from the immutable Hub artifact revision, validates its SHA-256 digest, and stores it in the standard Hugging Face cache.

routefm-predict --encoder qwen --input my_episode.npz \
  --output predictions.json --device cpu

To prefetch both released variants for offline jobs:

routefm-download --encoder all

The input schema, embedding instructions, observation masks, local checkpoint overrides, and output format are documented in docs/CUSTOM_DATA.md.

Training

Both variants were trained from random initialization in one continuous 10,000-update run. All router modules were trained jointly, while the external query encoder remained frozen. The configured pretraining mixture is LLMRouterBench 45%, RouterBench 25%, RouterEval 25%, and MixInstruct 5%. MMR-Bench is not a pretraining source.

The complete data contract, source proportions, episode construction, curriculum, and optimization commands are available in docs/PRETRAINING.md. Underlying third-party datasets and embedding models are not redistributed.

Evaluation

The paper evaluates the frozen Qwen-based RouteFM on held-out RouterEval queries and on cross-modal transfer to MMR-Bench.

EvaluationK=8K=16K=32K=64Large
RouterEval (in-domain)0.61920.64330.66270.6611—
MMR-Bench (cross-modal)0.73230.74570.74870.75040.7614

These are the paper's matched-protocol results. MMR-Bench uses dataset-wise five-fold context/target splits in the limited-observation setting and a 40%/60% split in the large-observation setting. RouteFM remains frozen and uses no evaluation labels for parameter updates.

The GitHub release additionally publishes a fixed seed-31010 split for artifact auditing. That split is retrospective and post-selected, differs from the paper's five-fold protocol, and should not be compared directly with the table above. Its exact IDs, hashes, aggregation rules, and reference outputs are documented in docs/MMRBENCH_V1.md.

Intended use and limitations

RouteFM is intended for research on routing among a user-supplied candidate pool with observed context outcomes. It does not call candidate models, generate query embeddings, or establish that a candidate is safe or suitable.

  • Candidate order and embedding family must remain consistent within an episode.
  • Each candidate needs at least one valid context observation.
  • Predicted cost is relative, not a calibrated monetary or latency estimate.
  • The default decision rule ignores predicted cost and selects maximum predicted quality.
  • Performance may change across encoder revisions, languages, domains, candidate pools, and context sizes outside the training distribution.

License

RouteFM source code and released routing weights are licensed under Apache-2.0. Third-party assets retain their own licenses and terms; see THIRD_PARTY_NOTICES.md.

Citation

If you use RouteFM in your research, please cite:

@misc{lai2026pretrainoncerouteanywhere,
  title         = {Pretrain Once, Route Anywhere: Towards a Foundation Model for LLM Routing},
  author        = {Guannan Lai and Han-Jia Ye},
  year          = {2026},
  eprint        = {2609.37362},
  archivePrefix = {arXiv},
  primaryClass  = {cs.AI},
  url           = {https://arxiv.org/abs/2609.37362}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · routefm

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
8ab96a8

0 моделей