llama-index-selectors-jev
Drop-in JevSingleSelector / JevMultiSelector for LlamaIndex routers: typed tool / query-engine choice with TypeSafe Jev, without an LLM-as-judge.
Full story, reranker package, and benchmark numbers: llama-index-jev.
pip install llama-index-selectors-jev
export TYPESAFE_API_KEY=... # or pass api_key= to the selector
# OpenRouter (optional): export OPENROUTER_API_KEY=... and
# JevSingleSelector(provider="openrouter")
Usage
from llama_index.core.tools import ToolMetadata
from llama_index.selectors.jev import JevSingleSelector
selector = JevSingleSelector()
result = selector.select(
[
ToolMetadata(name="weather", description="Forecasts and current conditions"),
ToolMetadata(name="docs", description="Product documentation lookup"),
],
"Will it rain in Paris tomorrow?",
)
print(result.ind, result.reason)
JevSingleSelector plugs into RouterQueryEngine:
from llama_index.core.query_engine import RouterQueryEngine
from llama_index.selectors.jev import JevSingleSelector
engine = RouterQueryEngine(
selector=JevSingleSelector(),
query_engine_tools=[weather_tool, docs_tool],
)
See examples/basic_selector.py
and examples/router_query_engine.py
(examples README).
The checked-in walkthroughs use provider="openrouter" and need OPENROUTER_API_KEY.
Design
Fail closed
Wrong routing is worse than slightly-worse ranking. If the API errors, if
Jev returns a choice that is not in the option set, or if confidence is
below confidence_threshold, JevSingleSelector raises — unless you
set default_index, in which case that one selection is returned with a
reason that names both the fallback and the error.
This is TypeSafe's "don't act when uncertain." A low-confidence but in-schema choice is treated as failure, not as success.
Single vs multi
JevSingleSelectorasks oneChoicequestion whose option names are the tool names (when those names are unique). The model sees names and descriptions, not opaqueoption_0labels.JevMultiSelectorasks oneNoulper option in a singlesystem_onecall (the query is the whole state, so batching questions is correct). Options withnoul > thresholdare kept, in original order.
If there are more than 255 options, the multi-selector splits the question map across calls of at most 255 keys. That is the only 255-chunking in this repo; it is a safety cap on question-map size, not a rerank batch size.
Multi-select never returns an empty list
If zero Nouls clear threshold, JevMultiSelector returns exactly the
highest-noul choice. An empty selection would leave a router with
nothing to call. default_index is not used for this case — it is
API-error fallback only.
Metadata
Release files for llama-index-selectors-jev 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_selectors_jev-0.1.1.tar.gz | 8.2 kB | Without provenance | Details for llama_index_selectors_jev-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_selectors_jev-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for llama_index_selectors_jev-0.1.1-py3-none-any.whl |
Total release size: 18.2 kB
Release files / llama_index_selectors_jev-0.1.1.tar.gz
| Download URL | llama_index_selectors_jev-0.1.1.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39b0dcfca795736e504fdada13e933da9bd8043ff0cbf924571f0935a5798f1c
|
|
BLAKE2b-256 checksum How to use checksums |
c450cb44f8a1318277cc517dc0f77a06f3e37bb379e2f762cc94381ddbdcfaec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_selectors_jev-0.1.1-py3-none-any.whl
| Download URL | llama_index_selectors_jev-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30169185040059c1bb2e085736cc9e866374b3dc7bedaad3bb87bf24ecb60f64
|
|
BLAKE2b-256 checksum How to use checksums |
bbad21d77e56cb2d6b7c0f8fe1d50bf5f5764f7f305ddc5aa52df2f799a596c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-selectors-jev 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.