Skip to content

feat(shadow-eval): skip redundant reverse evaluations on opt-in - #52192

Merged
joshua-berri merged 5 commits into
mainfrom
litellm_skip_redundant_reverse_evaluations
Nov 17, 2026
Merged

joshua-berri merged 5 commits into
mainfrom
litellm_skip_redundant_reverse_evaluations

Conversation

@joshua-berri

@joshua-berri joshua-berri commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

  • Adds opt-in skip_same_model for reverse evaluations, disabled by default.
  • Skips shadow and judge calls when the routed model group matches the baseline, including aliases.
  • Records skips separately, with zero evaluation charges and no effect on ties or quality metrics.
  • Different model groups still evaluate. Existing jobs stay unchanged, and the baseline is never replaced.
Details

TLDR

Problem this solves:

  • Reverse evaluations can pay to compare the same model group.
  • Those comparisons contribute to quality metrics.

How it solves it:

  • Add an opt-in skip_same_model flag for reverse jobs.
  • Resolve aliases before comparing the group that served the request.
  • Count skips separately, without shadow calls, judges, or verdicts.
  • Keep existing jobs and different-group evaluations unchanged.

User Flow

Before, a reverse job evaluates requests already served by its baseline group.

  1. Start a reverse job with POST /auto_router/shadow_eval/start and a baseline model.
  2. Send a request to the configured auto-router.
  3. When it chooses the baseline group, the job still pays for shadow and judge calls.
  4. Fetch GET /auto_router/shadow_eval/{job_id} and see another judged sample.

After, an opted-in reverse job records the redundant sample as skipped.

  1. Start the same reverse job with skip_same_model: true.
  2. Send a request to the configured auto-router.
  3. When it chooses the baseline group, the job makes no shadow or judge calls.
  4. Fetch the job and see same_model_skipped_count increase, with no added verdict or spend.

The flag defaults to false. The existing dashboard form sends false explicitly to preserve its behavior and satisfy the generated request type. Different model groups still evaluate, including groups backed by the same provider model. Aliases resolving to the same group skip. The baseline is never replaced. Unknown served-group metadata conservatively keeps evaluation enabled. The policy compares model groups even when tier parameters differ.

Pre-Submission checklist

  • Added meaningful regression tests in the existing mapped files.
  • The three affected test files pass on Devin, as required by this jstack workflow. No local suites ran.
  • All applicable current-tip CI checks have completed.
  • The change is isolated to the requested opt-in skip policy.
  • Current-tip automated reviews have completed with no actionable concerns.

Type

New Feature

Caveats

Low

  • Old workers continue evaluating until upgraded.
  • The API exposes the policy. The UI has no toggle.
  • Funnel counters retain their existing advisory flush behavior.
  • Responses different-group traffic was unjudgeable on both tested commits.

The Responses limitation is pre-existing and unchanged in the matching run. It does not prove a successful different-group evaluation through that surface. Chat completions and Anthropic Messages do demonstrate that flow. No unrelated repair is included.

Screenshots / Proof of Fix

Baseline 49b2058c1a7ef71764fd756d1f091445071cabed. Current tip 3d7a83fa400d74430aec6c23d1c0e42fc7fe6bd4 passes independent live verification of matching groups, different groups, and the omitted flag. The full surface matrix passed at 2b2a1ca984b8e79c8effa9bf5a290b170cc4e246. Only the migration lock timeout changed afterwards. Current-tip checks report 106 success and two expected skips. Greptile rated the tip 5/5, and Bugbot and Veria found no issues.

Independent Devin verification ran source builds with two proxy workers, Redis, and PostgreSQL. At the current tip, the three mapped test files pass with 444 tests and the affected UI suite passes with 42 tests. Changed Python executable-line coverage is 33/33. Branches from changed Python lines are 12/12. These are changed-code figures, not repository-wide coverage. The one production TypeScript line is asserted by four payload tests but has no separate local line-coverage measurement. Codecov reports all modified coverable lines covered, and its current-tip patch check passes.

Ruff lint and source formatting, strict rules, type discipline, test quality, OpenAPI docs, basedpyright, and the MCP operation boundary passed at 9ff40fb65581472df4b92292192aae245d8256e1. Subsequent changes remove two extra blank lines, explicitly send the default false flag from the existing UI form, and add the required migration lock timeout. These gates also pass in current-tip CI. Generated API types and the lazy OpenAPI snapshot match. Applying the additive migration to the baseline schema matches the candidate schema, and a second apply is idempotent. No rows are rewritten. The migration starts with the required 10-second local lock timeout.

Baseline sensitivity ran the new tests from an external copy against the baseline. Seven skip tests failed because acompletion was called twice. They pass at the candidate. This demonstrates the unwanted calls, not just a missing configuration field.

Shared setup

The executed layout was ~/verif/shadow/{base,head,final,run,art}. The reusable Python environment was ~/repos/litellm/.venv. PostgreSQL was on port 5432 and Redis on port 6379. Required environment variables are ANTHROPIC_API_KEY, DATABASE_URL, LITELLM_MASTER_KEY, and LITELLM_SALT_KEY. Local run/master.key and run/salt.key held the latter two values. No values are included here.

Baseline used database shadow_base. Candidate used shadow_head, initialized with the baseline schema and then the new migration. The Prisma client for the candidate was generated from its schema outside tracked source into run/prisma_head and prepended to PYTHONPATH.

prisma db push --schema base/litellm/proxy/schema.prisma
psql "$DATABASE_URL_HEAD" --single-transaction -v ON_ERROR_STOP=1 -f final/litellm/proxy-extras/litellm_proxy_extras/migrations/20261116000000_shadow_eval_same_model_skip/migration.sql
prisma migrate diff --from-url "$DATABASE_URL_HEAD" --to-schema-datamodel final/litellm/proxy/schema.prisma --script

The baseline schema push was applied to each task database. The migration diff printed This is an empty migration.

Executed source builds and proxy commands
cd ~/verif/shadow
export DATABASE_URL="${DATABASE_URL%/*}/shadow_base"
CARGO_TARGET_DIR=$HOME/verif/shadow/cargo-target uv pip install --python ~/repos/litellm/.venv/bin/python --no-deps --target ~/verif/shadow/scratch --editable ~/verif/shadow/base > art/build_native.log 2>&1
cd ~/verif/shadow/head
CARGO_TARGET_DIR=$HOME/verif/shadow/cargo-target DATABASE_URL="${DATABASE_URL%/*}/shadow_base" uv pip install --python ~/repos/litellm/.venv/bin/python --target ../scratch-head --no-deps -e . > ../art/build_native_head.log 2>&1

The final worktree reused the native extension built at 9ff40fb6558. Subsequent changes do not touch native source. Both copies have SHA256 91a7a0e67647aeed52a8583198f77b093dd828cd1e5eb215b92621ab27e8402a.

Baseline start script

#!/bin/bash
cd ~/verif/shadow/base
export DATABASE_URL="${DATABASE_URL%/*}/shadow_base"; unset DIRECT_URL
export LITELLM_MASTER_KEY=$(cat ../run/master.key) LITELLM_SALT_KEY=$(cat ../run/salt.key) LITELLM_LOCAL_MODEL_COST_MAP=True
export PYTHONPATH="$PWD:$PWD/litellm/proxy-extras:$PWD/litellm/enterprise"
setsid nohup $HOME/repos/litellm/.venv/bin/python litellm/proxy/proxy_cli.py --config ../run/config_final.yaml --port 4310 --num_workers 2 --detailed_debug > ../art/proxy_base.log 2>&1 &
echo $! > ../run/proxy.pid

Final start script

