Skip to content

Default bundled router model requires sentence-transformers, but it isn't a declared dependency #10

Description

@rogercloud

Repro

pip install xrouter-llm==0.1.1
# build the default RoutingService from default_model_path(), then call route()

The default predictor returned by default_model_path() uses a SentenceTransformer embedding backend. On the first route() call the encoder lazily does from sentence_transformers import SentenceTransformer (encoders.py), which raises:

ModuleNotFoundError: No module named 'sentence_transformers'

Cause

sentence-transformers (and its torch dependency) is not declared anywhere in xrouter-llm's dependencies — the package only requires huggingface-hub, joblib, numpy, pandas, pyyaml, scikit-learn, scipy, and exposes only a dev extra. So the bundled default model cannot actually run after a clean install.

Impact

Any downstream consumer following the documented install gets a router that throws on the first real route.

Suggested fix (any of)

  1. Declare sentence-transformers as a runtime dependency; or
  2. Provide an extra (e.g. xrouter-llm[st]) and document that the default model needs it; or
  3. Ship a default model that uses the TfidfSvdEncoder (no torch).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions