Product

A control layer for
every context decision.

TrimLayer accepts source context and an optional task, protects required evidence, and returns optimized_context or the unchanged original. Your application controls the next model call.

CONTEXT
01InspectSource and task
02ProtectEvidence locks
03ReturnOptimized or original

The engine

One request.
Four explicit stages.

The optimize API handles context only. It does not accept provider credentials or call a model on your behalf.

01 · INSPECT

Understand the request

Recognize content type, declared task and structures that must remain intact.

02 · PROTECT

Lock critical evidence

Keep numbers, identifiers, instructions, code boundaries and required evidence outside lossy transforms.

03 · OPTIMIZE

Select the safe path

Use task-scoped retrieval, verified transformations or exact recoverability according to policy.

04 · VERIFY

Accept or fall back

Record the decision and return the original context when confidence or verification fails.

Structure aware

Preserve what
your workflow expects.

Text can be optimized without flattening the surrounding JSON, code or document structure.

Native JSONKnown fields preserved
Focused outputoptimized_context returned
Tool callsArguments remain structured
Unknown fieldsFail closed