#!/bin/bash
cd ~/verif/shadow/final
export DATABASE_URL="${DATABASE_URL%/*}/shadow_head"; unset DIRECT_URL
export LITELLM_MASTER_KEY=$(cat ../run/master.key) LITELLM_SALT_KEY=$(cat ../run/salt.key) LITELLM_LOCAL_MODEL_COST_MAP=True
export PYTHONPATH="$HOME/verif/shadow/run/prisma_head:$PWD:$PWD/litellm/proxy-extras:$PWD/litellm/enterprise"
setsid nohup $HOME/repos/litellm/.venv/bin/python litellm/proxy/proxy_cli.py --config ../run/config_final.yaml --port 4311 --num_workers 2 --detailed_debug > ../art/proxy_final.log 2>&1 &
echo $! > ../run/proxy_final.pid

Both logs confirmed two server workers. Reload was omitted to serve with two workers. The migration resolver flag was omitted because the schema was applied explicitly above.

Executed config_final.yaml
model_list:
  - model_name: haiku
    litellm_params:
      model: anthropic/claude-haiku-5-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: sonnet
    litellm_params:
      model: anthropic/claude-sonnet-5-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: sonnet-twin
    litellm_params:
      model: anthropic/claude-sonnet-5-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: judge
    litellm_params:
      model: anthropic/claude-opus-5-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: auto-mixed
    litellm_params:
      model: auto_router/complexity_router
      complexity_router_config:
        max_tokens_from_tier_model: clamp
        tiers:
          SIMPLE: haiku
          MEDIUM: haiku
          COMPLEX: sonnet
          REASONING: sonnet
  - model_name: auto-aliastier
    litellm_params:
      model: auto_router/complexity_router
      complexity_router_config:
        max_tokens_from_tier_model: clamp
        tiers:
          SIMPLE: sonnet-alias
          MEDIUM: sonnet-alias
          COMPLEX: sonnet-alias
          REASONING: sonnet-alias
  - model_name: auto-same
    litellm_params:
      model: auto_router/complexity_router
      complexity_router_config:
        max_tokens_from_tier_model: clamp
        tiers:
          SIMPLE: sonnet
          MEDIUM: sonnet
          COMPLEX: sonnet
          REASONING: sonnet
  - model_name: broken
    litellm_params:
      model: anthropic/claude-sonnet-5-5
      api_key: sk-ant-invalid-for-fallback-test
  - model_name: auto-fb
    litellm_params:
      model: auto_router/complexity_router
      complexity_router_config:
        max_tokens_from_tier_model: clamp
        tiers:
          SIMPLE: broken
          MEDIUM: broken
          COMPLEX: broken
          REASONING: broken

router_settings:
  fallbacks:
    - broken: [sonnet]
  model_group_alias:
    sonnet-alias: sonnet
    haiku-alias: haiku
  redis_host: 127.0.0.1
  redis_port: 6379

general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
  database_url: os.environ/DATABASE_URL
  coordination_redis:
    host: 127.0.0.1
    port: 6379

litellm_settings:
  drop_params: true

The deliberately invalid key on the unused fallback fixture is not a credential.

Executed matrix4.py with accounting completion checks

The script waits for a real spend log and exactly one attempt or funnel outcome per job, with the corresponding shadow and judge logs. Timeouts fail the run. The initial 12-second wait allows the documented 10-second job-cache TTL to expire. The script SHA256 is 5ada421a648ed4cfeffddbd9d754bca23d24b9275cb5370111dd466e22ebac5d.

"""Core live matrix for the reverse shadow-eval same-model skip.
usage: SIDE=base|final PORT=<proxy port> DBNAME=<postgres db> python matrix4.py out.json
env:   DATABASE_URL (any db on the same postgres server), LITELLM_MASTER_KEY; needs psql on PATH.
Exits 1 when a job does not reach full accounting or an outcome differs from the expectation for SIDE."""
import hashlib, json, os, subprocess, sys, time
import httpx

