Skip to content

Add caching to model list route#1588

Merged
deep1401 merged 7 commits intomainfrom
add/model-list-cache
Mar 20, 2026
Merged

Add caching to model list route#1588
deep1401 merged 7 commits intomainfrom
add/model-list-cache

Conversation

@deep1401
Copy link
Copy Markdown
Member

No description provided.

@paragon-review
Copy link
Copy Markdown

Paragon Review Skipped

Hi @deep1401! Your Polarity credit balance is insufficient to complete this review.

Please visit https://home.polarity.cc to add more credits and continue using Paragon reviews.

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!



@router.get("/model/list")
@cached(key="models:list:{embedding}", ttl="7d", tags=["models", "models:list"])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be one we can't put a long TTL on because you can add models via SDK?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The models via sdk get added in the job only now. And you need to manually save it to registry right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so the ModelsLocalList right now is only called on the View Models component to check if a model with a similar name exists or not.
This is still fine I believe if the caching is long because the only time we'd add a model to the models list would be through save to registry?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I might not understand this now. So if you do a lab.save_model (or whatever the call is) that doesn't go to the team's model list? That just saved for the job and you have to use the UI to save to the model list?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we used to save it directly to model list earlier but now it goes to a separate place and you have to sort of promote it to be a model

@deep1401 deep1401 merged commit 09ed977 into main Mar 20, 2026
7 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