Distilly Context Distiller & Prompt Pruning Optimizer

Distilly Context Distiller & Prompt Pruning Optimizer

@distilly/mindset·v1.1.8·core

A context compression and token economizer engine for DeepSeek Harness. Leverages semantic relevance scoring to prune redundant prompt tokens, deduplicate chat logs, and reduce latency by up to 70%.

Token-Optimization · Context-Pruning · Prompt-Engineering · Cost-Saving

GitHubNPM
Installation & Integration
bash
manager:
$ pnpm add @distilly/mindset

Architecture

Distilly protects developer budgets and eliminates context drift in extended autonomous tasks. As multi-step agent trajectories unfold, prompt histories swell with repetitive tool schemas, verbose terminal logs, and conversational noise. This plugin implements an intelligent token distillation middleware on the Cordis egress pipeline. By scoring token semantic density, it compresses verbose command outputs into factual summaries, collapses repetitive error traces, and preserves code interfaces—achieving up to 70% token reductions without semantic loss.

Core Features

01

Lossless Semantic Compression: Retains critical variables and constraints without degrading success

02

Substantial Cost Reduction: Lowers input token expenditure by 40% to 70% on long-horizon tasks

03

Slashed First-Token Latency (TTFT): Smaller prompt payloads dramatically shorten prefill latency

04

Configurable Pruning Tiers: Offers Safe, Balanced, and Aggressive compression profiles

Core Workflow

01

Token Density Audit

Scans conversation histories, scoring semantic density and recency decay.

02

Terminal Log Compaction

Identifies massive terminal logs, compacting progress bars into factual summaries.

03

Trajectory Distillation

Distills early trial-and-error reasoning turns into high-density fact checklists.

04

Optimized Payload Egress

Delivers compressed prompt payloads to the DeepSeek inference gateway.

Configuration Parameters Reference (YAML / JSON)

ParameterTypeDefaultDescription
compressionLevelstringbalancedCompression intensity profile
maxLogLinesnumber30Maximum uncollapsed lines retained for tool outputs
preserveCodeBlocksbooleantruePrevent compression from altering code block syntax