SIDE = os.environ["SIDE"]
B = f"http://127.0.0.1:{os.environ['PORT']}"
DB = os.environ["DATABASE_URL"].rsplit("/", 1)[0] + "/" + os.environ["DBNAME"]
H = {"Authorization": f"Bearer {os.environ['LITELLM_MASTER_KEY']}"}
c = httpx.Client(timeout=120)
PROMPT = "What is the capital of France?"
# shadow_eval_logger._JOBS_CACHE_TTL_SECONDS is 10: a started job reaches every worker's sampler within one TTL.
JOBS_CACHE_TTL_SECONDS = 10
ACCOUNTING_TIMEOUT_SECONDS = 240
CH, RE, ME = "/v1/chat/completions", "/v1/responses", "/v1/messages"
EVAL, SKIP, UNJ = "evaluated", "same_model_skip", "unjudgeable"
# name, endpoint, router, baseline_model, extra start fields, expected outcome on base, expected outcome on final
CASES = [
    ("same_chat", CH, "auto-same", "sonnet", {"skip_same_model": True}, EVAL, SKIP),
    ("same_responses", RE, "auto-same", "sonnet", {"skip_same_model": True}, UNJ, SKIP),
    ("same_messages", ME, "auto-same", "sonnet", {"skip_same_model": True}, EVAL, SKIP),
    ("diff_chat", CH, "auto-mixed", "sonnet", {"skip_same_model": True}, EVAL, EVAL),
    ("diff_responses", RE, "auto-mixed", "sonnet", {"skip_same_model": True}, UNJ, UNJ),
    ("diff_messages", ME, "auto-mixed", "sonnet", {"skip_same_model": True}, EVAL, EVAL),
    ("routed_alias_chat", CH, "auto-aliastier", "sonnet", {"skip_same_model": True}, EVAL, SKIP),
    ("baseline_alias_chat", CH, "auto-same", "sonnet-alias", {"skip_same_model": True}, EVAL, SKIP),
    ("flag_omitted_chat", CH, "auto-same", "sonnet", {}, EVAL, EVAL),
]


def payload(ep, model):
    if ep == RE:
        return {"model": model, "input": PROMPT, "max_output_tokens": 300}
    return {"model": model, "messages": [{"role": "user", "content": PROMPT}], "max_tokens": 300}


def q(sql):
    r = subprocess.run(["psql", DB, "-AtF", "|", "-c", sql], capture_output=True, text=True, check=True)
    return r.stdout.strip()


def logs(tok, origin):
    cond = "coalesce(metadata->>'internal_call_origin','')=''" if origin is None else f"metadata->>'internal_call_origin'='{origin}'"
    n, spend = q(f"select count(*), coalesce(round(sum(spend)::numeric,6),0) from \"LiteLLM_SpendLogs\" where api_key='{tok}' and {cond}").split("|")
    return int(n), float(spend)


def accounting(job_id, tok):
    outcomes = [o for o in q(f"select a.outcome from \"LiteLLM_ShadowEvalAttempt\" a join \"LiteLLM_ShadowEvalJob\" j on j.id=a.job_id where j.group_id='{job_id}'").split("\n") if o]
    funnel = json.loads(q(f"select to_jsonb(f)-'job_id' from \"LiteLLM_ShadowEvalFunnel\" f join \"LiteLLM_ShadowEvalJob\" j on j.id=f.job_id where j.group_id='{job_id}'") or "{}")
    return {"attempts": outcomes, "funnel": funnel, "real": logs(tok, None), "shadow": logs(tok, "shadow_eval_router"), "judge": logs(tok, "shadow_eval_judge")}


def complete(a):
    """One request per job: its real spend log is persisted, the request is accounted for by exactly one attempt row
    or one funnel counter, and every attempt row has its shadow and judge spend logs persisted."""
    n = len(a["attempts"])
    return a["real"][0] == 1 and n + sum(a["funnel"].values()) == 1 and a["shadow"][0] == n and a["judge"][0] == n


