[PR #2400] [CLOSED] Add opt-in usage, output history and authenticated remote dashboard #4028

Closed
opened 2026-11-07 15:32:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2400
Author: @QuickkApps
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: codex/local-usage-remote


📝 Commits (3)

  • ecf1ba2 Add opt-in usage ledger, output rollover and authenticated remote API
  • aa04520 Harden Funnel ownership and add accounting regression coverage
  • 7883e56 Add output history, remote dashboard and illustrated setup guide

📊 Changes

39 files changed (+4300 additions, -61 deletions)

View changed files

📝 .gitignore (+11 -0)
➕ CLAUDE-STRATA.bat (+8 -0)
📝 README.md (+4 -0)
📝 chat.py (+2 -1)
➕ claude-code/README.md (+46 -0)
➕ claude-code/settings.local.json (+16 -0)
📝 docs/DETAILS.md (+52 -1)
➕ docs/LOCAL_FEATURES.md (+317 -0)
➕ docs/LOCAL_OUTPUT_HISTORY.md (+48 -0)
➕ docs/media/dashboard-example.jpg (+0 -0)
➕ docs/media/history-example.jpg (+0 -0)
➕ docs/media/usage-example.jpg (+0 -0)
➕ docs/media/usage-overview-example.jpg (+0 -0)
➕ remote-access/README.md (+183 -0)
➕ remote-access/RemoteCommon.ps1 (+36 -0)
➕ remote-access/Restart-Tunnel.ps1 (+4 -0)
➕ remote-access/Start-Remote.ps1 (+197 -0)
➕ remote-access/Stop-Remote.ps1 (+39 -0)
➕ remote-access/gateway.mjs (+185 -0)
➕ serve/history.py (+317 -0)

...and 19 more files

📄 Description

Summary

Updates the existing contribution with persistent output History, source labels, app-bar Average TPS, authenticated remote-dashboard sharing, startup/recovery improvements, and an illustrated setup guide. The features are opt-in; the ordinary model, sampling, thinking budget and client output limits are not changed.

Complete setup and operation guide

The guide covers installation prerequisites, configuration, OpenAI/Anthropic editor URLs, Claude Code, authentication, Tailscale activation, automatic startup, recovery, shutdown, credential rotation, accounting definitions, storage/privacy, troubleshooting, and reproducible examples.

What changed

  • Persistent Usage ledger and daily/all-time views: prompt/output/cached/total tokens, cached hit percentage, weighted average and live/last decode rate, active time, process CPU time, GPU energy, average GPU power, configurable API-equivalent value, electricity cost and estimated savings.
  • Shared header Average TPS immediately after Cached tokens; responsive header sizing prevents the figures from overlapping content on mobile.
  • Opt-in SQLite output History across Chat Completions, Anthropic Messages and Responses, streaming or not. Output, Thinking, Tools and Details panes; search, status filtering, pagination, copy and full-text download.
  • History source labels use explicit app headers or recognized product User-Agents, otherwise Unknown. Labels are self-reported, not authentication. History displays the actual serving model, while Details preserves client aliases as requested_model; API responses remain unchanged.
  • Authenticated loopback Node gateway with optional administrative dashboard sharing over Tailscale Funnel. API and dashboard have separate connection pools; Basic-auth browser POSTs require the same origin.
  • Per-request credential loading, stale owned-gateway revision checks, serialized startup and a supervised parent-bound watchdog. Existing fail-closed ownership checks for the whole HTTPS port and process/config paths are retained.
  • Optional Claude Code profile/launcher without modifying global settings automatically. Claude-named compatibility aliases still run the loaded Strata model; the example requests 132,000 combined output tokens, with no separate thinking budget. Clients may clamp this value.
  • Existing experimental unlimited_output continuation remains a separate opt-in in this branch. It is not enabled by the guide or default configuration and is not infinite model memory.

No native engine/kernel or frontend parser source is changed. New changes were ported selectively rather than replacing newer upstream image, vision, model-family or recovery behavior with an older installed copy.

Enable Explicitly

Merge only the desired keys into an existing model configuration, preserving engine paths and arguments, then restart:

{
  "usage_tracker": true,
  "output_history": true,
  "remote_access": true
}

Remote startup currently requires Windows, Node.js, signed-in Tailscale with Funnel enabled, and a Strata-engine server on loopback port 8080. Cloning alone does not publish anything. The gateway generates credentials in the current user's protected local application-data directory.

Dashboard sharing is separately disabled by default. To enable it, merge exposeDashboard: true into the private gateway configuration and rerun the helper. Browser login is username strata, password the generated gateway key. The contribution requires API authentication and does not include a public no-key mode.

OpenAI editor base URLs end in /v1; Anthropic/Claude Code base URLs use the root, without /v1. See the guide for exact steps and private credential handling.

Example Screens

Actual dashboard components rendered with synthetic data, fixed January sample dates and neutral UTC example metadata. These are UI examples, not benchmarks. No real conversations, device hostname, credentials or runtime databases are included.

Monitor Dashboard

Monitor dashboard

Usage

Usage statistics

History

History with app source and actual model

The guide includes an additional Usage overview. Reproduce the images locally with:

python tools/preview_dashboard.py --port 8096 --seconds 300

The preview binds loopback only, uses no GPU/Tailscale/user files and cleans its temporary data on exit.

Accounting And Privacy Limits

  • Cached tokens are part of prompt tokens, not additional total tokens. Average decode is recorded decoded tokens / recorded decode seconds, excluding prefill, idle, inserted control tokens and untimed historical work.
  • GPU energy uses cumulative board-energy deltas where available and sampled-power integration otherwise, only during active intervals. Missing measurements retain coverage gaps. This is whole-board energy, not exact per-model or whole-PC electricity; other GPU programs can contribute.
  • Prices, tariffs and exchange rates are manual benchmarks. Editing them revalues history; this is not a bill or earnings ledger.
  • History is plaintext with no automatic retention limit. It saves emitted output/thinking/tool arguments and whitelisted metadata, not complete input prompts or raw request headers. Generated content can still contain sensitive information. Bounded background writes can report incomplete recording without failing inference.
  • Dashboard credentials grant trusted administrative access, including History/config/model controls and configured MCP capabilities. API keys also retain upstream trusted-client capabilities. The watchdog cannot fix power/network outages, forced sleep, expired credentials or editor incompatibility.
  • No personal model configuration, keys, public hostname, usage/history data, audit artifacts, models, native binaries or virtual environment is included. The separate running installation was left unchanged.

Verification

  • Full server suite: 846 tests, OK (15 environment-dependent skips).
  • Focused history/usage/remote checks: 53 tests passed. The final gateway and deferred-fetch History UI rerun passed 7 tests, covering auth, key rotation, fail-closed config, dashboard gating, source-header forwarding and cross-site Basic-auth rejection.
  • Synthetic preview checks passed for fixed dates/UTC metadata, daily totals, weighted TPS and saved examples. Desktop and 390-pixel mobile browser checks passed after the header-overlap correction.
  • Ruff correctness checks pass on touched Python modules; B023/F401 checks pass on helper/history/test modules. Six existing server B023 closure warnings remain unchanged from the previous commit.
  • JavaScript syntax and focused ESLint pass; CSS syntax/property/color checks pass. All PowerShell helpers parse under Windows PowerShell. PSScriptAnalyzer was unavailable for this update, so no new analyzer claim is made.
  • Read-only publication/security review found no outstanding blocker after addressing browser-origin checks and screenshot time-zone privacy.
  • No CUDA/HIP/SYCL build, full PC reboot, real Funnel reconfiguration, performance/quality benchmark or actual other-device editor workflow was performed for this PR update. Tests do not modify the running model or public tunnel.

Related discussions: #1876, #1925, #2204, #2370. Their unmerged implementations are not silently combined with this ledger.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2400 **Author:** [@QuickkApps](https://github.com/QuickkApps) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/local-usage-remote` --- ### 📝 Commits (3) - [`ecf1ba2`](https://github.com/Niko1221/Strata/commit/ecf1ba2bac623bc6252127c2e790232b14b87bbf) Add opt-in usage ledger, output rollover and authenticated remote API - [`aa04520`](https://github.com/Niko1221/Strata/commit/aa04520bda4934f6322fdd94a6366ad6cdce67ce) Harden Funnel ownership and add accounting regression coverage - [`7883e56`](https://github.com/Niko1221/Strata/commit/7883e5668cb668542b23abd8798b325688cb211c) Add output history, remote dashboard and illustrated setup guide ### 📊 Changes **39 files changed** (+4300 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+11 -0) ➕ `CLAUDE-STRATA.bat` (+8 -0) 📝 `README.md` (+4 -0) 📝 `chat.py` (+2 -1) ➕ `claude-code/README.md` (+46 -0) ➕ `claude-code/settings.local.json` (+16 -0) 📝 `docs/DETAILS.md` (+52 -1) ➕ `docs/LOCAL_FEATURES.md` (+317 -0) ➕ `docs/LOCAL_OUTPUT_HISTORY.md` (+48 -0) ➕ `docs/media/dashboard-example.jpg` (+0 -0) ➕ `docs/media/history-example.jpg` (+0 -0) ➕ `docs/media/usage-example.jpg` (+0 -0) ➕ `docs/media/usage-overview-example.jpg` (+0 -0) ➕ `remote-access/README.md` (+183 -0) ➕ `remote-access/RemoteCommon.ps1` (+36 -0) ➕ `remote-access/Restart-Tunnel.ps1` (+4 -0) ➕ `remote-access/Start-Remote.ps1` (+197 -0) ➕ `remote-access/Stop-Remote.ps1` (+39 -0) ➕ `remote-access/gateway.mjs` (+185 -0) ➕ `serve/history.py` (+317 -0) _...and 19 more files_ </details> ### 📄 Description ## Summary Updates the existing contribution with persistent output History, source labels, app-bar Average TPS, authenticated remote-dashboard sharing, startup/recovery improvements, and an illustrated setup guide. The features are opt-in; the ordinary model, sampling, thinking budget and client output limits are not changed. **[Complete setup and operation guide](https://github.com/QuickkApps/Strata/blob/7883e5668cb668542b23abd8798b325688cb211c/docs/LOCAL_FEATURES.md)** The guide covers installation prerequisites, configuration, OpenAI/Anthropic editor URLs, Claude Code, authentication, Tailscale activation, automatic startup, recovery, shutdown, credential rotation, accounting definitions, storage/privacy, troubleshooting, and reproducible examples. ## What changed - Persistent Usage ledger and daily/all-time views: prompt/output/cached/total tokens, cached hit percentage, weighted average and live/last decode rate, active time, process CPU time, GPU energy, average GPU power, configurable API-equivalent value, electricity cost and estimated savings. - Shared header Average TPS immediately after Cached tokens; responsive header sizing prevents the figures from overlapping content on mobile. - Opt-in SQLite output History across Chat Completions, Anthropic Messages and Responses, streaming or not. Output, Thinking, Tools and Details panes; search, status filtering, pagination, copy and full-text download. - History source labels use explicit app headers or recognized product User-Agents, otherwise Unknown. Labels are self-reported, not authentication. History displays the actual serving model, while Details preserves client aliases as requested_model; API responses remain unchanged. - Authenticated loopback Node gateway with optional administrative dashboard sharing over Tailscale Funnel. API and dashboard have separate connection pools; Basic-auth browser POSTs require the same origin. - Per-request credential loading, stale owned-gateway revision checks, serialized startup and a supervised parent-bound watchdog. Existing fail-closed ownership checks for the whole HTTPS port and process/config paths are retained. - Optional Claude Code profile/launcher without modifying global settings automatically. Claude-named compatibility aliases still run the loaded Strata model; the example requests 132,000 combined output tokens, with no separate thinking budget. Clients may clamp this value. - Existing experimental unlimited_output continuation remains a separate opt-in in this branch. It is not enabled by the guide or default configuration and is not infinite model memory. No native engine/kernel or frontend parser source is changed. New changes were ported selectively rather than replacing newer upstream image, vision, model-family or recovery behavior with an older installed copy. ## Enable Explicitly Merge only the desired keys into an existing model configuration, preserving engine paths and arguments, then restart: ```json { "usage_tracker": true, "output_history": true, "remote_access": true } ``` Remote startup currently requires Windows, Node.js, signed-in Tailscale with Funnel enabled, and a Strata-engine server on loopback port 8080. Cloning alone does not publish anything. The gateway generates credentials in the current user's protected local application-data directory. Dashboard sharing is separately disabled by default. To enable it, merge exposeDashboard: true into the private gateway configuration and rerun the helper. Browser login is username strata, password the generated gateway key. The contribution requires API authentication and does not include a public no-key mode. OpenAI editor base URLs end in /v1; Anthropic/Claude Code base URLs use the root, without /v1. See the guide for exact steps and private credential handling. ## Example Screens Actual dashboard components rendered with synthetic data, fixed January sample dates and neutral UTC example metadata. These are UI examples, not benchmarks. No real conversations, device hostname, credentials or runtime databases are included. ### Monitor Dashboard ![Monitor dashboard](https://raw.githubusercontent.com/QuickkApps/Strata/7883e5668cb668542b23abd8798b325688cb211c/docs/media/dashboard-example.jpg) ### Usage ![Usage statistics](https://raw.githubusercontent.com/QuickkApps/Strata/7883e5668cb668542b23abd8798b325688cb211c/docs/media/usage-example.jpg) ### History ![History with app source and actual model](https://raw.githubusercontent.com/QuickkApps/Strata/7883e5668cb668542b23abd8798b325688cb211c/docs/media/history-example.jpg) The guide includes an additional Usage overview. Reproduce the images locally with: ```shell python tools/preview_dashboard.py --port 8096 --seconds 300 ``` The preview binds loopback only, uses no GPU/Tailscale/user files and cleans its temporary data on exit. ## Accounting And Privacy Limits - Cached tokens are part of prompt tokens, not additional total tokens. Average decode is recorded decoded tokens / recorded decode seconds, excluding prefill, idle, inserted control tokens and untimed historical work. - GPU energy uses cumulative board-energy deltas where available and sampled-power integration otherwise, only during active intervals. Missing measurements retain coverage gaps. This is whole-board energy, not exact per-model or whole-PC electricity; other GPU programs can contribute. - Prices, tariffs and exchange rates are manual benchmarks. Editing them revalues history; this is not a bill or earnings ledger. - History is plaintext with no automatic retention limit. It saves emitted output/thinking/tool arguments and whitelisted metadata, not complete input prompts or raw request headers. Generated content can still contain sensitive information. Bounded background writes can report incomplete recording without failing inference. - Dashboard credentials grant trusted administrative access, including History/config/model controls and configured MCP capabilities. API keys also retain upstream trusted-client capabilities. The watchdog cannot fix power/network outages, forced sleep, expired credentials or editor incompatibility. - No personal model configuration, keys, public hostname, usage/history data, audit artifacts, models, native binaries or virtual environment is included. The separate running installation was left unchanged. ## Verification - Full server suite: **846 tests, OK (15 environment-dependent skips)**. - Focused history/usage/remote checks: 53 tests passed. The final gateway and deferred-fetch History UI rerun passed 7 tests, covering auth, key rotation, fail-closed config, dashboard gating, source-header forwarding and cross-site Basic-auth rejection. - Synthetic preview checks passed for fixed dates/UTC metadata, daily totals, weighted TPS and saved examples. Desktop and 390-pixel mobile browser checks passed after the header-overlap correction. - Ruff correctness checks pass on touched Python modules; B023/F401 checks pass on helper/history/test modules. Six existing server B023 closure warnings remain unchanged from the previous commit. - JavaScript syntax and focused ESLint pass; CSS syntax/property/color checks pass. All PowerShell helpers parse under Windows PowerShell. PSScriptAnalyzer was unavailable for this update, so no new analyzer claim is made. - Read-only publication/security review found no outstanding blocker after addressing browser-origin checks and screenshot time-zone privacy. - No CUDA/HIP/SYCL build, full PC reboot, real Funnel reconfiguration, performance/quality benchmark or actual other-device editor workflow was performed for this PR update. Tests do not modify the running model or public tunnel. Related discussions: #1876, #1925, #2204, #2370. Their unmerged implementations are not silently combined with this ledger. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4028
No description provided.