Skip to main content

30 posts tagged with "engineering"

View All Tags

JevRank: decision models through LiteLLM’s rerank API

Ishaan Jaffer
CTO, LiteLLM
LiteLLMPREVIEW / OCTOBER 2026

JevRank

Decision models
for reranking

Turn Perplexity and TypeSafe decision models into rerankers. Keep your query, your documents and your LiteLLM endpoint.

JevRank builds on the decision-model reranking research of Jakob Gruber at Swietelsky AG.

DECISION MODELSTypeSafe JevPerplexity
01 / INPUTQuery + passagesquery, documents[]02 / TRANSFORMJevRankprobabilities → scores03 / OUTPUTRanked passagesindex, relevance_score
Read the benchmark Try the preview QUERY + DOCUMENTS → RELEVANCE SCORES
01BENCHMARK

Benchmark results

In a SciFact reference benchmark, Perplexity Flash and Cohere Rerank 4 Pro both scored 0.775 nDCG@10. Their projected costs were $73 versus $2,500 per million queries, about 34× lower for Flash.

Reference benchmark
Four reference configurations, ordered by reranking cost from lowest to highest. Quality uses a zero-to-one nDCG@10 scale. Projected cost uses a zero-to-2,500 USD scale per million queries.
Model Method and result originRanking quality nDCG@10 · higher is betterReranking cost USD / 1M queries · lower is better
Perplexity Decider Flash v1.2 (JevRank)Lowest reference costMultiple choice Reference
nDCG at 10:
Quality ↑0.775
Projected reranking cost per million queries:
Cost / 1M queries ↓$73
Perplexity Decider v1.2 (JevRank)Multiple choice Reference
nDCG at 10:
Quality ↑0.777
Projected reranking cost per million queries:
Cost / 1M queries ↓$146
TypeSafe Jev 1.14 (JevRank)Per document Reference
nDCG at 10:
Quality ↑0.776
Projected reranking cost per million queries:
Cost / 1M queries ↓≈$580
Cohere Rerank 4 ProRerank API Reference
nDCG at 10:
Quality ↑0.775
Projected reranking cost per million queries:
Cost / 1M queries ↓$2,500

SciFact · 300 queries · 20 candidates · October 2026. Reference results via OpenRouter. Flash costs $73 versus Cohere Pro’s $2,500 per million queries, about 34× lower. These are reference results, not our LiteLLM run.

Costs exclude gateway overhead; Jev 1.14 is projected from a rounded per-1K cost. Small score gaps do not establish a quality win.

Our SciFact benchmark

We ran 6,000 document decisions through LiteLLM with Jev 1.13.0. On the same BM25 candidates, nDCG@10 improved from 0.686 to 0.768, at an estimated $0.575 per 1,000 queries.

All 300 queries completed. We measured 0.50 s median latency and 1.15 s at p95, with eight calls in flight per query. Jev placed a relevant document first for 68% of queries, compared with 55% for BM25.

LiteLLM benchmark
Two results measured by LiteLLM: TypeSafe Jev 1.13.0 and the local BM25 baseline. Quality uses a zero-to-one nDCG@10 scale. Projected cost uses a zero-to-2,500 USD scale per million queries.
Model Method and result originRanking quality nDCG@10 · higher is betterReranking cost USD / 1M queries · lower is better
TypeSafe Jev 1.13.0 (JevRank)Per document LiteLLM run
nDCG at 10:
Quality ↑0.768
Projected reranking cost per million queries:
Cost / 1M queries ↓≈$575
BM25Local retrieval LiteLLM run
nDCG at 10:
Quality ↑0.686
Projected reranking cost per million queries:
Cost / 1M queries ↓No rerank calls

SciFact · 300 queries · 20 BM25 candidates per query. Measured through LiteLLM. Jev’s cost is estimated from reported tokens and excludes gateway overhead. BM25 adds no reranking calls.

The reference run’s retrieval settings and candidate identity were not verified to match this run.

