Files
anyllm-proxy/crates/rtk/Cargo.toml
whit3rabbitandClaude Opus 4.8 d155bfd148 feat: RTK tool-output compression and opt-in prompt optimizer
RTK (anyllm_rtk crate): command-aware filtering of tool-result text
(test/build/git/log output) via a catalog of 55 declarative filters ported
from OmniRoute (MIT). IO-free, deterministic, prompt-cache safe (cache_control
blocks preserved byte-for-byte). Wired into the Anthropic passthrough (stream +
non-stream) and OpenAI-translate paths, gated per-model via RTK_MODELS.
RTK_COMPRESS env / admin toggle, rtk_compress/rtk_models runtime config.

Optimizer (anyllm_optimize_* crates): opt-in Frozen-Frontier Extractive
Compression of long client-sent conversation history for OpenAI Chat
Completions, the Anthropic translate path, and the Anthropic passthrough path
(client history only, never proxy tool-loop turns). OPTIMIZER_MODE=off|shadow|
live env / admin toggle; live places a cache_control breakpoint at the frontier
over raw bytes. Optional LLMLingua-2 ONNX scorer behind the optimizer-onnx
feature (model fetched on demand, never bundled). New optimizer_* metrics
counters and GET/POST /admin/api/optimizer/model endpoints.

Both features expose runtime config + Settings UI controls and fail open on any
error. Adds workspace members, CI lint/test for the optimizer-onnx feature, and
gitignore rules for downloaded ONNX artifacts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 19:55:33 -05:00

18 lines
666 B
TOML

[package]
name = "anyllm_rtk"
description = "Command-aware tool-output compression for the anyllm proxy (RTK port)"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
categories = ["compression", "web-programming"]
keywords = ["anthropic", "llm", "compression", "tool-output", "rtk"]
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Line/pattern filtering is regex-driven. Rust's `regex` crate (no lookaround,
# no backreferences) covers 52/55 vendored filters directly; the 3 lookahead
# detection patterns fail to compile and are skipped fail-open (see filter.rs).
regex = "1"