• Stefy Lanza (nextime / spora )'s avatar
    perf: gate cache scans on a cheap dir-mtime signature (only re-scan on change) · 0bc9ba76
    Stefy Lanza (nextime / spora ) authored
    Capability detection is already name-based (microsecond-fast), so caching it
    wouldn't help — the real cost is huggingface_hub.scan_cache_dir() + the per-file
    size sums walking the whole cache. So instead of re-walking on a TTL, the
    cached-models/cache-stats layer now computes a cheap change-signature (the names +
    mtimes of the top-level model dirs/files — a handful of stat() calls) and only does
    the expensive scan when that signature changes. Unchanged caches return the last
    result instantly and never re-walk; a change refreshes in the background. A long
    600s backstop TTL still re-scans occasionally. Mutating ops reset the signature.
    
    Net: the models page is instant on every load and the background refresh only runs
    when models are actually added/removed/downloaded.
    
    Verified: unchanged signature → 0 rescans; changed signature → one background rescan.
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_011DDv7BchtZQWsnPG6Jm49m
    0bc9ba76
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...
video_editor.config.json Loading commit data...