Cost vs. ranking qualityDownload figure
Quality (nDCG@10) ↑Hollow: reference Solid: LiteLLM run
View exact chart data
Cost vs. ranking quality for all six configurations. Quality is nDCG at10; costs are USD per million queries.
Model and methodOriginnDCG@10Cost / 1M
Perplexity Decider Flash v1.2 (JevRank)Multiple choiceReference0.775$73
Perplexity Decider v1.2 (JevRank)Multiple choiceReference0.777$146
TypeSafe Jev 1.14 (JevRank)Per documentReference0.776≈$580
Cohere Rerank 4 ProRerank APIReference0.775$2,500
TypeSafe Jev 1.13.0 (JevRank)Per documentLiteLLM run0.7676260618846087≈$575.39426
BM25Local retrievalLiteLLM run0.6863002612489066No rerank calls

Both axes start at zero. Lines connect labels to their actual data points. Reference and measured candidate protocols may differ. BM25 has no reranking calls; retrieval itself is not asserted to be free.

Reference results via OpenRouter; solid points are our LiteLLM run. Costs exclude gateway overhead. The 34× comparison applies only to reference Flash versus reference Cohere Pro; nearby scores do not establish a quality win.

Recorded examples Improvement, unchanged ranking and regression
02EXAMPLES

Recorded examples

Recorded · Jev 1.13.0

Explore three saved queries, including an improvement, an unchanged first result and a regression. The scores come from our benchmark. These controls make no model calls.

QUERY 702

Localization of PIN1 in the roots of Arabidopsis does not require VPS9a

First relevant result: #3
  1. 1
    Local, Efflux-Dependent Auxin Gradients as a Common Module for Plant Organ Formation

    Plants, compared to animals, exhibit an amazing adaptability and plasticity in their development. This is largely dependent on the ability of plants to form new organs, such as lateral roots, leaves, and flowers during postembryonic…

    Document 16557565
  2. 2
    A molecular framework for plant regeneration.

    Plants and some animals have a profound capacity to regenerate organs from adult tissues. Molecular mechanisms for regeneration have, however, been largely unexplored. Here we investigate a local regeneration response in Arabidopsis roots.…

    Document 38675228
  3. 3
    Generation of cell polarity in plants links endocytosis, auxin distribution and cell fate decisionsJudged relevant · SciFact

    Dynamically polarized membrane proteins define different cell boundaries and have an important role in intercellular communication—a vital feature of multicellular development. Efflux carriers for the signalling molecule auxin from the PIN…

    Document 4350400
  4. 4
    The rice FISH BONE gene encodes a tryptophan aminotransferase, which affects pleiotropic auxin-related processes.

    Auxin is a fundamental plant hormone and its localization within organs plays pivotal roles in plant growth and development. Analysis of many Arabidopsis mutants that were defective in auxin biosynthesis revealed that the indole-3-pyruvic…

    Document 19950357
  5. 5
    The WUSCHEL-related homeobox gene WOX11 is required to activate shoot-borne crown root development in rice.

    In rice (Oryza sativa), the shoot-borne crown roots are the major root type and are initiated at lower stem nodes as part of normal plant development. However, the regulatory mechanism of crown root development is poorly understood. In…

    Document 20402596
0.46 s · $0.51 estimated / 1K queries at this query’s length

SciFact labels evidence relevance, including supporting and refuting evidence. The model’s scores can disagree with those judgments. Download these examples ↗

03 / SCORING

How JevRank works

Follow one recorded TypeSafe Jev request from input to ranking. We show three of the 20 passages from SciFact query 702.

Recorded query: Localization of PIN1 in the roots of Arabidopsis does not require VPS9a

  1. Input index 0: Local, Efflux-Dependent Auxin Gradients as a Common Module for Plant Organ Formation. Jev relevance score 0.14; output rank 2.
  2. Input index 1: A molecular framework for plant regeneration.. Jev relevance score 0.12; output rank 3.
  3. Input index 2: Generation of cell polarity in plants links endocytosis, auxin distribution and cell fate decisions. Jev relevance score 0.39; output rank 1.

Recorded · TypeSafe Jev 1.13.0 · Scroll to follow the passage

01

Send a query and documents

Call LiteLLM’s rerank API with your query and candidate passages. Keep their input order: you will use these indexes to find each document in the response.

Follow index 2, the passage about cell polarity. It starts third in this recorded request.

01 / Inputquery + documents[]
QUERY 702

Localization of PIN1 in the roots of Arabidopsis does not require VPS9a

