> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Module optimization

> Plugin-neutral evidence recording for managed LLM calls. Managed, bounded LLM optimization accounting.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`.

Plugin-neutral evidence recording for managed LLM calls. Managed, bounded LLM optimization accounting.

## Structs

* [LlmOptimizationRecorder](/reference/api/rust-library-reference/nemo-relay/api/optimization/struct-llmoptimizationrecorder): Cloneable capability for adding evidence to the current managed LLM call.

## Constants

* [MAX\_LLM\_OPTIMIZATION\_CONTRIBUTIONS](/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-contributions): Maximum contributions retained for one LLM call.
* [MAX\_LLM\_OPTIMIZATION\_CONTRIBUTION\_ATTEMPTS](/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-contribution-attempts): Maximum contribution records inspected before the recorder seals itself.
* [MAX\_LLM\_OPTIMIZATION\_CONTRIBUTION\_BYTES](/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-contribution-bytes): Maximum serialized size of one complete contribution envelope.
* [MAX\_LLM\_OPTIMIZATION\_TOTAL\_CONTRIBUTION\_BYTES](/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-total-contribution-bytes): Maximum aggregate serialized size of all contribution envelopes for one call.

## Functions

* [current\_llm\_optimization\_recorder](/reference/api/rust-library-reference/nemo-relay/api/optimization/fn-current-llm-optimization-recorder): Return a recorder for the current execution intercept, if it is managed by Relay.
* [record\_llm\_optimization\_contribution](/reference/api/rust-library-reference/nemo-relay/api/optimization/fn-record-llm-optimization-contribution): Best-effort shorthand for recording evidence on the current managed call.