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.
| Surface | Published result | Tokens before and after | Qualified reduction | Fixture gate |
|---|---|---|---|---|
| Prompt and context | #1 of 5 qualified configurations | 6,358 to 1,803 | 71.64% | 5/5 passed |
| Command and tool output | #1; only configuration to qualify | 12,569 to 4,854 | 61.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.
| Case | Surface | Tokens before and after | Reduction | Fixture gate |
|---|---|---|---|---|
| Short request | Prompt/context | 29 to 29 | 0.00% | Pass |
| Redundant prose | Prompt/context | 1,200 to 64 | 94.67% | Pass |
| Retrieved documents | Prompt/context | 1,843 to 755 | 59.03% | Pass |
| Pretty JSON | Tool output | 3,226 to 1,905 | 40.95% | Pass |
| Terminal output | Tool output | 4,591 to 258 | 94.38% | Pass |
| Pytest output | Tool output | 2,315 to 254 | 89.03% | Pass |
| Git log | Tool output | 2,437 to 2,437 | 0.00% | Pass |
| Code context | Prompt/context | 1,735 to 860 | 50.43% | Pass |
| Multilingual repeated context | Prompt/context | 1,551 to 95 | 93.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.
| Harness | Launch command | Applied surface | Important boundary |
|---|---|---|---|
| Claude Code | kendr-opt run claude-code | Successful tool output | Prompt and assistant output are observation-only; the bridge currently requires Node.js 22 or newer |
| OpenCode | kendr-opt run opencode | Current user message and tool output | Experimental history and system hooks are off by default |
| Pi | kendr-opt run pi | System prompt, context messages, and text tool results | Tool narrowing and provider-payload rewriting are disabled |
| OpenClaw | kendr-opt run openclaw | Assembled history and supported message or tool-result text | contextEngine is an exclusive slot; replacement requires --force |
| Hermes Agent | kendr-opt run hermes | Main-agent request, instructions, recognized tools, and string tool results | Auxiliary 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 alias | Profile | Optimizer |
|---|---|---|
| kendr-intelligent | General | Required |
| kendr-intelligent-direct | General | Off; original context |
| kendr-coder | Code | Required |
| kendr-coder-direct | Code | Off; 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
- Kendr Optimizer source repository (source, checked 2026-08-16)
- Kendr Optimizer technical whitepaper (methodology, checked 2026-08-16)
- Frozen v0.1.0-benchmark.5 evidence bundle (benchmark, checked 2026-08-16)
- Complete preservation-gated ranking (benchmark, checked 2026-08-16)
- CLI and provider integration guide (documentation, checked 2026-08-16)
- Kendr Optimizer v0.1.2 release (release, checked 2026-08-16)