[Core, Controller] Add `pin` to controller
Support pin(instance_id: str, tokens: List[int], ttl: Optional[float]).
TODO:
- [ ] Make global view in controller consistent with cache expiration (might need a periodic sweeper to do this).
PR Checklist (Click to Expand)
Thank you for your contribution to LMCache! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]for bug fixes.[CI/Build]for build or continuous integration improvements.[Doc]for documentation fixes and improvements.[Model]for adding a new model or improving an existing model. Model name should appear in the title.[Core]for changes in the core LMCache logic (e.g.,LMCacheEngine,Backendetc.)[Misc]for PRs that do not fit the above categories. Please use this sparingly.
Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
- Pass all linter checks. Please use
format.shto format your code. - The code need to be well-documented to ensure future contributors can easily understand the code.
- Please include sufficient tests to ensure the change is stay correct and robust. This includes both unit tests and integration tests.
What to Expect for the Reviews
We aim to address all PRs in a timely manner. If no one reviews your PR within 5 days, please @-mention one of KuntaiDu, ApostaC or YaoJiayi.
I quickly went through this. Since it's quite a large PR, can we maybe split this into 2 PRs? One is a pure controller interface, and the other is the CacheEngine-level implementation. Also, it would be better if we can have a document of the controller interface and how it is implemented
Another thing is I think we should talk about how to deal with the hot_cache since it will probably be replaced by a local CPU backend (#514 )
This pull request has been automatically marked as stale because it has not had activity within 60 days. It will be automatically closed if no further activity occurs within 30 days.
This pull request has been automatically closed due to inactivity. Please feel free to reopen if you intend to continue working on it!