def outcome(a):
    if a["attempts"]:
        return EVAL
    if a["funnel"].get("same_model"):
        return SKIP
    if a["funnel"].get("unjudgeable"):
        return UNJ
    return "other:" + json.dumps(a["funnel"])


out = {}
keys = {}
for name, ep, router, base, extra, exp_base, exp_final in CASES:
    r = c.post(B + "/key/generate", headers=H, json={"key_alias": f"shadow-{name}-{int(time.time())}"}).json()
    keys[name] = r["key"]
    tok = r.get("token") or hashlib.sha256(r["key"].encode()).hexdigest()
    body = {"api_key_ids": [tok], "router_name": router, "direction": "reverse", "baseline_model": base,
            "shadow_percentage": 100, "judge_model": "judge", "max_budget": 1.0, **extra}
    j = c.post(B + "/auto_router/shadow_eval/start", headers=H, json=body)
    assert j.status_code == 201, (name, j.status_code, j.text[:300])
    out[name] = {"start_request": {k: v for k, v in body.items() if k != "api_key_ids"}, "job_id": j.json()["job_id"],
                 "tok": tok, "expected": exp_base if SIDE == "base" else exp_final}
time.sleep(JOBS_CACHE_TTL_SECONDS + 2)
for name, ep, router, *_ in CASES:
    r = c.post(B + ep, headers={"Authorization": f"Bearer {keys[name]}"}, json=payload(ep, router))
    assert r.status_code == 200, (name, r.status_code, r.text[:300])
    out[name]["request"] = {"endpoint": ep, "payload": payload(ep, router), "status": r.status_code,
                            "headers": {k: v for k, v in r.headers.items() if k in ("x-litellm-model-group", "x-litellm-attempted-fallbacks", "x-litellm-response-cost", "x-litellm-complexity-router-tier")}}
deadline = time.time() + ACCOUNTING_TIMEOUT_SECONDS
pending = set(out)
while pending and time.time() < deadline:
    for name in sorted(pending):
        a = accounting(out[name]["job_id"], out[name]["tok"])
        if complete(a):
            out[name]["accounting"] = a
            pending.discard(name)
    if pending:
        time.sleep(2)
failed = False
print(f"SIDE={SIDE}")
print("| case | endpoint | call_type group->routed_model | expected | observed | shadow calls / $ | judge calls / $ | attempts | funnel | API: attempt_count / spend / judged_count / judge_spend / tie% | same_model_skipped_count |")
print("|---|---|---|---|---|---|---|---|---|---|---|")
for name, v in out.items():
    tok = v.pop("tok")
    if name in pending:
        failed = True
        print(f"| {name} | {v['request']['endpoint']} | - | {v['expected']} | INCOMPLETE {json.dumps(accounting(v['job_id'], tok))} | | | | | | |")
        continue
    a = v["accounting"]
    real = q(f"select call_type||' '||model_group||'->'||coalesce(metadata->'routing_decision'->>'routed_model','(none)') from \"LiteLLM_SpendLogs\" where api_key='{tok}' and coalesce(metadata->>'internal_call_origin','')=''")
    d = c.get(B + f"/auto_router/shadow_eval/{v['job_id']}", headers=H).json()
    t = d["targets"][0]
    res = d.get("results") or {}
    v.update(real=real, observed=outcome(a), detail=d)
    failed = failed or v["observed"] != v["expected"]
    api = f"{t.get('attempt_count')} / {t.get('spend')} / {d.get('judged_count')} / {d.get('judge_spend')} / {res.get('overall_tie_rate_pct')}"
    print(f"| {name} | {v['request']['endpoint']} | {real} | {v['expected']} | {v['observed']} | {a['shadow'][0]} / ${a['shadow'][1]} | {a['judge'][0]} / ${a['judge'][1]} | {len(a['attempts'])} ({','.join(a['attempts'])}) | {json.dumps(a['funnel'])} | {api} | {d.get('same_model_skipped_count', '(absent)')} |")
