> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/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. > Plugin-neutral evidence recording for managed LLM calls. Managed, bounded LLM optimization accounting. ## Docs - [Struct LlmOptimization Recorder](https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/struct-llmoptimizationrecorder.md): Cloneable capability for adding evidence to the current managed LLM call. - [Constant MAX_LLM_OPTIMIZATION_CONTRIBUTIONS](https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-contributions.md): Maximum contributions retained for one LLM call. - [Constant MAX_LLM_OPTIMIZATION_CONTRIBUTION_ATTEMPTS](https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-contribution-attempts.md): Maximum contribution records inspected before the recorder seals itself. - [Constant MAX_LLM_OPTIMIZATION_CONTRIBUTION_BYTES](https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-contribution-bytes.md): Maximum serialized size of one complete contribution envelope. - [Constant MAX_LLM_OPTIMIZATION_TOTAL_CONTRIBUTION_BYTES](https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/constant-max-llm-optimization-total-contribution-bytes.md): Maximum aggregate serialized size of all contribution envelopes for one call. - [Function current_llm_optimization_recorder](https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/fn-current-llm-optimization-recorder.md): Return a recorder for the current execution intercept, if it is managed by Relay. - [Function record_llm_optimization_contribution](https://docs.nvidia.com/nemo/relay/dev/reference/api/rust-library-reference/nemo-relay/api/optimization/fn-record-llm-optimization-contribution.md): Best-effort shorthand for recording evidence on the current managed call.