omp-cache-optimizer 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/index.ts +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -186,10 +186,22 @@ OMP 0.79+ 已内置 footer `CH` 标记,用于显示最近一次 prompt cache h
|
|
|
186
186
|
示例 footer:
|
|
187
187
|
|
|
188
188
|
```text
|
|
189
|
-
OpenAI
|
|
189
|
+
OpenAI Cache 3/10 · 0.002M/0.005M tok (40%) ⚠️ 配置
|
|
190
190
|
```
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
格式:`<适配器标签> <命中请求数>/<总请求数> · <缓存 tokens>/<总输入 tokens> tok (<token 命中率>)`。部分 adapter 还可能追加 `· 写入 <tokens> tok`,运行时诊断可能追加 `⚠️ 配置` 或 `⚠️ 完整性`。
|
|
192
|
+
|
|
193
|
+
各部分说明:
|
|
194
|
+
|
|
195
|
+
| 部分 | 示例 | 说明 |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| 适配器标签 | `OpenAI Cache` | 识别到的模型家族,匹配对应的缓存适配器。未命中时显示 `0/0` |
|
|
198
|
+
| 命中/总请求 | `3/10` | 当前 session + 模型下的缓存命中次数与总请求数 |
|
|
199
|
+
| 缓存/总 tokens | `0.002M/0.005M tok` | prompt cache 命中的 input tokens 与总 input tokens(M = million = 百万) |
|
|
200
|
+
| token 命中率 | `(40%)` | 缓存 tokens 占总输入 tokens 的百分比 |
|
|
201
|
+
| 写入 | `· 写入 0.001M tok` | 当前 session 累计新写入 prompt cache 的 tokens。仅 DeepSeek、OpenAI、Gemini 等适配器显示 |
|
|
202
|
+
| `⚠️ 配置` | 显示在末尾 | 当前模型缺少可安全修复的 compat 配置(如 reasoning 相关字段),建议运行 `/cache-optimizer fix` |
|
|
203
|
+
| `⚠️ 完整性` | 显示在末尾 | prompt 重排时检测到结构标记丢失,已回退到原始 prompt。一次性告警,`/reload` 后清除 |
|
|
204
|
+
| `缓存优化已关闭 ·` | 前缀 | `/cache-optimizer disable` 后出现,表示统计以对比模式采集,不再改写 prompt |
|
|
193
205
|
|
|
194
206
|
支持的 footer label 包括:DS、Claude、OpenAI、Gemini、Kimi、Qwen、GLM、MiniMax、Mimo、Hunyuan、Mistral、Grok、Llama、Nemotron、Cohere、Yi、Doubao、ERNIE、Baichuan、StepFun、Spark、InternLM、Gemma、Phi、Jamba、Solar、Sonar、Nova、Reka、Falcon、DBRX、MPT、StableLM、Aquila、EXAONE、HyperCLOVA、Luminous、Hermes、Granite、Arctic、Pangu、SenseNova、Zhinao、MiniCPM、XVERSE、Orion、OpenChat、Vicuna、Wizard、Zephyr、Dolphin、OpenOrca、Starling、BLOOM、RWKV、Aya。
|
|
195
207
|
|
package/index.ts
CHANGED
|
@@ -3345,7 +3345,7 @@ function formatTokenCount(value: number): string {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
|
|
3347
3347
|
function localizeAdapterLabel(label: string): string {
|
|
3348
|
-
return label.endsWith(" cache") ? `${label.slice(0, -6)}
|
|
3348
|
+
return label.endsWith(" cache") ? `${label.slice(0, -6)} Cache` : label;
|
|
3349
3349
|
}
|
|
3350
3350
|
|
|
3351
3351
|
function formatCacheStats(adapter: CacheProviderAdapter, stats: CacheStats): string {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omp-cache-optimizer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Improve OMP prompt/KV cache hit rates with stable prompts, OpenAI-compatible cache keys, proxy compat warnings, and footer cache stats.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"omp-package",
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
"@oh-my-pi/pi-coding-agent": "*"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
|
-
"
|
|
39
|
-
|
|
38
|
+
"url": "git+https://github.com/EF-FlowCode/omp-cache-optimizer.git"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/EF-FlowCode/omp-cache-optimizer",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/EF-FlowCode/omp-cache-optimizer/issues"
|
|
40
43
|
}
|
|
41
44
|
}
|