Skip to content

preserve cached maia model when download URL changes#231

Merged
kevinjosethomas merged 2 commits into
mainfrom
claude/optimize-onnx-download-sR01t
Feb 24, 2026
Merged

preserve cached maia model when download URL changes#231
kevinjosethomas merged 2 commits into
mainfrom
claude/optimize-onnx-download-sR01t

Conversation

@kevinjosethomas
Copy link
Copy Markdown
Collaborator

@kevinjosethomas kevinjosethomas commented Feb 24, 2026

  • when the model source URL changes (e.g. switching from /public to GitHub raw), existing users with a cached model were forced to re-download ~93MB because the old code compared URLs and deleted mismatches
  • adds a modelVersion field so cache invalidation is version-based, and URL-only changes just update the stored metadata in-place without re-downloading
  • if the metadata update fails, the cached model is still returned so users are never forced to re-download

Instead of deleting the cached model and forcing a ~93MB re-download
when the source URL changes, update the stored URL in-place and return
the existing cached data. The model binary is identical regardless of
which URL served it.

https://claude.ai/code/session_01T73Yphu4y2U3c3ctCcHVPf
- Version mismatch → delete cache, force re-download (new model)
- URL-only change with same version → keep cache, update stored URL
- Existing users without a version field get the cache preserved
  (the `modelData.version &&` guard handles this gracefully)

To force all clients to re-download, bump NEXT_PUBLIC_MAIA_MODEL_VERSION
(or the hardcoded default in MaiaEngineContext.tsx).

https://claude.ai/code/session_01T73Yphu4y2U3c3ctCcHVPf
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
maia-platform-frontend Ready Ready Preview, Comment Feb 24, 2026 11:18pm

Request Review

@kevinjosethomas kevinjosethomas changed the title Preserve cached Maia model when URL changes preserve cached maia model when download URL changes Feb 24, 2026
@kevinjosethomas kevinjosethomas merged commit ec2291b into main Feb 24, 2026
4 of 6 checks passed
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.

2 participants