slimtoken
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SLIMTOKEN_MINIFY | No | Master switch; 0 = passthrough. | 1 |
| SLIMTOKEN_KEEP_LAST | No | Recent turns kept verbatim by distill/budget. | 4 |
| SLIMTOKEN_MINIFY_DEDUP | No | Enable collapsing repeated tool results. | 1 |
| SLIMTOKEN_MINIFY_TOOLS | No | Enable tool schema minification. | 1 |
| SLIMTOKEN_MINIFY_BUDGET | No | Hard token cap; 0 disables hard prune. | 131072 |
| SLIMTOKEN_MINIFY_SYSTEM | No | Enable system prompt compression. | 1 |
| SLIMTOKEN_TOOL_COMPRESS | No | Lossy type-specific tool-result compression. | 1 |
| SLIMTOKEN_MINIFY_DISTILL | No | Enable distilling old turns to summaries. | 1 |
| SLIMTOKEN_DEDUP_MIN_CHARS | No | Only dedup tool results at least this long. | 200 |
| SLIMTOKEN_MINIFY_MESSAGES | No | Enable message text compression. | 1 |
| SLIMTOKEN_MINIFY_TOOL_SKIP | No | Comma-list of tool names to never minify. | |
| SLIMTOKEN_DISTILL_MAX_CHARS | No | Max chars per distilled old turn. | 160 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| slimtoken.optimize_messagesA | Reduce prompt size while preserving message structure and tool-call validity (pair-safe, fence-aware). Returns the minified messages plus token counts. Lossy by default (distill + tool-result compression); disable stages via the SLIMTOKEN_MINIFY_* env knobs. |
| slimtoken.estimate_tokensA | Count tokens in a request body using the real cl100k_base tokenizer (bundled, offline). Returns total + per-message breakdown. The |
| slimtoken.prune_contextA | RAG-style context pruning for a memory/conversation store: strip low-value text, retrieve warm entries relevant to a query, sliding-window summarize old turns, and enforce a token budget. Returns a ready-to-inject / prompt block. |
| slimtoken.minify_tool_resultA | Compress a large tool_result content block using type detection (directory listing, git output, logs, JSON, source). LOSSY — emits a compact representation plus a [slimtoken-compressed] metadata header. Pair-safe by construction (only the content field changes). |
| slimtoken.inspect_budgetA | Read-only token-budget inspection: counts system/tools/messages, reports headroom against a token_budget, and whether the pair-safe pruner would drop any leading messages. Does not modify the body. |
| slimtoken.get_configA | Return the slimtoken config in use: the always-on MinifyConfig built from SLIMTOKEN_* env knobs (the single config surface shared by the proxy, CLI, and MCP server). Useful to see what slimtoken will do. |
| slimtoken.list_model_presetsA | List recommended local-model presets by GPU VRAM tier (4/8/16GB), each with a usable context. With measure=true, enriches each row with the live measured token reduction on a bloated payload (run by the pipeline itself). |
| slimtoken.high_context_presetsA | High-context VRAM-tier configs (dense AND MoE) showing how slimtoken compression expands the effective context window. Each row gives the largest nominal context that fits fully in VRAM (computed by config_optimizer, q4_0 KV, flash attn, full offload) and the effective raw-token capacity = nominal_ctx / (1 - reduction). Use best=true for just the largest-effective-context preset of a tier. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Several tools overlap in purpose: optimize_messages, prune_context, and minify_tool_result all reduce token counts, while list_model_presets and high_context_presets both list presets. However, descriptions clarify distinct use cases (full prompt vs. memory store vs. tool result; standard vs. high-context configs), so most boundaries are navigable.
Most tools follow a clear verb_noun pattern (optimize_messages, estimate_tokens, prune_context, minify_tool_result, inspect_budget, get_config, list_model_presets), but high_context_presets breaks the pattern as an adjective_noun phrase, causing a minor inconsistency.
With 8 tools, the set is well-scoped for a specialized token optimization server. Each tool addresses a distinct aspect (estimation, minification, pruning, budget inspection, config, presets) without unnecessary bloat or redundancy.
The tool surface covers the core lifecycle of token optimization: estimating, minifying, pruning, inspecting budgets, and retrieving config/presets. Minor gaps exist (e.g., no explicit tool to reverse or restore compressed content), but these are not essential given the lossy and config-driven design.