lmcache 工具#
lmcache tool 命令将与 LMCache 捆绑在一起的离线分析工具进行分组。
lmcache tool <tool-name> <action> [options]
目前可用的工具有一个:cache-simulator。
备注
cache-simulator 依赖于可选的 plot 附加组件(sortedcontainers / matplotlib)。如果它们未安装,子命令将会在 CLI 中静默省略。安装附加组件以启用它。
cache-simulator#
通过 LRU 缓存重放 LMCache 查找哈希 JSONL 日志,以测量 KV Cache 的令牌命中率。它有三个操作:
lmcache tool cache-simulator {simulate,sweep,gen-dataset} [options]
操作 |
描述 |
|---|---|
|
在固定的缓存容量下重放日志;打印文本报告并保存 7 面板的统计 PNG。 |
|
在一系列缓存容量中进行扫描,并保存命中率与容量的 PNG 图像。 |
|
从查找哈希 JSONL 日志生成一个 |
每个操作都有其自己的标志。运行内置帮助以获取完整列表:
lmcache tool cache-simulator simulate --help
lmcache tool cache-simulator sweep --help
lmcache tool cache-simulator gen-dataset --help