TypeSafe Jev 1.13.0
documents[0]
Local, Efflux-Dependent Auxin Gradients as a Common Module for Plant Organ Formation
documents[1]
A molecular framework for plant regeneration.
documents[2]Follow this passage
Generation of cell polarity in plants links endocytosis, auxin distribution and cell fate decisions
Original indexes: [0, 1, 2]3 of 20 passages shown
02

Score each document

For TypeSafe Jev, LiteLLM asks the same relevance question for each passage. Jev returns a probability for each answer.

Jev assigned index 2 a score of 0.39, compared with 0.14 and 0.12 for the other two passages. These independent scores do not need to sum to one.

02 / ScoreP(relevant) per passage
QUERY 702

Localization of PIN1 in the roots of Arabidopsis does not require VPS9a

TypeSafe Jev 1.13.0
documents[0]
Local, Efflux-Dependent Auxin Gradients as a Common Module for Plant Organ Formation
0.14score
documents[1]
A molecular framework for plant regeneration.
0.12score
documents[2]Follow this passage
Generation of cell polarity in plants links endocytosis, auxin distribution and cell fate decisions
0.39score
Original indexes: [0, 1, 2]Score scale: 0–1
03

Return the ranked indexes

LiteLLM sorts the scores from highest to lowest and returns relevance_score with the original index. You can retrieve the matching text from your input documents.

Index 2 now ranks first. The next two results are indexes 0 and 1. The response keeps each document’s identity after the order changes.

03 / Rankindex + relevance_score
QUERY 702

Localization of PIN1 in the roots of Arabidopsis does not require VPS9a

TypeSafe Jev 1.13.0
index: 2Follow this passage
Generation of cell polarity in plants links endocytosis, auxin distribution and cell fate decisions
0.39score
Rank 1
index: 0
Local, Efflux-Dependent Auxin Gradients as a Common Module for Plant Organ Formation
0.14score
Rank 2
index: 1
A molecular framework for plant regeneration.
0.12score
Rank 3
Returned order: [2, 0, 1]Score scale: 0–1

Recorded example, no model calls. Scores describe the model’s assessment of relevance. They do not establish whether the query’s claim is true. Inspect the saved query and all 20 results ↗

Score meaning and failures

A model can compare candidates in one choice question or assess each document against the query. Choice probabilities belong to the supplied candidate set; scores from separate batches do not share a scale.

Provider errors and refusals fail the request. LiteLLM sends the full input and returns an error if it exceeds provider limits. Perplexity accepts 2 to 255 documents in one choice question. TypeSafe assesses documents in parallel; the rerank response reports their combined token usage.

04PREVIEW

Setup and usage

Preview PR ↗

Use JevRank through your AI Gateway or call it from Python. These examples require the preview branch; no released version includes the adapter yet. For this preview, set LITELLM_LOCAL_MODEL_COST_MAP=True to load the branch’s model catalog.

Set PERPLEXITY_API_KEY in your gateway environment. Add this deployment, then send a rerank request with your gateway URL and LiteLLM key.

01 / GATEWAY CONFIGURATION
config.yaml
model_list:
- model_name: jevrank-flash
litellm_params:
model: perplexity/pplx-decider-flash-v1.2
api_key: os.environ/PERPLEXITY_API_KEY

Start the gateway with litellm --config config.yaml --port 4000.

02 / RERANK REQUEST
request.sh
curl "$LITELLM_BASE_URL/rerank" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jevrank-flash",
"query": "How long is the warranty?",
"documents": [
"Shipping takes three days.",
"Warranty coverage lasts two years."
],
"top_n": 1
}'

Set LITELLM_BASE_URL to your gateway URL and LITELLM_API_KEY to your gateway key.

The TypeSafe preset pins Jev 1.14; our measured run used Jev 1.13.0. Evaluate the version you deploy.

05METHODOLOGY

Benchmark methodology

LiteLLM run

We ran all 300 SciFact test queries with 20 fixed BM25 candidates per query through SDK commit 5aa0a8304c. All 6,000 judgments completed with returned version jev-1.13.0.

BM25s 0.3.13 used Lucene BM25, k1=1.5, b=0.75, English stop words and Snowball stemming over titles and full abstracts. Median rerank latency was 0.50 s; p95 was 1.15 s with eight calls in flight. Returned tokens imply $0.172618 total at the configured gateway rate, an estimate rather than an invoice.

Reference experiment

