Skip to content

About

opencode + free NVIDIA Nemotron 3 Ultra on FreeBSD via the Linuxulator - plus a real upstream prompt_cache_key bug found along the way

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

opencode + free Nemotron on FreeBSD

A short follow-up to claude-code-freebsd: does the same Linuxulator trick generalize past Claude Code specifically, to any Linux-only Node CLI? Yes — and along the way this turned up a real, currently-open upstream bug worth documenting on its own.

The generalization is trivial — that's the point

claude-code-freebsd goes deep on why Claude Code specifically is hard to get running on FreeBSD: no freebsd-x64 entry in its per-platform native binary matrix, an npm postinstall script that only fetches the right binary if process.platform reports linux, a .exe-suffixed ELF binary that confuses the obvious node script.js invocation, and so on.

opencode (the anomalyco/opencode fork; originally sst/opencode) hits none of that. Once the Linuxulator environment from the companion writeup exists — linux_base-rl9, a real linux-x64 Node tarball under /compat/linux/opt/node — installing it is a single command, no gotchas:

export PATH=/compat/linux/opt/node/bin:$PATH
npm install -g opencode-ai@latest
opencode --version
# 1.18.30

That's the whole point of this writeup existing separately: the hard part was building the Linuxulator + Node base once (see the other repo), not each individual tool on top of it. Any well-behaved linux-x64 Node CLI rides for free after that.

Getting a free frontier model into it: Nemotron 3 Ultra

opencode ships its own hosted proxy — "OpenCode Zen" — with a handful of models available with no API key of your own required, including NVIDIA's open-weight nemotron-3-ultra-550b-a55b (550B total params, 55B active, MoE). Minimal config:

// ~/.config/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "opencode/nemotron-3-ultra-free"
}
opencode run "one sentence, what model are you?"

No signup, no key, works immediately through the same Linuxulator install.

The harder path (your own NVIDIA key) currently doesn't work — and here's the actual bug

NVIDIA also serves Nemotron directly, for free, via an OpenAI-compatible endpoint (https://integrate.api.nvidia.com/v1) — sign in at build.nvidia.com, generate a key, done. Wiring that up as a custom opencode provider looks like it should just work:

{
  "provider": {
    "nvidia": {
      "npm": "@ai-sdk/openai-compatible",
      "env": ["NVIDIA_API_KEY"],
      "options": {
        "baseURL": "https://integrate.api.nvidia.com/v1",
        "setCacheKey": false
      }
    }
  }
}

It doesn't. Every request fails immediately, before it even reaches a model:

Error: Validation: Unsupported parameter(s): `prompt_cache_key`

Direct curl against the same endpoint, same key, with prompt_cache_key simply omitted from the body, works fine — the field itself is what NVIDIA's API rejects, and opencode's v2 request builder sends it unconditionally to every @ai-sdk/openai-compatible provider, regardless of the documented setCacheKey option (which has no effect in this version — the code path that used to honor it was lost in a v2 request-construction refactor).

This is a real, already-filed upstream bug, not something specific to this setup: anomalyco/opencode#45113. It was originally reported against a third-party relay gateway; the NVIDIA case here is a second, independent confirmation against a major vendor's first-party API, added as a comment on that issue rather than a duplicate.

Until that lands, the practical fix is what's above: use the built-in opencode/nemotron-3-ultra-free (OpenCode Zen) model, not a hand-configured custom provider — Zen models aren't affected. If you specifically need your own NVIDIA key (higher/private rate limits, a different Nemotron variant, usage that shouldn't run through opencode's own proxy), pin opencode-ai to a 1.18.x release instead of the v2/beta line — v1 only sets promptCacheKey for a specific allowlist of provider packages, and @ai-sdk/openai-compatible isn't on it, so the field is never sent.

Environment this was verified on

  • FreeBSD 15.1-RELEASE, amd64 (same host as claude-code-freebsd)
  • linux_base-rl9 9.7, Linuxulator active
  • Node.js v22.14.0 (official linux-x64 tarball, under /compat/linux/opt/node)
  • opencode-ai 1.18.30 (npm) — confirmed not affected by #45113
  • opencode2 (anomalyco beta, v0.0.0-beta-19425) — confirmed affected, separately, on Linux x64 (not FreeBSD-specific)

Part of the same small series as claude-code-freebsd / claude-code-openbsd on running AI developer tooling on BSD without reaching for a VM by default.

About

opencode + free NVIDIA Nemotron 3 Ultra on FreeBSD via the Linuxulator - plus a real upstream prompt_cache_key bug found along the way

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors