@bacnh85/pi-sub 0.1.28 → 0.1.29

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.29 (2026-08-15)
4
+
5
+ ### Features
6
+
7
+ - **tok/s speed now shown for all providers.** Previously the footer was cleared
8
+ for providers without a subscription adapter (e.g. `ollama`); now the last
9
+ response speed renders as a standalone `145 tok/s` line, and `/sub` reports
10
+ provider/model plus last and session-average speed instead of only
11
+ "tracking inactive".
12
+
3
13
  ## 0.1.28 (2026-08-09)
4
14
 
5
15
  ### Improvements
package/README.md CHANGED
@@ -75,7 +75,17 @@ monthly allowance in USD). The `/sub` detail view also shows a
75
75
 
76
76
  `pi-sub` tracks each response's tokens-per-second (tok/s) speed by measuring the time from provider request to message completion against the response's output token count. The last response's speed is shown in the footer next to usage data. The `/sub` detail view shows both the last response speed and the session-wide average.
77
77
 
78
- When the current model provider is not supported, `pi-sub` clears its subscription line and does not refresh subscription data.
78
+ The tok/s speed line is shown for **all** providers including ones without a
79
+ subscription adapter, such as `ollama` and other OpenAI-compatible local
80
+ providers. For those, the footer shows only the speed:
81
+
82
+ ```text
83
+ 145 tok/s
84
+ ```
85
+
86
+ and `/sub` reports the provider/model and speed instead of usage windows.
87
+ `pi-sub` still does not refresh subscription data for unsupported providers
88
+ (there is nothing to fetch).
79
89
 
80
90
  ## Commands
81
91
 
@@ -733,11 +733,12 @@ function windowSegments(account: SubscriptionAccountSnapshot | undefined): strin
733
733
  }
734
734
 
735
735
  function renderSubscriptionLine(ctx: ExtensionContext, state: State): void {
736
+ const theme = ctx.ui.theme;
736
737
  if (!state.adapter) {
737
- ctx.ui.setStatus(STATUS_KEY, undefined);
738
+ // Unsupported provider (e.g. Ollama): still show the last response speed.
739
+ ctx.ui.setStatus(STATUS_KEY, state.lastTokPerSec !== undefined ? theme.fg("dim", `${state.lastTokPerSec} tok/s`) : undefined);
738
740
  return;
739
741
  }
740
- const theme = ctx.ui.theme;
741
742
  const snapshot = state.snapshot;
742
743
  let line: string;
743
744
  let color: "dim" | "warning" | "error" = "dim";
@@ -844,7 +845,15 @@ function pad(value: string, width: number): string {
844
845
  }
845
846
 
846
847
  function buildDetails(snapshot: SubscriptionUsageSnapshot | undefined, state: State): string {
847
- if (!state.adapter) return `Subscription tracking inactive for current model provider (${state.model?.provider ?? "unknown"}).`;
848
+ if (!state.adapter) {
849
+ const header = `Provider: ${state.model?.provider ?? "unknown"}${state.model?.id ? ` · Model: ${state.model.id}` : ""}`;
850
+ if (state.lastTokPerSec === undefined) return `${header}\nSubscription tracking inactive for this provider.`;
851
+ const tokPerSecLine = `Last response: ${state.lastTokPerSec} tok/s` +
852
+ (state.cumulativeDurationMs > 0
853
+ ? ` · Session avg: ${Math.round(state.cumulativeOutput / (state.cumulativeDurationMs / 1000))} tok/s`
854
+ : "");
855
+ return `${header}\n${tokPerSecLine}`;
856
+ }
848
857
  if (!snapshot) return "Subscription usage has not been loaded yet.";
849
858
  if (snapshot.error) return `${snapshot.providerDisplayName}: ${snapshot.error}`;
850
859
  if (snapshot.accounts.length === 0) {
@@ -928,7 +937,7 @@ export default function (pi: ExtensionAPI) {
928
937
  state.cumulativeDurationMs += elapsed;
929
938
  }
930
939
  }
931
- if (state.adapter) renderSubscriptionLine(ctx, state);
940
+ renderSubscriptionLine(ctx, state);
932
941
  }
933
942
  });
934
943
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bacnh85/pi-sub",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Pi extension showing subscription usage for supported model providers.",
5
5
  "type": "module",
6
6
  "license": "MIT",