Multi-tool vision context compression for LYGO (Anthropic, OpenAI, Grok/xAI, Gemini). Use before stuffing huge prompts or logs into pay-to-go APIs. Requires...
Coding
LYGO API Token Saver
Try itMinimize pay-to-go xAI/API token spend. Use when user says token saver, save tokens, API budget, pay-to-go burn, or before long Grok/Claude/GPT calls. Prefer...
What it does
Minimize pay-to-go xAI/API token spend. Use when user says token saver, save tokens, API budget, pay-to-go burn, or before long Grok/Claude/GPT calls. Prefer local Ollama army; Biophase7 alt xAI key; compact agent behavior.
The skill document
LYGO API token saver
API key order (Biophase7)
- Never paste keys in chat or commits.
- Load vault:
python tools/load_biophase7_vault.py→ usesXAI_API_KEY_ALTbeforeXAI_API_KEY_MAIN. - Frontier harness / probes: default
--models stackonly; addgrokonly when user explicitly needs frontier rows. - Set
LYGO_OPENAI_FRONTIER_MODELonly when OpenAI runs are required.
pxpipe-LYGO (vision context compression)
When prompts/tool dumps are huge and byte-exact hashes are not the focus:
cd lygo-protocol-stack
pip install -r requirements-pxpipe.txt
python tools/run_pxpipe_lygo_proxy.py
See docs/BIOPHASE7_PXPIPE_LYGO.md and skill lygo-pxpipe-lygo. Agent one-liner:
python tools/pxpipe_lygo_for_agent.py --shrink-file --target grok
Do not compress secrets, seeds, or diff-critical line numbers.
Prefer local silicon (zero API tokens)
# Ollama army cron + queue (127.0.0.1 only)
cd "%LYGO_STACK_ROOT%\.grok\skills\lygo-ollama-army\ollama_command_center\scripts"
python army_cron_once.py
- Drafting, summarizing repo files, grep/explore: spawn_subagent explore or local Ollama — not main chat API for bulk read.
- LFW path:
lyra_failsafe()→LYGO_LFW_FALLBACK_MODELon Ollama when cloud throttled.
Agent behavior (Grok Build)
| Do | Don't |
|---|---|
| Short replies; tables over prose | Re-summarize full session history |
grep + read_file with offset/limit | read_file entire 3k-line trees |
One spawn_subagent for execute batches | Many sequential full-context turns |
todo_write only for 3+ steps | Narrate every tool call |
Cache paths in one line ("see path") | Repeat URLs and commit hashes twice |
background: true for HF push / long tests | Block chat on 10min uploads |
| Stop when task done | "Resonance forward" essays |
Frontier harness (metered)
python tools/run_falsifiable_vector_test.py --load-vault --models stack
# API spend only if asked:
python tools/run_falsifiable_vector_test.py --load-vault --models grok --limit 3
Full 60× Grok ≈ high token + latency cost — require explicit user consent.
User phrases → mode
- "token saver" / "pay to go" → stack-only tools, Ollama army, alt xAI, minimal chat output.
- "push all" → one subagent; don't re-read diff in main thread.
Self-check
python -c "import os; print('alt' if os.environ.get('XAI_API_KEY_ALT') else 'no-vault')"
Install companion: lygo-ollama-army, lygo-protocol-stack-operator.
Related skills
Use when the user explicitly asks to analyze token waste, costs, or API bills. Finds duplicate tool calls, context bloat, model mismatch, and heartbeat waste...
Estimate LLM task token usage, cost, and duration using rule-based classification and optional local profile data without external dependencies.
Audit-grade SQLite ledger that records every model call's token usage and cost from OpenClaw sessions.
Agent token usage optimizer. Input usage logs, transcript excerpts, model bills, or runtime traces; output token/cost breakdown, waste patterns, context comp...
Guided token optimization for AI agent workspaces. Triggers on phrases like "save tokens", "optimize tokens", "context window too large", "memory files too b...