prism-mcp-server 19.3.0 → 19.3.1

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.
@@ -37,6 +37,7 @@ let promptTokensEvaluated = 0;
37
37
  let promptTokensSubmittedEst = 0;
38
38
  let totalCompletionTokens = 0;
39
39
  let totalLatencyMs = 0;
40
+ let cloudTokensSavedEst = 0;
40
41
  export function recordInference(result) {
41
42
  if (result.backend === "safety_gate")
42
43
  return;
@@ -64,6 +65,9 @@ export function recordInference(result) {
64
65
  promptTokensSubmittedEst += submittedEst;
65
66
  totalCompletionTokens += ct;
66
67
  totalLatencyMs += result.latency_ms;
68
+ if (!result.used_cloud) {
69
+ cloudTokensSavedEst += submittedEst + ct;
70
+ }
67
71
  if (!byModel[key]) {
68
72
  byModel[key] = {
69
73
  calls: 0,
@@ -96,6 +100,7 @@ export function getInferenceSnapshot() {
96
100
  totalCompletionTokens,
97
101
  totalTokens: promptTokensSubmittedEst + totalCompletionTokens,
98
102
  avgLatencyMs: total > 0 ? Math.round(totalLatencyMs / total) : 0,
103
+ cloudTokensSavedEst,
99
104
  byModel: modelCopy,
100
105
  };
101
106
  }
@@ -106,6 +111,7 @@ export function resetInferenceMetrics() {
106
111
  promptTokensSubmittedEst = 0;
107
112
  totalCompletionTokens = 0;
108
113
  totalLatencyMs = 0;
114
+ cloudTokensSavedEst = 0;
109
115
  for (const key of Object.keys(byModel)) {
110
116
  delete byModel[key];
111
117
  }
@@ -142,7 +148,8 @@ export function formatInferenceMetrics(compact = false) {
142
148
  // see at least one rollup. Otherwise emit every N calls as the rolling summary.
143
149
  if (snap.totalCalls !== 1 && snap.totalCalls % every !== 0)
144
150
  return "";
145
- return `📊 local ${snap.localCalls} (${snap.localPct}%) · cloud ${snap.cloudCalls} (${snap.cloudPct}%) · ~${snap.totalTokens.toLocaleString()} tok · avg ${snap.avgLatencyMs}ms`;
151
+ const savedStr = snap.cloudTokensSavedEst > 0 ? ` · ${snap.cloudTokensSavedEst.toLocaleString()} cloud tok saved` : "";
152
+ return `📊 local ${snap.localCalls} (${snap.localPct}%) · cloud ${snap.cloudCalls} (${snap.cloudPct}%) · ~${snap.totalTokens.toLocaleString()} tok · avg ${snap.avgLatencyMs}ms${savedStr}`;
146
153
  }
147
154
  // Full multi-line block (explicit inference_metrics tool call).
148
155
  // T2: show both evaluated (Ollama actual) and submitted estimate.
@@ -150,11 +157,15 @@ export function formatInferenceMetrics(compact = false) {
150
157
  const promptLine = snap.promptTokensEvaluated !== snap.promptTokensSubmittedEst
151
158
  ? ` Prompt tokens: ${snap.promptTokensEvaluated.toLocaleString()} evaluated / ${snap.promptTokensSubmittedEst.toLocaleString()} submitted est.`
152
159
  : ` Prompt tokens: ${snap.promptTokensEvaluated.toLocaleString()}`;
160
+ const savedLine = snap.cloudTokensSavedEst > 0
161
+ ? ` Cloud tokens saved (est.): ${snap.cloudTokensSavedEst.toLocaleString()} — token volume handled locally instead of cloud`
162
+ : ` Cloud tokens saved (est.): 0`;
153
163
  const lines = [
154
164
  `\n📊 Delegation Metrics — local-model calls this session (not host model spend):`,
155
165
  ` Total calls: ${snap.totalCalls} — Local: ${snap.localCalls} (${snap.localPct}%) | Cloud: ${snap.cloudCalls} (${snap.cloudPct}%)`,
156
166
  promptLine,
157
167
  ` Completion tokens: ${snap.totalCompletionTokens.toLocaleString()}`,
168
+ savedLine,
158
169
  ` Avg latency: ${snap.avgLatencyMs}ms`,
159
170
  ];
160
171
  const models = Object.entries(snap.byModel).sort((a, b) => b[1].calls - a[1].calls);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prism-mcp-server",
3
- "version": "19.3.0",
3
+ "version": "19.3.1",
4
4
  "mcpName": "io.github.dcostenco/prism-coder",
5
5
  "description": "Prism Coder — Cognitive memory + tool-calling intelligence for AI agents. Mind Palace persistent memory (BFCL Gold Certified, 100% Tool-Call Accuracy, 114 Agent Skills, PHI Guard, Tier Enforcement, Prompt-Based Skill Routing, Zero-Search HDC/HRR retrieval, HRR Semantic Drift Detection across BCBA/Coding/AAC domains, HIPAA-hardened local-first storage, SLERP-optimized GRPO alignment) plus the prism-coder 1.7B–32B open-weights LLM fleet.",
6
6
  "module": "index.ts",