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)
- Declare
sentence-transformers as a runtime dependency; or
- Provide an extra (e.g.
xrouter-llm[st]) and document that the default model needs it; or
- Ship a default model that uses the
TfidfSvdEncoder (no torch).
Repro
The default predictor returned by
default_model_path()uses aSentenceTransformerembedding backend. On the firstroute()call the encoder lazily doesfrom sentence_transformers import SentenceTransformer(encoders.py), which raises:Cause
sentence-transformers(and itstorchdependency) is not declared anywhere inxrouter-llm's dependencies — the package only requireshuggingface-hub, joblib, numpy, pandas, pyyaml, scikit-learn, scipy, and exposes only adevextra. 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)
sentence-transformersas a runtime dependency; orxrouter-llm[st]) and document that the default model needs it; orTfidfSvdEncoder(no torch).