Skip to content

docs: document the opt-in response cache (stage 1/5)#405

Open
zhongxuanwang-nv wants to merge 1 commit into
NVIDIA:mainfrom
zhongxuanwang-nv:docs/response-cache-stage1
Open

docs: document the opt-in response cache (stage 1/5)#405
zhongxuanwang-nv wants to merge 1 commit into
NVIDIA:mainfrom
zhongxuanwang-nv:docs/response-cache-stage1

Conversation

@zhongxuanwang-nv

@zhongxuanwang-nv zhongxuanwang-nv commented Jul 10, 2026

Copy link
Copy Markdown
Member

Overview

Documents the feature in #404 — the branch is based directly on main, so the diff here is the documentation change only and can be reviewed standalone. Kept in draft only so it merges after #404 (the page should not land before the feature it documents).

Documents the opt-in response cache on the documentation site: a new Response Cache page in the Adaptive plugin section, written in plain language with runnable examples — when to use it, a plugins.toml quickstart, per-language plugin configuration (Python/Node.js/Rust), what gets cached (complete answers only, streaming aggregation and native replay), how cache keys are built, observability (nemo-relay doctor, response_cache marks), a full field reference, and the unredacted-at-rest caveat for shared Redis deployments. Docs PR 1/5 of the response-cache series.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Adds docs/configure-plugins/adaptive/response-cache.mdx (position 5 in the Adaptive plugin section), following the ACG page skeleton: intro → When To Use It → plugins.toml example → Plugin Configuration tabs → Manual API tabs → What Gets Cached → Cache Keys → Observability → Fields → Common Validation Failures.
  • Cross-links the new page from docs/configure-plugins/adaptive/about.mdx (coordination list and Pages list) and docs/configure-plugins/adaptive/configuration.mdx (Component Shape table and area-pages paragraph).
  • No README changes: feature documentation lives on the docs site alongside the other adaptive plugin feature pages.
  • Validated with fern check and fern docs broken-links --strict (the only reported broken links are the pre-existing generated API-reference pages, regenerated by just docs).

Where should the reviewer start?

docs/configure-plugins/adaptive/response-cache.mdx — the page is the whole change (one commit, docs files only).

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • Documentation
    • Added guidance for enabling and configuring optional response caching for repeated LLM requests.
    • Documented cache behavior, including TTLs, request matching, streaming replay, bypass conditions, and failure handling.
    • Added details on cache keys, observability signals, configurable settings, backend requirements, and validation warnings.
    • Updated Adaptive configuration and navigation guidance to include the new Response Cache documentation.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The Adaptive plugin documentation now covers opt-in response caching, including configuration, runtime setup, cache eligibility and replay, key construction, observability, configurable fields, storage warnings, and validation failures.

Changes

Adaptive response cache

Layer / File(s) Summary
Cache discovery and configuration
docs/configure-plugins/adaptive/about.mdx, docs/configure-plugins/adaptive/configuration.mdx, docs/configure-plugins/adaptive/response-cache.mdx
Adds response cache navigation, response_cache configuration guidance, setup examples, and Python, Node.js, and Rust plugin configuration instructions.
Runtime usage paths
docs/configure-plugins/adaptive/response-cache.mdx
Documents manual Adaptive runtime construction, registration, shutdown, and response cache control across supported languages.
Cache behavior and validation
docs/configure-plugins/adaptive/response-cache.mdx
Defines cache eligibility, streaming replay, cache-key construction, observability marks, configurable fields, unredacted storage, and validation failures.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the docs-only response cache change.
Description check ✅ Passed The description matches the template with Overview, Details, reviewer start, checkboxes, and related issue information.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:XXL PR is very large Documentation documentation-related lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown

License Diff

Compared against origin/main.

Lockfile license changes

Lockfile License Changes

Rust

Added

  • None

Removed

  • None

Updated/Changed

  • None

Node

Added

  • None

Removed

  • None

Updated/Changed

  • None

Python

Added

  • None

Removed

  • None

Updated/Changed

  • None
