SuperLocalMemory V4 Documentation https://superlocalmemory.com | Part of Qualixar
Complete reference for all SLM v3.6 Optimize CLI commands.
SLM v3.6 adds 6 new top-level commands under slm:
slm optimize ... # Master Optimize module control
slm cache ... # Cache sub-control
slm compress ... # Compression sub-control
slm proxy ... # Start/proxy control
slm wrap ... # Agent activation
slm help-optimize # Full developer referenceAll commands accept --json for machine-readable output.
Show all Optimize settings — cache state, compression mode, proxy status, config version.
slm optimize status
slm optimize status --jsonExample output:
Optimize: ON
Cache: enabled (exact: 86400s TTL, semantic: OFF)
Compress: enabled (Mode: safe, Prose (Layer 2): OFF)
Proxy: not running
Config: ~/.superlocalmemory/optimize.json (version 61)
Enable cache + compress (does NOT start the proxy).
slm optimize onDisable all Optimize features. Proxy (if running) passes through calls unchanged.
slm optimize offToken/cost savings report from metrics counters.
slm optimize savings # Last 7 days
slm optimize savings --since 30 # Last 30 days
slm optimize savings --provider anthropic # Filter by provider
slm optimize savings --jsonExample output:
Savings (last 7 days):
Exact cache hits: 43 (127,580 input tokens saved)
Semantic cache hits: 0
Tokens saved (total): 153,096
Estimated savings: ~$2.2964 (at $3.00/M tokens)
Pricing date: 2026-06-07
Entry count, DB size, TTLs, hit rate.
slm cache status # Default tenant
slm cache status --tenant myproject # Specific tenant
slm cache status --jsonExample output:
Cache status:
Entries (exact): 127 (not expired)
Semantic index: OFF
DB size: 2.4 MB (~/.superlocalmemory/llmcache.db)
TTL (exact): 86400s
TTL (semantic): 3600s
Hits: 43
Misses: 89
Hit rate: 32.6%
Delete all entries for a tenant.
slm cache clear # Clear default tenant
slm cache clear --tenant myproject # Clear specific tenant
slm cache clear --jsonDelete entries whose tag array contains the specified tag.
slm cache invalidate --tag "project:slm"
slm cache invalidate --tag "user:alice" --jsonSet TTL values for cache entries.
slm cache ttl --set 3600 # 1 hour exact cache
slm cache ttl --semantic 7200 # 2 hour semantic cache
slm cache ttl --set 86400 --semantic 3600 # Both at onceDefaults: exact=86400s (24h), semantic=3600s (1h).
Enable or disable semantic cache lookup (vCache).
slm cache semantic on
slm cache semantic offNote: requires embedding model (~500MB). Run slm warmup if not already done.
v3.6.10: the old
slm compress code|ccr|alignsubcommands are removed — the homegrown extractive JSON/code compressor was lossy and has been deleted. Compression is nowstatus | mode | prose. Running a removed subcommand prints a short notice explaining the change.
Show compression mode and prose state.
slm compress status
slm compress status --jsonExample output:
Compression status:
Enabled: yes
Mode: safe (lossless normalization only)
Prose: OFF (LLMLingua-2, aggressive mode only)
Set compression aggressiveness.
slm compress mode safe # Default — LOSSLESS (whitespace/JSON normalization only; code untouched)
slm compress mode aggressive # ⚠ Adds LLMLingua-2 prose compression (prose only)Safe mode (default): lossless — whitespace collapse + compact-JSON re-serialization only. No content is removed; code, numbers, structured data, and the current turn are never touched. Production-safe for all use cases, and keeps the provider prefix-cache stable.
Aggressive mode: additionally enables LLMLingua-2 prose compression on prose blocks only — may omit nuance, hedges, or low-salience wording. Shows a warning before activating. Never compresses code, math, structured data, instructions, or the latest user turn.
Enable/disable LLMLingua-2 prose compression (takes effect in aggressive mode).
slm compress prose on
slm compress prose offStart or report the optimization proxy. Proxy intercepts LLM API calls, applies cache lookup and compression before forwarding.
slm proxy # Default port 8765
slm proxy --port 8080 # Custom port
slm proxy --provider anthropic # Provider-specific surface
slm proxy --no-compress # Cache only, no compression
slm proxy --semantic # Enable semantic cache on proxy
slm proxy --jsonEndpoints served on proxy:
POST /v1/messages— Anthropic Messages APIPOST /v1/chat/completions— OpenAI Chat APIPOST /v1beta/models/*— Gemini native API- Compatible with all OpenAI-compatible clients
Activate an agent through the SLM proxy. One command: starts proxy + sets environment + launches agent.
slm wrap claude # Claude Code (recommended)
slm wrap claude -- my prompt # Pass args to agent
slm wrap cursor # Cursor
slm wrap aider -- --model gpt-4 # Aider with model
slm wrap antigravity # Antigravity
slm wrap --list # List registered agents
slm wrap --persistent # Write to agent's config file
slm wrap --dry-run # Preview without executingSupported agents: claude, claude-settings, antigravity, cline, opencode, cursor, aider, codex, copilot, generic
SDK adapters (Python) — manual wrap:
from superlocalmemory.optimize.adapters.openai_adapter import withSLM
from openai import OpenAI
client = withSLM(OpenAI()) # Same interface — zero API change
from superlocalmemory.optimize.adapters.anthropic_adapter import withSLM
from anthropic import Anthropic
client = withSLM(Anthropic())Full reference with per-agent setup recipes and safety notes.
slm help-optimize # Full reference
slm help-optimize cache # Cache subcommand reference
slm help-optimize compress # Compress + safety warning
slm help-optimize agents # Per-agent setup recipes
slm help-optimize safety # Compression safety warning only- optimize-overview.md — Product overview and quick start
- optimize-config.md — Configuration reference
- cli-reference.md — Master CLI reference (all commands)
Part of Qualixar | Created by Varun Pratap Bhardwaj | AI Reliability Engineering