Skip to content

refactor(ranker): split ranking helpers into focused modules - #145

Open
RaghavRD wants to merge 1 commit into
Andyyyy64:mainfrom
RaghavRD:refactor/ranker-split
Open

refactor(ranker): split ranking helpers into focused modules#145
RaghavRD wants to merge 1 commit into
Andyyyy64:mainfrom
RaghavRD:refactor/ranker-split

Conversation

@RaghavRD

@RaghavRD RaghavRD commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Move ranking orchestration, filters, quality scoring, source trust constants, and candidate variant selection into focused modules.

Keep whichllm.engine.ranker as a compatibility shim so existing public and test imports continue to work.

Refs #41

What

  • Move rank_models orchestration into whichllm.engine.ranking
  • Move model/profile/evidence filters into ranking_filters
  • Move quality scoring and family selection logic into ranking_score
  • Move source trust constants into ranking_sources
  • Move candidate GGUF/synthetic variant logic into ranking_variants
  • Preserve old imports through whichllm.engine.ranker

Why

This continues the #41 core-module refactor by splitting the large ranker module into focused pieces without changing the public import surface.

This is the penultimate major #41 refactor slice. After this, the remaining large core module is src/whichllm/cli.py.

Testing

  • Focused ranker/regression tests pass (74 passed)
  • CLI monkeypatch compatibility tests pass (6 passed)
  • Ruff check passes
  • Ruff format check passes
  • Full suite except environment-sensitive run smoke test passes (465 passed, 1 deselected)

Notes

Full pytest in my sandbox hit test_run_exits_gracefully because model fetching returned a DNS/network error message from the environment. The ranker-specific and compatibility coverage passes.

Move ranking orchestration, filters, quality scoring, source trust constants, and candidate variant selection into focused modules.

Keep whichllm.engine.ranker as a compatibility shim so existing public and test imports continue to work.

Refs Andyyyy64#41
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.

1 participant