Status output
[license-diff] selected languages: rust, node, python
[license-diff] generating current inventory
[license-diff] current: generating Rust inventory
[license-diff] current: Rust inventory complete (379 packages)
[license-diff] current: generating Node inventory
[license-diff] current: Node inventory complete (363 packages)
[license-diff] current: generating Python inventory
[license-diff] current: Python inventory complete (105 packages)
[license-diff] current inventory complete
[license-diff] checking out base ref origin/main into a temporary worktree
[license-diff] base: generating Rust inventory
[license-diff] base: Rust inventory complete (379 packages)
[license-diff] base: generating Node inventory
[license-diff] base: Node inventory complete (363 packages)
[license-diff] base: generating Python inventory
[license-diff] base: Python inventory complete (105 packages)
[license-diff] base inventory complete
[license-diff] removing temporary base worktree
[license-diff] comparing inventories
[license-diff] rendering Markdown output
[license-diff] done

@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from be2d512 to fa77ecb Compare July 11, 2026 00:55
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from fa77ecb to 1e7cafa Compare July 11, 2026 01:09
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from 1e7cafa to c381f1f Compare July 13, 2026 15:47
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from c381f1f to d1089ab Compare July 13, 2026 23:57
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from d1089ab to f369cd2 Compare July 14, 2026 01:21
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from f369cd2 to bb99464 Compare July 14, 2026 04:57
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from bb99464 to 2b4a5e8 Compare July 14, 2026 20:34
@github-actions github-actions Bot added size:M PR is medium and removed size:XXL PR is very large lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code labels Jul 14, 2026
Adds a Response Cache page to the adaptive plugin docs: when to use it,
a plugins.toml quickstart, per-language plugin configuration, the
complete-answers-only storage rules with streaming aggregation and
native replay, exact-request key normalization, the response_cache mark
and doctor surfaces, a field reference, and the unredacted-at-rest
caveat for shared Redis deployments. Links the page from the adaptive
About and Configuration pages.

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@zhongxuanwang-nv
zhongxuanwang-nv force-pushed the docs/response-cache-stage1 branch from 2b4a5e8 to 47df001 Compare July 14, 2026 21:15
@zhongxuanwang-nv zhongxuanwang-nv added the DO NOT MERGE PR should not be merged; see PR for details label Jul 16, 2026
@zhongxuanwang-nv
zhongxuanwang-nv marked this pull request as ready for review July 16, 2026 21:08
@zhongxuanwang-nv
zhongxuanwang-nv requested review from a team and lvojtku as code owners July 16, 2026 21:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/configure-plugins/adaptive/about.mdx`:
- Around line 55-56: The adaptive documentation link changes require link
validation. Run just docs-linkcheck and fix any broken links across
docs/configure-plugins/adaptive/about.mdx lines 55-56,
docs/configure-plugins/adaptive/configuration.mdx lines 38-40, and
docs/configure-plugins/adaptive/response-cache.mdx lines 16-20; make no direct
changes unless the check identifies invalid links.

In `@docs/configure-plugins/adaptive/response-cache.mdx`:
- Around line 10-14: Update the response-cache description to avoid
unconditional guarantees that repeats are instant, free, or always served from
storage. State that cache reuse can avoid the provider call when a valid entry
is available, while preserving that expiry, bypass settings, cache errors, and
store latency may result in a live request or additional cost; retain the claim
that cached responses preserve usage fields and response shape.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 5a728a28-1e7e-4002-9e0c-683197ab1efb

📥 Commits

Reviewing files that changed from the base of the PR and between 45b3b44 and 47df001.

📒 Files selected for processing (3)
  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)

In MDX files, top-of-file comments must use JSX comment delimiters ({/* to open and */} to close); do not use HTML comments for MDX SPDX headers

Files:

  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

Update README.md, fern/, package READMEs, and binding-support notes when public behavior, package names, examples, or supported bindings change.

**/*.{md,mdx}: Prefer the documented public API, not internal shortcuts
Keep package names, repo references, and build commands current
Keep release-process and release-notes guidance in repo-maintainer docs such as RELEASING.md, not as user-facing docs pages or CHANGELOG.md
Keep stable user-facing wrappers at scripts/ root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, and grpc-v1 protocol details on separate pages

If links in documentation change, run just docs-linkcheck.

Files:

  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
**/*.{md,markdown,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Markdown/MDX documentation files using the HTML comment block form.

Files:

  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
{docs,examples}/**/*

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update docs and examples.

Files:

  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
docs/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If documentation examples or commands under docs/ change, run the targeted docs checks appropriate to the change.

Files:

  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.

Files:

  • docs/configure-plugins/adaptive/about.mdx
  • docs/configure-plugins/adaptive/configuration.mdx
  • docs/configure-plugins/adaptive/response-cache.mdx
🔇 Additional comments (3)
docs/configure-plugins/adaptive/about.mdx (1)

25-25: LGTM!

docs/configure-plugins/adaptive/response-cache.mdx (2)

1-7: LGTM!


177-183: 🎯 Functional Correctness

Keep wait_for_idle() as a direct call

wait_for_idle() is synchronous in the Python API, so this example should not await it.

			> Likely an incorrect or invalid review comment.

Comment on lines +55 to +56
- [Response Cache](/configure-plugins/adaptive/response-cache) explains the opt-in LLM response cache:
turning it on, what gets cached, and how savings are reported.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

just docs-linkcheck

Repository: NVIDIA/NeMo-Relay

Length of output: 197


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --glob '!/.git' 'docs-linkcheck|linkcheck|justfile|Justfile' .

Repository: NVIDIA/NeMo-Relay

Length of output: 2517


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --glob '!/.git' 'docs-linkcheck|linkcheck' . || true

Repository: NVIDIA/NeMo-Relay

Length of output: 1034


Run just docs-linkcheck for the adaptive docs link changes.

📍 Affects 3 files
  • docs/configure-plugins/adaptive/about.mdx#L55-L56 (this comment)
  • docs/configure-plugins/adaptive/configuration.mdx#L38-L40
  • docs/configure-plugins/adaptive/response-cache.mdx#L16-L20
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/configure-plugins/adaptive/about.mdx` around lines 55 - 56, The adaptive
documentation link changes require link validation. Run just docs-linkcheck and
fix any broken links across docs/configure-plugins/adaptive/about.mdx lines
55-56, docs/configure-plugins/adaptive/configuration.mdx lines 38-40, and
docs/configure-plugins/adaptive/response-cache.mdx lines 16-20; make no direct
changes unless the check identifies invalid links.

Source: Coding guidelines

Comment on lines +10 to +14
Use the response cache when the same LLM request is made more than once and the
repeat should be served from a store instead of paying for the call again. A
repeat of an identical request returns the earlier answer instantly, at no
cost, and unchanged — usage fields intact, so a cached reuse is
shape-identical to a live call.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Avoid unconditional “instant” and “no cost” guarantees.

A matching request can still run live due to expiry, bypass_rate, or fail-open cache errors; Redis hits also have store latency/cost. Describe avoidance of the provider call conditionally.

Proposed wording
- repeat of an identical request returns the earlier answer instantly, at no
- cost, and unchanged — usage fields intact, so a cached reuse is
- shape-identical to a live call.
+ an eligible request matching an unexpired cache entry is served from the
+ store without calling the provider. Cached responses preserve the stored
+ response shape and usage fields.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Use the response cache when the same LLM request is made more than once and the
repeat should be served from a store instead of paying for the call again. A
repeat of an identical request returns the earlier answer instantly, at no
cost, and unchanged — usage fields intact, so a cached reuse is
shape-identical to a live call.
Use the response cache when the same LLM request is made more than once and the
repeat should be served from a store instead of paying for the call again. An
eligible request matching an unexpired cache entry is served from the store
without calling the provider. Cached responses preserve the stored response
shape and usage fields.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/configure-plugins/adaptive/response-cache.mdx` around lines 10 - 14,
Update the response-cache description to avoid unconditional guarantees that
repeats are instant, free, or always served from storage. State that cache reuse
can avoid the provider call when a valid entry is available, while preserving
that expiry, bypass settings, cache errors, and store latency may result in a
live request or additional cost; retain the claim that cached responses preserve
usage fields and response shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE PR should not be merged; see PR for details Documentation documentation-related size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant