Add model benchmarking and cleanup examples - #716
Open
KhanN-byte wants to merge 1 commit into
Open
Conversation
KhanN-byte
marked this pull request as ready for review
August 8, 2026 20:37
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.
What changed
examples/benchmark.pyto compare installed models using median time to first token, total duration, load duration, prompt throughput, and generation throughput.examples/modelDetection.pyto list installed models and their reported storage usage, select models interactively, and remove them after explicit confirmation.Why
These examples make it easier to understand local model performance on a particular machine and safely manage disk space used by installed models.
User impact
The changes add standalone examples only and do not alter the Ollama Python client API. Model removal is never performed without the user typing
yesat the confirmation prompt.Validation
pytest -q ollama tests: 98 passedruff check examples/benchmark.py examples/modelDetection.py: passedruff format --check examples/benchmark.py examples/modelDetection.py: passedpython3 -m py_compile examples/benchmark.py examples/modelDetection.py: passedqwen3.5:4b