anomalyco / anomalyco/opencode
providers: nvidia rejects unsupported prompt_cache_key sent by V2 (OpenAI-compatible runtime)
@rekram1-node is already working on this.
Since Sep 15, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
OpenCode 2.0.3 sends the prompt_cache_key parameter to OpenAI-compatible providers by default. The NVIDIA NIM API (https://integrate.api.nvidia.com/v1) does not support it and rejects the request, so most NVIDIA models are unusable in V2.
Environment
- opencode version: 2.0.3
- OS: Linux 7.2.5-1-cachyos x86_64 (CachyOS)
- Terminal: TERM=xterm-256color (Kitty), COLORTERM=truecolor
- Shell: /usr/bin/zsh
- Install/channel: release (CachyOS package
opencode 2.0.3-1.1, channel=latest) - Active plugins: TUI
plugins/sidebar-mimo/tui.tsx,opencode-voice-modified/tui.js, serverplugins/nvidia-filter/index.ts, plus-opencode.sidebar.contextincli.json. (None related to the provider request path.)
Reproduction
- Configure the built-in
nvidiaprovider (API key fromhttps://integrate.api.nvidia.com/v1). - Run any of the affected models headless:
opencode run --standalone --model nvidia/meta/muse-glimmer-30b "di OK" - Observe the error.
Expected Behavior
The request should succeed (or at least not include parameters the provider does not support). The same models return HTTP 200 when called directly against the NVIDIA API without prompt_cache_key.
Actual Behavior
Error: Validation: Unsupported parameter(s): `prompt_cache_key`
Affected built-in NVIDIA models (all HTTP 200 when called directly):
meta/muse-glimmer-30b, nvidia/nemotron-3-super-120b-a12b, nvidia/nemotron-3-ultra-550b-a55b, nvidia/nemotron-3.5-lightning-30b-a3b, nvidia/nemotron-3-nano-omni-30b-a3b-reasoning.
Models that still work (no prompt_cache_key sent): openai/gpt-oss-20b, meta/llama-3.2-11b-vision-instruct.
Additional Context
The bundled OpenAI-compatible chat runtime appears to add the parameter unconditionally unless cache === "none":
// request body
prompt_cache_key: e.cache === "none" ? void 0 : n.promptCacheKey ?? e.promptCacheKey
// and
Tb = (e) => { if (e.cache === "none" || e.promptCacheKey === void 0) return; ... }
There is a provider predicate that already excludes NVIDIA (g = n === "nvidia" || baseURL.includes("integrate.api.nvidia.com")) for some caching behaviour, but the prompt_cache_key field is still sent.
There is no configuration to disable it:
provider.nvidia.options.cache = "none"(V1) → still sent.providers.nvidia.models.<id>.settings.cache = "none"(V2) → still sent.- The
cacheoption is not part of the config schema.
Workaround used temporarily (and removed): a local reverse proxy that strips prompt_cache_key (also prompt_cache_retention, safety_identifier, store) before forwarding to NVIDIA. That made all affected models work, confirming the parameter is the sole cause.
Reproducible: yes, consistently, for all affected models.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.