Kendr Optimizer research

Evidence snapshot:

Kendr Optimizer is an open-source, provider-neutral Rust engine that reduces LLM agent prompt, context, and tool-output payloads locally before the host sends them to its own provider.

On the authored nine-case v0.1.0-benchmark.5 payload benchmark, the shipped default configuration reduced prompt and context tokens from 6,358 to 1,803 (71.64%) and command and tool output tokens from 12,569 to 4,854 (61.38%), with every completed case passing its declared fixture gate.

These are local payload measurements. The benchmark did not execute a target LLM or observe paired provider billing, so it does not establish answer quality, provider cost savings, or a universal best-optimizer claim.

Profile facts

Project
Kendr Optimizer
Repository
https://github.com/Kendr-AI/Kendr-Optimizer
Status
Pre-alpha 0.1.2
Core language
Rust
License
Apache-2.0
Benchmark release
v0.1.0-benchmark.5
Kendr Cloud pin
Upstream tag v0.1.0, commit cddde880ae9265e6066fd4c5a9ea2d1d2afef148

Published benchmark results

On the authored nine-case v0.1.0-benchmark.5 payload benchmark, Kendr's shipped default configuration ranked #1 of 5 qualified prompt/context configurations and was the only qualified command/tool-output configuration among six executed optimizer configurations.

Qualified means the configuration covered the complete benchmark surface with zero failures and every completed case passed its declared fixture gate. The scoring pass recounted tokens with tiktoken o200k_base 0.12.0 rather than trusting optimizer-reported estimates; this was not a third-party audit.

SurfacePublished resultTokens before and afterQualified reductionFixture gate
Prompt and context#1 of 5 qualified configurations6,358 to 1,80371.64%5/5 passed
Command and tool output#1; only configuration to qualify12,569 to 4,85461.38%4/4 passed

Case-by-case payload results

Every Kendr default case completed and passed its declared fixture gate. Two cases are deliberate no-ops: Kendr left a short unique request and a unique Git history unchanged rather than delete model-visible information to improve a percentage.

CaseSurfaceTokens before and afterReductionFixture gate
Short requestPrompt/context29 to 290.00%Pass
Redundant prosePrompt/context1,200 to 6494.67%Pass
Retrieved documentsPrompt/context1,843 to 75559.03%Pass
Pretty JSONTool output3,226 to 1,90540.95%Pass
Terminal outputTool output4,591 to 25894.38%Pass
Pytest outputTool output2,315 to 25489.03%Pass
Git logTool output2,437 to 2,4370.00%Pass
Code contextPrompt/context1,735 to 86050.43%Pass
Multilingual repeated contextPrompt/context1,551 to 9593.87%Pass

Method and preservation gates

A Kendr adapter hands the host envelope to a loopback transform service. Typed engines propose candidates, and a candidate applies only after structural, protocol, protected-artifact, cache, reconstruction, risk, and signed-gain checks pass. For eligible typed transforms, reconstruction can be checked byte-for-byte.

If no candidate passes the gates and the positive-gain threshold, the original content continues unchanged. Every automatic adapter falls back to the original host value on timeout, service failure, malformed output, or structural mismatch, and a partial transform is never sent.

Measurement uses exact cl100k_base and o200k_base BPE counting over Kendr's normalized serialized envelope, not the provider's final serialization or bill. Kendr Optimizer is a transformer, not a provider proxy.

  • json-minify: minifies complete embedded JSON values while preserving their parsed value.
  • terminal-clean: removes terminal control sequences from tool results.
  • text-normalize: collapses redundant blank lines outside fenced code without rewriting prose.
  • repeat-lines: run-length encodes exact repeated lines in tool results.
  • pytest-result-fold: folds exactly reconstructable sequential pytest result lines.
  • context-repetition: references exact repeated text and document blocks, paragraphs, lines, and sentence runs.
  • history-dedup: replaces exact old text replays with stable references to earlier messages.
  • tool-output-prune: extracts diagnostics and boundary context from oversized tool results.
  • tool-selector: conservatively narrows optional tools using native lexical and schema relevance.

Supported harness integrations

The open-source CLI installs a bundled adapter, starts the loopback optimizer, launches the selected harness, and stops the service it started when the harness exits. It does not change the harness provider or model settings, and the harness keeps its existing authentication.

