Skip to content

rag_jina_reranker_v1_tiny_en

Runs jina-reranker-v1-tiny-en locally in a preloaded background worker and exposes SQL rerank scores and distances.

pgrag · Runs jina-reranker-v1-tiny-en locally in a preloaded background worker and exposes SQL rerank scores and distances.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100256rag_jina_reranker_v1_tiny_enpgrag0.0.0RAGApache-2.0Rust

PostgreSQL · 13, 14, 15, 16, 17, 18

Relationships
Requiresvector

Usage

Sources:

rag_jina_reranker_v1_tiny_en runs the 33-million-parameter jina-reranker-v1-tiny-en model locally and exposes scalar and batch reranking scores or distances. It is deprecated and no longer maintained.

Core Workflow

The model executes in a background worker, so preload the library and restart PostgreSQL before creating the extension:

shared_preload_libraries = 'rag_jina_reranker_v1_tiny_en.so'
CREATE EXTENSION vector;
CREATE EXTENSION rag_jina_reranker_v1_tiny_en;

SELECT rag_jina_reranker_v1_tiny_en.rerank_distance(
    'What did the quick brown fox jump over?',
    'The quick brown fox jumps over the lazy dog'
);

On macOS, the upstream instructions use .dylib instead of .so in shared_preload_libraries.

SQL API

  • rag_jina_reranker_v1_tiny_en.rerank_score(text, text) returns one score; the text[] overload returns scores in input order.
  • rag_jina_reranker_v1_tiny_en.rerank_distance(text, text) returns one distance; the text[] overload returns distances in input order.
  • For every overload, distance equals negative score. Lower distance therefore corresponds to a higher score.

Operational Notes

The reviewed version is 0.0.0, non-relocatable, requires vector, and sets superuser = true. The worker starts with PostgreSQL and lazy-loads the model at first use, so account for first-call latency and memory use. Default builds embed the ONNX model; the optional remote_onnx build downloads it after restart and should point to controlled storage. The project pins patched ONNX Runtime components and is archived and deprecated, so deploy a fixed, tested artifact and plan a replacement.

Table reader