refactor(cli): split command helpers into focused modules - #162
Open
RaghavRD wants to merge 1 commit into
Open
Conversation
Move command bodies, validation, hardware overrides, model lookup, runtime script generation, and shared CLI utilities into focused modules. Keep whichllm.cli as the Typer entry point and compatibility shim so existing public and test imports continue to work. Complete the remaining large core-module split for Andyyyy64#41.
|
Ran the branch rather than read it. The split is behavior-preserving in the executable sense, with one thing worth restoring before merge. Setup: clean clone, Windows 11, Python 3.14.7,
--- merge-base
+++ e0f66ed
- For each GPU passed on the command line, simulate a system with the same
- CPU/RAM but that GPU, run the ranker, and show the best-N models you'd
- be able to run. Useful for answering "is upgrading from a 3090 to a 4090
- worth it?" — the table shows the quality jump and the speed jump for
- each option.That last point is the one ask: the move trimmed several multi-paragraph rationale docstrings ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No worries at all, and thanks for taking the time to review it.
I really appreciate you retesting it across Python 3.11, 3.12, and 3.13 and updating it against current main. I’ve opened the final #41 refactor slice for
src/whichllm/cli.pyas followsMove command bodies, validation, hardware overrides, model lookup, runtime script generation, and shared CLI utilities into focused modules.
Keep
whichllm.clias the Typer entry point and compatibility shim so existing public and test imports continue to work.What
whichllm.cli_commandswhichllm.cli_modelswhichllm.cli_sharedwhichllm.cli_validationwhichllm.cliWhy
This completes the remaining large core-module split for #41. After the previous constants, display, fetcher, benchmark, and ranker splits,
src/whichllm/cli.pywas the last large core module left.Testing
95 passed)484 passed)Notes
uv runis currently blocked locally because this repo now requiresuv ==0.11.33while my localuvis0.11.17, so I ran verification through the existing.venv:.venv/bin/python -m compileall -q src/whichllm.venv/bin/python -m pytest -q tests/test_cli.py.venv/bin/python -m pytest -q.venv/bin/python -m ruff check ..venv/bin/python -m ruff format --check .