json.dump(out, open(sys.argv[1], "w"), indent=1, default=str)
print("RESULT", "FAIL" if failed else "PASS")
sys.exit(1 if failed else 0)

Before (49b2058)

  1. Run the baseline proxy above.
  2. Execute SIDE=base PORT=4310 DBNAME=shadow_base python run/matrix4.py art/matrix4_base.json.
  3. Observe RESULT PASS for the baseline expectations below.
Flow Shadow calls Judge calls Attempt rows Outcome
Chat, matching group 1 1 1 Judged tie
Messages, matching group 1 1 1 Judged tie
Responses, matching group 0 0 0 Unjudgeable
Chat or Messages, different group 1 1 1 Judged tie
Responses, different group 0 0 0 Unjudgeable
Routed alias or baseline alias, chat 1 1 1 Judged tie
Flag omitted, matching group, chat 1 1 1 Judged tie

After (4a683d6)

  1. Run the final proxy above.
  2. Execute SIDE=final PORT=4311 DBNAME=shadow_head python run/matrix4.py art/matrix4_final.json.
  3. Observe RESULT PASS for the final expectations below.
Flow Shadow calls Judge calls Attempt rows Skip count
Chat, matching group 0 0 0 1
Messages, matching group 0 0 0 1
Responses, matching group 0 0 0 1
Chat or Messages, different group 1 1 1 0
Responses, different group 0 0 0 0
Routed alias or baseline alias, chat 0 0 0 1
Flag omitted, matching group, chat 1 1 1 0

Skipped cases have zero evaluation spend, zero judged samples, and same_model: 1 in the funnel. Evaluated final cases measured $0.000172 for the shadow and $0.003088 for the judge. These are observed run costs, not fixed vendor-price assertions.

Additional cases for distinct groups sharing a provider model, mixed skipped/judged traffic, an explicit false flag, and forward jobs passed at 9ff40fb6558. Python evaluation code is identical at the final tip. Those cases used the earlier Sonnet judge and were not rerun with the Opus judge. Mixed traffic kept the quality denominator at one judged sample and reported the two skips separately.

Final-tip refresh

At 3d7a83fa400d74430aec6c23d1c0e42fc7fe6bd4, Devin ran the same two-worker source proxy with the same config and latest-family provider models. run/matrix5.py is the client above with this filter after the CASES definition.

CASES = [x for x in CASES if x[0] in ("same_chat", "diff_chat", "flag_omitted_chat")]
SIDE=final PORT=4311 DBNAME=shadow_head python run/matrix5.py art/matrix5_tip3d7a.json

The command returned RESULT PASS. Matching groups produced zero shadow calls, zero judge calls, zero attempts, zero evaluation spend, and one skip. Different groups and the omitted flag each produced one shadow call, one judge call, and one judged attempt with no skips. The observed shadow and judge costs were $0.000172 and $0.003088 respectively.

The final migration passed against a scratch database with the baseline schema using psql --single-transaction -v ON_ERROR_STOP=1. The timeout was 10s inside the transaction and 0 after commit. A second application skipped the existing columns successfully. Schema comparison was empty. A failing statement in the same transaction rolled back both new columns. This tested PostgreSQL transactions directly, not the proxy migration resolver.

Exact-tip focused test commands
cd ~/verif/shadow/final
export PYTHONPATH="$PWD:$PWD/litellm/proxy-extras:$PWD/litellm/enterprise"
export COVERAGE_FILE=$HOME/verif/shadow/art/.coverage_3d7a
~/repos/litellm/.venv/bin/python -m coverage run --branch --include='litellm/integrations/shadow_eval_logger.py,litellm/proxy/db/shadow_eval_funnel.py,litellm/proxy/management_endpoints/auto_router_endpoints.py,litellm/types/management_endpoints/auto_router_endpoints.py' -m pytest tests/unit/integrations/test_shadow_eval_logger.py tests/unit/proxy/db/test_shadow_eval_funnel.py tests/unit/proxy/management_endpoints/test_auto_router_endpoints.py -p no:cacheprovider -q
cd litellm/ui/litellm-dashboard
npx vitest run "src/app/(dashboard)/cost-optimization/_components/ShadowEvalSection.test.tsx"

