Jev Reranker (Rust CLI)
Rust JSON-in/JSON-out CLI that asks Jev about relevance, usable evidence, or which source text to retain, then applies the resulting order and thresholds in code.
# Jev Reranker
[](https://github.com/shinpr/jev-reranker/actions/workflows/ci.yml)
[](LICENSE)
Choose the search results worth passing to your LLM.
`jev-reranker` uses TypeSafe AI's [Jev](https://docs.typesafe.ai/introduction) to rerank retrieved
documents, remove candidates that contain no usable evidence, or extract query-specific passages
for your LLM.
It reads a JSON array from stdin and writes a JSON array to stdout. Choose the field that contains
the text; IDs, source paths, retrieval scores, and other metadata pass through unchanged. Use it
after BM25, vector search, or any command that emits a JSON array of candidate objects.
```text
search or vector database -> JSON candidates -> Jev Reranker -> context for your LLM
```
## Install
Requires Node.js 14 or later on macOS, Linux, or Windows (x64 or Arm64).
Install the CLI from npm:
```sh
npm install --global jev-reranker
```
You can also run it without a global installation:
```sh
npx -y jev-reranker --help
```
Create an API key in the [TypeSafe dashboard](https://console.typesafe.ai/), then export it:
```sh
export TYPESAFE_API_KEY="your-api-key"
```
## Try It
Pipe an array of candidate documents into the CLI:
```sh
printf '%s\n' '[{"text":"Build artifacts are cached locally."},{"text":"Access tokens expire after one hour."}]' \
| jev-reranker --query "How long do access tokens last?"
```
The CLI returns the same objects in best-first order, with a `rerankScore` from 0 to 1 added to
each one. Higher values mean Jev considers the result more relevant to the query.
## Bring Your Own Results
Suppose a search command returns objects shaped like this:
```json
[
{
"id": "auth-guide",
"title": "Authentication",
"body": "Access tokens expire after one hour.",
"distance": 0.18,
"s