Jakob Gruber’s October 2026 reference experiment at Swietelsky AG used the same SciFact split and candidate count, with calls through OpenRouter. Retrieval settings and candidate identity may differ from our run. We could not access Perplexity or Cohere for our benchmark.

The 34× comparison belongs to reference Flash versus Cohere Pro: $73 versus $2,500 per million queries and 0.775 nDCG@10 for both. Its paired tests found no significant quality difference. Costs cover reranking and depend on model rates and input length.

How LiteLLM Lens finds repeated failures across 1,000s of agent traces

Moe Khalil
AI Product Engineer, LiteLLM

A research agent can finish a report after reading the first 8,000 characters of each page. If its web tool cuts off a source and the agent fills in the gaps, you get a completed run with unsupported claims.

Across thousands of runs, you need to find the affected sessions and what they have in common. LiteLLM Lens uses agents to do that work.

Here's how it works behind the scenes: reviewers inspect executions in parallel, grouping agents connect related observations, and investigators check each candidate pattern against the original traces.

How we built our own internal Devin in 2 days

Tin Lo
AI Product Engineer, LiteLLM

How we built our own internal Devin in 2 days

Our team's cloud coding agent, built with Render and Temporal.

Our internal Devin, running in the cloud.
Published:
Tin LoAI Product Engineer, LiteLLM

At BerriAI, we built Moyai Devin, an internal engineering agent that runs in the cloud. Teammates can give it a task in Slack, follow its progress in a web app, and ask it to prepare a pull request.

How we cut LiteLLM's Redis round trips per request by 64%

Yassin Kortam
Senior SWE @ LiteLLM

LiteLLM's 22 Redis round trips merge into 8, a 64% reduction per request

This week, we cut the number of times a request to the LiteLLM proxy waits on Redis from 22 to 8.

A request from a key with a budget, in a team with a budget and TPM/RPM limits, against a model group with usage-based routing and a Redis response cache, made 22 Redis round trips: 12 before the model was called and 10 after. The same request, with the same checks and the same writes, now makes 5 before and 3 after.

JEV Classifier: 5.43x as Fast as Haiku, 96% Lower Cost

Moe Khalil
AI Product Engineer, LiteLLM

Last Updated: September 18, 2026

An Auto Router pays for classification before the selected model can answer. In our benchmark, TypeSafe JEV classified requests 5.43x as fast as Haiku, comparing median classifier latency: 126.81 ms versus 688.40 ms. Registry-priced classifier cost was 96.12% lower, rounded to 96% in the title

JEV matched our benchmark's expected tiers on 95.00% of calls, versus 73.75% for Haiku. That result depends on the prompts, tier definitions, instructions and context used here. The expected tiers were authored with the synthetic prompts, without independent review. This comparison does not establish general classification accuracy or the quality of the final answers

Auto-Router: Switching Tiers Without Encrypted Content Failures

Tin Lo
AI Product Engineer, LiteLLM

Auto-Router can move a conversation between tiers as the request changes from simple work to a harder task. Responses API clients can make that switch difficult because a previous response may include encrypted reasoning content that only the deployment that created it can decrypt

LiteLLM now keeps the readable history and removes encrypted reasoning that the newly selected tier cannot verify. The request can continue to the selected model instead of failing with invalid_encrypted_content

This fix is included in the LiteLLM v1.102.x release line and landed in PR #40280

How Pfizer Improved LiteLLM Gateway Performance and Resiliency at Scale

Ishaan Jaffer
CTO, LiteLLM
Krrish Dholakia
CEO, LiteLLM
Yassin Kortam
Senior SWE @ LiteLLM
Pfizer AI Platform Engineering
Pfizer AI Platform Engineering
Pfizer AI Platform Engineering
Pfizer AI Platform Engineering
Pfizer AI Platform Engineering

LiteLLM x Pfizer

A joint debugging story with LiteLLM, and the release testing that comes next.

A LiteLLM version bump exposed a long-standing Redis configuration bug that cut Pfizer's gateway throughput by ~48%, with zero HTTP errors in the application logs. Here's how the team isolated it through configuration bisection, and the testing infrastructure both teams are building to catch this class of regression before it ships.

51% Cost Savings Reported From a Live Production Deployment

Tin Lo
AI Product Engineer, LiteLLM