Both exit zero, with 444 backend tests and 42 UI tests passed. The UI typecheck and build also passed in CI. Existing UI lint warnings occur in unchanged test lines and the build's existing AVIF asset warning is unchanged.

Final Attestation

  • All current-tip CI and required automated reviews have finished without unresolved in-scope concerns.

…erved

A reverse shadow eval judges the router's response against baseline_model.
When the router itself sent the request to the baseline's model group, the
comparison only produces ties and still pays for a shadow and a judge call.

Reverse jobs can now opt in with skip_same_model. A sampled request whose
served group (router alias resolved, fallback hops respected) is the
baseline's own group is counted in a new same_model funnel stage instead of
being judged. It makes no provider calls, writes no attempt row, and leaves
max_turns and the eval budget untouched. When the served group is unknown
the sample is judged as before. The job detail reports
same_model_skipped_count even when nothing has been judged yet.

The flag defaults to false and is rejected on forward jobs, so existing
jobs and requests behave exactly as before. Adds two columns through an
additive, schema-only migration.
…n signals

Judged cases now wait on the attempt write the injected prisma reports,
then await the pipeline task that made it. Skip cases drain only the tasks
the hook created, through a task factory scoped to the hook call, before
asserting that no provider call, attempt row, or spend was recorded. This
replaces a whole-loop task diff and the assertion on the number of tasks.

Adds a skip case with tier parameter overrides, which the policy still
treats as the same group, and a case showing a lost sampling roll counts as
not_sampled before same_model. Drops the class docstring claim that a same
group comparison only produces ties.
@joshua-berri
joshua-berri requested a review from a team November 17, 2026 02:49
@veria-ai

veria-ai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@joshua-berri

Copy link
Copy Markdown
Contributor Author

@greptile

@joshua-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge with no actionable findings.

Summary

Adds opt-in skip_same_model support for reverse shadow evaluations. Matching model groups skip shadow and judge calls, while separate counters keep skips out of verdict rates.

The latest change adds a ten-second lock timeout to the schema migration. No actionable new issues or confirmed repository-rule violations were found. No previous Greptile threads were supplied.

  • Reverse shadow jobs skip samples already served by their baseline group.
  • Shadow-eval job details report skipped samples separately.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Sampled reverse request] --> B{Skip enabled and baseline group served?}
  B -->|Yes| C[Count same-model skip]
  B -->|No or unknown| D[Run shadow evaluation]
  D --> E[Judge responses]
  C --> F[Report skip count separately]
  E --> G[Report verdict rates]
Loading

Reviews (3) · Last reviewed commit: "fix(migrations): bound shadow evaluation..." · Reviewed by Greptile

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

The generated request type now requires skip_same_model, which broke the
dashboard typecheck and builds. The form sends false, the API default, so
jobs started from the UI behave exactly as before.
@joshua-berri

Copy link
Copy Markdown
Contributor Author

@greptile

@joshua-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@joshua-berri

Copy link
Copy Markdown
Contributor Author

@greptile

@joshua-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 3d7a83f. Configure here.

@codspeed

codspeed Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 2 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 45 untouched benchmarks


Comparing litellm_skip_redundant_reverse_evaluations (3d7a83f) with main (43d6b45)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (d1fb532) during the generation of this report, so 43d6b45 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@joshua-berri
joshua-berri merged commit 9e81aa3 into main Nov 17, 2026
114 checks passed
@joshua-berri
joshua-berri deleted the litellm_skip_redundant_reverse_evaluations branch November 17, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants