? DCP Proxy Manual | Digit.Solutions Docs

DCP Proxy User Manual

A free local gateway for OpenAI-compatible AI backends (llama.cpp, LM Studio, vLLM, Z.AI, and others). DCP Proxy sits between your AI coding agent and the engine and shrinks conversation history on the fly, so long agent sessions keep fitting in context without losing the details that matter.

DCP Proxy modifies request bodies in transit (dedup, pruning, summaries). If a summarize call fails, requests are forwarded uncompressed — nothing is ever dropped.
Download DCP-Proxy.exe v1.4.0 (5 MB)

Older builds: v1.3.0 · v1.2.0. The zip contains the signed exe, a quick-start README and the license.

DCP Proxy user interface screenshot

Application Overview

DCP Proxy is a small local proxy for the OpenAI chat-completions API. Every request your AI coding agent sends passes through these stages:

  • Identical tool calls are deduplicated: when the same call (same name and arguments) runs several times, only the newest result is kept; older copies become a short placeholder.
  • Old error outputs are trimmed: stale failed tool outputs older than the recent tail are cut to a short prefix.
  • Huge tool outputs are pruned: outputs larger than the prune window keep a head and a tail of verbatim content.
  • Old thinking traces are stripped: previous turns' chain-of-thought is removed — engines never need it back.
  • LLM compression: when the history grows past the threshold, the model itself summarizes it into a structured, lossless-biased summary.
  • Secret redaction: credentials in tool output and tool-call arguments are masked as [REDACTED] before the request leaves your machine — recent messages included.
  • Prompt shaping: repeated tool schemas and long tool descriptions are trimmed, and very large tool lists keep only the core tools plus the ones the conversation already used.

Your API keys stay in your client. The proxy forwards the Authorization header untouched and never stores it.

Getting Started

  1. Download DCP-Proxy.exe from digit.solutions and unzip it — portable, no installer and no runtime dependencies.
  2. Run DCP-Proxy.exe. The window hides to the tray when closed; right-click the tray icon to exit.
  3. Press Add upstream and enter your engine's base URL, for example http://127.0.0.1:8888 (llama.cpp), http://127.0.0.1:1234/v1 (LM Studio), or a path-style provider URL.
  4. Use Test connection (probes /v1/models) and Send test message to verify the chain.
  5. Point your client's OpenAI base URL at the proxy: http://127.0.0.1:5100/v1.
  6. Start a session. Compression turns on automatically when the history is large enough.

That's the whole setup — the proxy is transparent to clients and engines.

AI Destinations and Engines

DCP Proxy sits between any OpenAI-compatible client ("AI destination") and any OpenAI-compatible engine, so both ends are interchangeable.

  • Destinations: point your app or agent at the proxy (http://127.0.0.1:5100/v1) and set client.base_url to the real provider. Z.ai's coding API uses https://api.z.ai/api/coding/paas/v4; OpenRouter uses https://openrouter.ai/api/v1. Root-mounted and path-style bases both work — the proxy normalizes //, duplicated /v1, and missing version segments automatically, so any base-URL shape works.
  • Engines: set engine.base_url to any OpenAI-compatible server that can summarize — Ollama, llama.cpp, vLLM, LM Studio, or a hosted model. Local engines keep conversation content on-device.
{
  "client": {
    "base_url": "https://api.z.ai/api/coding/paas/v4"
  },
  "engine": {
    "base_url": "http://127.0.0.1:11434/v1",
    "model": "qwen3:8b"
  }
}

Per-request routing still applies: http://127.0.0.1:5100/<upstream>/v1/... or the X-DCP-Upstream header pick a named upstream.

Upstreams and Routing

  • Default upstream: client paths like /v1/... go to the upstream named default.
  • Named upstreams: http://host:5100/<name>/v1/... routes to that upstream with the prefix stripped.
  • Header override: send X-DCP-Upstream: <name> to pick the upstream per request.
  • URL fixing: the proxy collapses // and /v1/v1, adds a missing /v1 for known endpoints on root-mounted bases, and strips a stray /v1 for path-style bases — so any base-URL shape works.
  • Health: GET /health returns status plus counters (requests, saved est. tokens, compressions, secrets redacted, RTK filter hits).

Token-Saving Transforms

Transforms only touch messages older than the recent tail (the last keepRecent messages, 6 by default). The tail is always forwarded verbatim — except for secret redaction, which has no age limit.

  • Dedup: identical tool calls (same name + arguments) keep only the newest output.
  • Error purge: old tool outputs that look like errors are cut to a 200-char prefix.
  • Prune: old tool outputs over maxToolChars (default 6000) become head + tail (headTail, default 1500 + 1500 chars), with the original size noted.
  • Reasoning strip: reasoning_content / reasoning fields are deleted from old assistant messages (on by default; disable with "stripReasoning": false).
  • Secret redaction: redactSecrets (default on) masks API keys, tokens, JWTs, Bearer credentials, private-key headers, database/Redis connection strings and api_key=/password: assignments in role=tool content and assistant tool-call arguments. Key names are kept and JSON stays valid; user messages are never touched. Add "redactSecrets": false only if you intentionally need a credential forwarded.
  • Tool trimming: slimTools (default on) drops redundant schema metadata (examples, default, title, …) and slimDescriptions (default on) cuts descriptions over 240 chars to their opening sentence; parameter descriptions are never touched. toolFilter (default off) caps lists over 8 tools to the first 8 plus every tool already used in the conversation.

Multimodal (image) messages are never summarized away, and image endpoints (/v1/images/*) are never inspected.

LLM-Driven Compression

When the prunable span (everything except the recent tail) exceeds the threshold, the proxy asks the same model to summarize it and sends the client's leading system prompts, the summary, and the messages since:

  • Structured summaries: the model must fill sections — Task, Constraints, User Turns, Files, Decisions, Execution Anchors, State — preserving file paths, error strings, commands and every user instruction verbatim.
  • Fold-forward caching: the summary is cached per conversation and only refreshed after every few new messages; between refreshes the cached summary is substituted instantly.
  • Branch safety: if the client's history before the summary changes (branching, client-side compaction), state resets and re-summarizes.
  • Fail-open: if the summarize call fails, the request is forwarded uncompressed.
  • Thinking models: the summarize call asks for thinking off; if the engine returns empty content anyway, the reasoning text itself is used.

Visibility: log line, X-DCP-Compressed response header, and an optional one-line notice in the response's reasoning channel (disable with "notify": false).

Config Knobs

Managed by the GUI or hand-edited in config.json next to the executable:

compressThreshold — est. tokens in the prunable span before first compression (default 50000).

compressEvery — new messages between re-compressions (default 5).

summaryMaxTokens — max tokens for summarize calls (default 2000).

fidelity — "high" (default, lossless-biased) or "compact" for tighter pruning and terser summaries.

stripReasoning — strip old thinking traces (default true).

contextWindow — model context size; if set, the compression threshold auto-caps and requests are hard-trimmed as the context nears full.

keepRecent — trailing messages always forwarded verbatim (default 6).

maxToolChars — tool outputs longer than this are pruned (default 6000).

insecureTLS — skip upstream TLS verification for self-signed endpoints (default false).

terse — append a brevity directive to the system prompt so replies stay short (default false).

effortRouting — send reasoning_effort: "low" on tool-resume turns when the client left it unset (default false).

headTail — head and tail size kept when pruning (default 1500 each).

slimTools — drop redundant JSON-schema metadata from tool definitions (default true).

slimDescriptions — cut tool descriptions over 240 chars to their first sentence (default true); parameter descriptions stay intact.

redactSecrets — mask credentials in tool output and tool-call arguments, recent messages included (default true). Counted as redacted on /health and in the GUI stats.

toolFilter — when the tools list exceeds 8, keep the first 8 plus every tool the conversation already called (default false).

promptCacheKey — send a stable prompt_cache_key so engines with prefix caching reuse the conversation prefix (default true).

maxOutputTokens — cap max_tokens on requests that do not set one (default unset: engine default).

responseCache — reuse byte-identical non-streaming replies for a short window (default false); duplicate in-flight requests are always coalesced.

Compact fidelity trades detail for context space: prune window 2500 chars (head/tail 400), keep-last 4 messages, summary default 1200 tokens. Explicit knobs always win over the preset.

In the GUI every knob is editable under Advanced → ⚙ Tune…: empty fields mean built-in defaults, Reset clears all overrides, Save applies them to the running proxy without a restart, and the collapsed Advanced card lists the active overrides.

The GUI

  • Upstreams: add/remove named engines; the first is default.
  • Advanced tuning modal: Behaviour, History pruning, LLM compression and Request shaping — every knob in one place, applied live (no restart), with a one-line override digest on the collapsed card.
  • Windows: start-with-Windows (hidden to tray).
  • Diagnostics: live tok/s readout, token counters (auto-formatted as K/M), secrets-redacted and filter-hit tiles under More metrics, and a request log (dcp-proxy-gui.log) — first stop for any routing question.

Privacy and Keys

  • API keys live only in your client. The proxy forwards the Authorization header untouched and never stores it.
  • The proxy runs locally; no telemetry, no accounts, no external services.
  • Summaries are produced by the same engine your client already talks to — the proxy adds no third parties.

Troubleshooting

  • Client can't connect: check the port in the GUI and that the proxy is running (tray icon).
  • Engine not reached: use Test connection; check dcp-proxy-gui.log for the reconstructed URL.
  • Wrong upstream: confirm the base URL shape (/<name>/v1) or the X-DCP-Upstream header.
  • Summaries never trigger: history is below the threshold; lower compressThreshold to test.
  • Poor summary quality: keep fidelity on high, raise summaryMaxTokens, or set contextWindow so compression triggers earlier.
  • "Unknown publisher" on launch: the executable is signed with the author's certificate; Windows may still prompt the first time.
  • A credential shows as [REDACTED]: secret redaction is on by default. This is the safe default — the engine never needs your API keys in tool output. Set "redactSecrets": false to forward them anyway.
  • A tool's description looks cut off: slimDescriptions keeps the opening sentence of long descriptions. Set it to false for tools whose usage instructions live in later sentences.

Best Practices

  • Set contextWindow to your model's real context size and let the proxy manage thresholds.
  • Keep fidelity on high for coding agents; switch to compact only when context space is tight.
  • Leave reasoning stripping on — engines never need old chain-of-thought back.
  • Watch saved est. tokens on /health to confirm savings.
  • If a session misbehaves, disable compression temporarily by raising the threshold and compare.