You can expect roughly 40% cost reductions from day one with the Auto Router, and more as the tier maps are tuned. One of our production users shared their statistics to show what that looks like at scale.

They rolled out the Auto-Router to 450+ users across dev, staging, and prod instances and saved $12,249 over 270k+ requests.

Production traffic recorded 51% cost-savings with the Auto-Router

Benchmarking the LiteLLM Rust AI Gateway: Overhead, Memory, and Cost

Ishaan Jaffer
CTO, LiteLLM

Last Updated: July 2026

We are launching an early beta of the LiteLLM AI Gateway in Rust, and we built AIGatewayBench to measure it against Portkey, Bifrost, and the current LiteLLM Python proxy. Across all four, the LiteLLM Rust gateway has the lowest p99 added latency and the smallest memory footprint by a wide margin: roughly 7x lower overhead and 9x less memory than the next-closest gateway (Bifrost), the lowest cost footprint, and the fastest whole-session times for coding agents. It holds its own on raw sustained throughput and pulls decisively ahead on overhead, memory, and cost.

Migrating LiteLLM to Rust - Building the Fastest and Litest AI Gateway

Ishaan Jaffer
CTO, LiteLLM

Last Updated: June 2026

Over the past year, we have heard the same thing from our users and our community: they want the fastest, most lightweight AI gateway they can run. We have heard you. We are addressing it by moving LiteLLM to Rust, and committing to sub-1ms overhead with a sub-100MB memory binary you can deploy. By the end of this migration, you will get a pure Rust server that can serve 100% of your AI traffic, with every hot path operation, including auth and rate limiting, running in Rust.

Want to help us build it?

We are opening an early beta and want to work directly with teams who care about a fast, lightweight gateway. If that is you, sign up here and we will get you testing the Rust gateway in your own stack, with a direct line to our team.

The reason it matters: under real load, CPU and memory climb with concurrency, and pods get OOM-killed at the worst time. Today the LiteLLM Python proxy peaks around 359MB of memory under load, and that cost multiplies across every pod, region, and retry you run.

We are already seeing the payoff in benchmarks. The Rust gateway serves about 15x the throughput (453 to 6,782 requests per second) on about 11x less memory (359MB to 32MB), and cuts per-request overhead from about 7.5ms on the Python path to about 0.05ms, well under the 1ms we commit to.

What you get​

You deploy a single Rust binary. It uses about 65MB of memory, gateway overhead stays under 1ms, and nothing in your setup changes: same config.yaml, same database, same client API, same providers. You keep LiteLLM's coverage of 100+ LLM providers behind one OpenAI-compatible API, with /chat/completions, /messages, /responses, and every other LLM endpoint LiteLLM supports today, now as the fastest and most lightweight LLM gateway you can self-host.

This is not a v2 and not a rewrite. There is no new major version to migrate to and nothing for you to change. The runtime under the hot path gets faster and lighter while your config stays exactly where it is.

We ship this the careful way. Each route moves to Rust only after it passes our full parity and end-to-end test suite, and it runs in production before the next route starts. Stability is the priority, and we target zero regressions on every release.

How we built a background agent to cover 30% of our backlog

Krrish Dholakia
CEO, LiteLLM
Ishaan Jaffer
CTO, LiteLLM
LiteLLM Agent Platform: agent.litellm.ai
info

The platform we built is open source. Check out litellm-agent-platform. The swappable harness layer is lite-harness.

Building the same thing inside your company?

Our goal was to 10x the productivity of our company with agents.

Three weeks ago we began building an agent that could own 30% of our engineering tickets. Here's what we've learnt so far.

Making the AI Gateway Resilient to Redis Failures

Ishaan Jaffer
CTO, LiteLLM

Last Updated: April 2026

Enterprise AI Gateway deployments put Redis in the hot path for nearly every request: rate limiting, cache lookups, spend tracking. When Redis is healthy, the latency contribution is single-digit milliseconds, invisible to end users. When it degrades, a production AI Gateway needs to stay up regardless.

Running LiteLLM at scale across 100+ pods means designing for failure modes before they appear. The easy case is Redis going fully down: fail fast, fall through to the database, continue serving requests. The hard case, the one that takes down gateways, is a slow Redis: still accepting connections, still responding, but timing out after 20-30 seconds per operation.