Skip to content

add cache for module#744

Merged
wzh1994 merged 11 commits intoLazyAGI:mainfrom
wzh1994:wzh/module_cache
Sep 5, 2025
Merged

add cache for module#744
wzh1994 merged 11 commits intoLazyAGI:mainfrom
wzh1994:wzh/module_cache

Conversation

@wzh1994
Copy link
Contributor

@wzh1994 wzh1994 commented Sep 3, 2025

📌 PR 内容 / PR Description

  • 为Module增加缓存,支持内存、文件、Sqlite、Redis

🔍 相关 Issue / Related Issue

✅ 变更类型 / Type of Change

  • 修复 Bug / Bug fix (non-breaking change that fixes an issue)
  • 新功能 / New feature (non-breaking change that adds functionality)
  • 重构 / Refactor (no functionality change, code structure optimized)
  • 重大变更 / Breaking change (fix or feature that would cause existing functionality to change)
  • 文档更新 / Documentation update (changes to docs only)

🧪 如何测试 / How Has This Been Tested?

  1. 下一个pr会基于此pr优化单元测试的耗时

⚡ 更新后的用法示例 / Usage After Update

先设置环境变量,标识缓存策略,可选项为sqlite / file / memory / redis

export LAZYLLM_CACHE_STRATEGY=sqlite

然后再module中开启缓存

m = lazyllm.TrainableModule('internlm2-chat-7b').use_cache()
m = lazyllm.OnlineChatModule().use_cache()

@wzh1994 wzh1994 changed the title add cache for module and speed up tests [skip ci] add cache for module to speed up tests Sep 4, 2025
@mergify mergify bot added the lint_pass label Sep 4, 2025
@lwj-st lwj-st removed the lint_pass label Sep 5, 2025
@wzh1994 wzh1994 changed the title add cache for module to speed up tests add cache for module to speed up tests later Sep 5, 2025
@mergify mergify bot added the lint_pass label Sep 5, 2025
@lwj-st lwj-st removed the lint_pass label Sep 5, 2025
@mergify mergify bot added the lint_pass label Sep 5, 2025
@wzh1994 wzh1994 changed the title add cache for module to speed up tests later add cache for module Sep 5, 2025
@wzh1994 wzh1994 merged commit 71ec27c into LazyAGI:main Sep 5, 2025
15 of 23 checks passed
@wzh1994 wzh1994 deleted the wzh/module_cache branch October 15, 2025 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize the execution time of CI

2 participants