Skip to content

open-leash/plugin-token-saver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plugin-token-saver

Token Saver is OpenLeash's first container plugin. It embeds Headroom as a compression engine; Headroom never receives provider credentials and never acts as the network proxy. OpenLeash local-proxy owns provider transport, client-api owns plugin ordering and policy, and this container receives signed requests and returns constrained JSON patches.

The versioned response can also request host-mediated logs, usage, and signals. client-api checks the installed manifest and effective account setting, enforces each declared permission, sanitizes the payload, and writes through the normal OpenLeash capability implementation. The container never receives Postgres, cloud, provider, or OpenLeash credentials. Stateful CCR content remains in the plugin-scoped /data volume and is exposed only through the correlated signed tool API.

Runtime

  • GET /healthz
  • POST /v1/transform using openleash-container-plugin.v1
  • POST /v1/tools/execute for tenant/session-scoped CCR retrieval

The desktop starts the image when the effective account state enables Token Saver. It runs non-root with a read-only root filesystem, dropped capabilities, bounded resources, loopback-only exposure, and a plugin-scoped /data volume. OpenLeash Cloud runs the same image as a warm shared first-party worker pool; tenant-dedicated placement remains available for higher-isolation deployments.

Configuration scope

Token Saver receives one resolved configuration in each signed request. OpenLeash merges manifest defaults, organization settings and matching organization agent profiles, then permitted user/global and per-agent profiles. Exact agent identity is derived from authenticated enrollment/runtime context. The container must treat configuration as request-scoped data and may cache only by configuration hash; it must not retain tenant configuration as global mutable state.

Organization admins independently control mandatory installation, default enablement, employee install freedom, and configuration locking. A mandatory Token Saver installation may remain employee-configurable. The same container contract runs beside Individual Open Source and desktop edge installations and in OpenLeash Cloud warm pools; product-mode and role logic remain in OpenLeash.

Build

npm install
npm run typecheck
docker build -t ghcr.io/open-leash/plugin-token-saver:1.1.1 .
docker run --rm -p 127.0.0.1:9331:8080 ghcr.io/open-leash/plugin-token-saver:1.1.1
curl http://127.0.0.1:9331/healthz

Production releases must record and deploy the registry digest rather than relying on the human-readable tag.

About

First-party OpenLeash plugin that reduces prompt token usage before model calls.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors