fix(gpt4all): discover existing model directory (#30) - #222
Conversation
|
CI is red on all Windows jobs (py3.9–py3.12) in Root cause: Fix: sort by the plain string name instead of the for path in sorted(self._models_dir.iterdir(), key=lambda p: p.name):That keeps ordering consistent (case-sensitive, platform-independent) across OSes. Once that's in, CI should go green on Windows too. Generated by Claude Code |
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
Implements GPT4All local model discovery: Gpt4AllRuntime now scans its _models_dir (defaulting to ~/.cache/gpt4all), reports availability based on the directory's existence, and returns a ModelRef for each top-level .gguf/.bin file, while downloads and loads still raise RuntimeUnavailableError. Adds a gpt4all_models_dir setting wired through env/TOML config and threaded from ModelManager into RuntimeRegistry.get via a new models_dir argument that sets _models_dir on runtimes that expose it.
No blocking issues surfaced. 4 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 224 functions depend on the 137 functions this change touches.
Health — this change adds coupling hotspots:
- new:
ModelManager— 32 callers, 23 callees - new:
Settings— 29 callers, 3 callees - new:
load_settings()— 14 callers, 6 callees - new:
_manager()— 21 callers, 3 callees - new:
_manager()— 10 callers, 3 callees - new:
Gpt4AllRuntime— 3 callers, 5 callees - new:
_register_builtins()— 1 callers, 6 callees
Verification — 224 functions in the blast radius were not formally verified this run (proofs are advisory here).
Health delta baseline: last indexed commit 5a9ff06 (diverged from this PR's base — delta is approximate).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 224 function(s) in the blast radius were not formally verified this run
· 2 grounded finding(s) anchored inline below; 5 more finding(s) on lines outside this diff (see the check run).
|
🎉 Congratulations @Deepnar! Your pull request has been successfully merged into main. 🚀 Thank you for contributing to OpenAgentHQ and helping improve the project. We truly appreciate your contribution and hope to see you back with more amazing PRs! Happy Open Sourcing! ❤️ |
Summary
Adds configurable discovery of models already present in a GPT4All models directory for issue #30.
Changes
gpt4all_models_dirconfiguration withMODELDOCK_GPT4ALL_MODELS_DIRenvironment support.ModelManagerandRuntimeRegistrytoGpt4AllRuntime..ggufand.binfiles as installedModelRefvalues without downloading or loading models.Testing
.venv/bin/pytest -q tests/unit/test_gpt4all_runtime.py tests/unit/test_config.py— 27 passed.venv/bin/pytest -q tests/unit— 499 passed.venv/bin/ruff check src tests— passed.venv/bin/ruff format --check src tests— passed.venv/bin/mypy src— passed for 79 source files.venv/bin/bandit -r src— no issues identifiedChecklist
fix/gpt4all-model-directory)mainAGENT.mdcoding standardsdomain/andports/stay pureCloses #30.