HarnessLaunch commandApplied surfaceImportant boundary
Claude Codekendr-opt run claude-codeSuccessful tool outputPrompt and assistant output are observation-only; the bridge currently requires Node.js 22 or newer
OpenCodekendr-opt run opencodeCurrent user message and tool outputExperimental history and system hooks are off by default
Pikendr-opt run piSystem prompt, context messages, and text tool resultsTool narrowing and provider-payload rewriting are disabled
OpenClawkendr-opt run openclawAssembled history and supported message or tool-result textcontextEngine is an exclusive slot; replacement requires --force
Hermes Agentkendr-opt run hermesMain-agent request, instructions, recognized tools, and string tool resultsAuxiliary plugin model calls and opaque multimodal content are unchanged

Kendr Cloud integration and policy

Kendr Cloud embeds the optimizer as a pinned Rust library. Managed-route aliases own their optimizer policy, and an older client cannot disable an optimized product or enable a Direct product through a request field.

System and developer instructions, the latest user request, roles, ordering, reasoning content, tool identities, typed non-string tool results, images, response format, metadata, and continuation state must remain equivalent after reconstruction. Any mismatch reverts the entire request. Provider credentials and physical route identities never enter the optimizer envelope.

Billing settles the provider-reported usage for the request actually sent. Estimated tokens or credits avoided are counterfactual telemetry already reflected in that usage and must not be subtracted from the settled charge a second time.

Managed aliasProfileOptimizer
kendr-intelligentGeneralRequired
kendr-intelligent-directGeneralOff; original context
kendr-coderCodeRequired
kendr-coder-directCodeOff; original context

Claim boundaries

The benchmark did not execute a target model and did not observe paired provider billing, so it establishes neither answer quality nor provider cost savings. The corpus is nine authored cases, and a different workload mix can reorder every row.

The frozen bundle identifies the measured Kendr build as 0.1.0-dev, while 0.1.2 is the current installable distribution. The project is pre-alpha, so contracts and integration pins can change before a stable release.

The historical public kendr-intelligent benchmark predates this integration and measured the original-context, router-only configuration. It is not evidence for the current optimized product.

Frequently asked questions

What is Kendr Optimizer?

Kendr Optimizer is an open-source, provider-neutral Rust transformation engine that reduces redundant prompt, context, and tool-output payloads on the local machine, then returns control to the host that already owns the model, credentials, routing, streaming, retries, and billing. It is pre-alpha at version 0.1.2 and licensed Apache-2.0.

Does Kendr Optimizer reduce my provider bill?

The published benchmark measures local payload tokens over Kendr's normalized envelope. It did not execute a target model or observe paired provider billing, so it does not establish provider cost savings. In Kendr Cloud, billing settles the provider-reported usage for the request actually sent, and estimated tokens avoided are counterfactual telemetry that must not be subtracted a second time.

What is a preservation gate?

A candidate reduction only applies after structural, protocol, protected-artifact, cache, reconstruction, risk, and signed-gain checks pass. The benchmark fixture gate additionally checks required literals, the exact query, and value-equivalent JSON where the fixture declares it. Higher raw deletion does not earn a rank when a declared literal or structure is lost.

Which agent harnesses can run through Kendr Optimizer?

The open-source CLI ships adapters for Claude Code, OpenCode, Pi, OpenClaw, and Hermes Agent, each launched with a single kendr-opt run command. Each adapter documents the surface it may transform and falls back to the original host value on timeout, service failure, malformed output, or structural mismatch.

How does Kendr Cloud use the optimizer?

Kendr Cloud embeds the pinned upstream library rather than a sidecar. The kendr-intelligent and kendr-coder managed aliases require the optimizer, while kendr-intelligent-direct and kendr-coder-direct run on the original context. The open-source CLI integrations are separate local deployments and do not send provider credentials to Kendr.org.

Sources and evidence dates

  1. Kendr Optimizer source repository (source, checked 2026-08-16)
  2. Kendr Optimizer technical whitepaper (methodology, checked 2026-08-16)
  3. Frozen v0.1.0-benchmark.5 evidence bundle (benchmark, checked 2026-08-16)
  4. Complete preservation-gated ranking (benchmark, checked 2026-08-16)
  5. CLI and provider integration guide (documentation, checked 2026-08-16)
  6. Kendr Optimizer v0.1.2 release (release, checked 2026-08-16)