-
Notifications
You must be signed in to change notification settings - Fork 0
fix(opencode): move local development config to NVIDIA NIM #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b0ea760
4b2421e
6f8fbf5
15f80bf
2bb47e2
aa4a018
559a77d
f3bf4bb
def2dfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| { | ||
| "$schema": "https://opencode.ai/config.json", | ||
| "model": "github-models/openai/gpt-5", | ||
| "small_model": "github-models/deepseek/deepseek-v3-0324", | ||
| "enabled_providers": ["github-models"], | ||
| "model": "nvidia-nim/nvidia/llama-3.3-nemotron-super-49b-v1.5", | ||
| "small_model": "nvidia-nim/meta/llama-3.1-8b-instruct", | ||
| "enabled_providers": ["nvidia-nim"], | ||
| "mcp": { | ||
| "codegraph": { | ||
| "type": "local", | ||
|
|
@@ -37,38 +37,37 @@ | |
| } | ||
| }, | ||
| "provider": { | ||
| "github-models": { | ||
| "nvidia-nim": { | ||
| "npm": "@ai-sdk/openai-compatible", | ||
| "name": "GitHub Models", | ||
| "name": "NVIDIA NIM", | ||
| "options": { | ||
| "baseURL": "https://models.github.ai/inference", | ||
| "apiKey": "{env:STRIX_GITHUB_MODELS_TOKEN}" | ||
| "baseURL": "https://integrate.api.nvidia.com/v1", | ||
| "apiKey": "{env:NVIDIA_API_KEY}" | ||
| }, | ||
| "models": { | ||
| "openai/gpt-5": { | ||
| "name": "OpenAI GPT-5", | ||
| "nvidia/llama-3.3-nemotron-super-49b-v1.5": { | ||
| "name": "NVIDIA Llama 3.3 Nemotron Super 49B v1.5", | ||
| "tool_call": true, | ||
| "reasoning": true, | ||
| "limit": { | ||
| "context": 200000, | ||
| "output": 100000 | ||
| "context": 131072, | ||
| "output": 65536 | ||
| } | ||
| }, | ||
| "deepseek/deepseek-r1-0528": { | ||
| "name": "DeepSeek R1 0528", | ||
| "meta/llama-3.1-8b-instruct": { | ||
| "name": "Meta Llama 3.1 8B Instruct (NIM)", | ||
| "tool_call": true, | ||
| "reasoning": true, | ||
| "limit": { | ||
| "context": 128000, | ||
| "context": 131072, | ||
| "output": 4096 | ||
| } | ||
| }, | ||
| "deepseek/deepseek-v3-0324": { | ||
| "name": "DeepSeek V3 0324", | ||
| "meta/llama-3.3-70b-instruct": { | ||
| "name": "Meta Llama 3.3 70B Instruct (NIM)", | ||
| "tool_call": true, | ||
| "limit": { | ||
| "context": 128000, | ||
| "output": 4096 | ||
| "context": 131072, | ||
| "output": 8192 | ||
|
Comment on lines
+65
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- candidate files ---'
git ls-files | grep -E '(^|/)(opencode\.jsonc|AGENTS\.md|ARCHITECTURE\.md|tests/unit/opencode-config\.test\.mjs|\.jules/)' || true
printf '%s\n' '--- opencode.jsonc lines 1-85 ---'
cat -n opencode.jsonc | sed -n '1,85p'
printf '%s\n' '--- config test ---'
if [ -f tests/unit/opencode-config.test.mjs ]; then
cat -n tests/unit/opencode-config.test.mjs
fi
printf '%s\n' '--- repository instructions ---'
for f in AGENTS.md ARCHITECTURE.md; do
if [ -f "$f" ]; then
printf '%s\n' "--- $f ---"
cat -n "$f"
fi
done
printf '%s\n' '--- relevant symbols and documentation ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' \
'limit\.output|max_tokens|meta/llama-3\.3-70b-instruct|NVIDIA|NIM|opencode\.jsonc' \
. | head -250Repository: ContextualWisdomLab/scopeweave Length of output: 12750 🌐 Web query:
💡 Result: In the official NVIDIA NIM API documentation for meta/llama-3.3-70b-instruct, the Citations:
🌐 Web query:
💡 Result: In OpenCode, you can configure model limits, including context and output token counts, directly within your configuration file [1][2]. This allows the application to accurately manage its internal token tracking and context management [1][2]. ### Configuring Model Limits You can define specific limits for individual models in your Citations:
🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- relevant learning documents ---'
for f in .jules/bolt.md .jules/palette.md .jules/sentinel.md; do
printf '%s\n' "--- $f ---"
cat -n "$f"
done
printf '%s\n' '--- deterministic configuration check ---'
python3 - <<'PY'
import json
from pathlib import Path
config = json.loads(Path("opencode.jsonc").read_text())
model = config["provider"]["nvidia-nim"]["models"]["meta/llama-3.3-70b-instruct"]
output = model["limit"]["output"]
print(f"model={model['name']}")
print(f"configured_output={output}")
print(f"provider_max_tokens=4096")
print(f"exceeds_provider_limit={output > 4096}")
test_text = Path("tests/unit/opencode-config.test.mjs").read_text()
print(f"test_asserts_output_limit={'limit.output' in test_text or 'output' in test_text}")
print(f"test_asserts_4096={'4096' in test_text}")
PYRepository: ContextualWisdomLab/scopeweave Length of output: 37689
NVIDIA NIM의 수정안- "output": 8192
+ "output": 4096🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import assert from 'node:assert/strict'; | ||
| import { readFileSync } from 'node:fs'; | ||
| import test from 'node:test'; | ||
|
|
||
| const config = JSON.parse(readFileSync(new URL('../../opencode.jsonc', import.meta.url), 'utf8')); | ||
|
|
||
| test('OpenCode development config uses only currently hosted NVIDIA NIM candidates', () => { | ||
| assert.equal(config.model, 'nvidia-nim/nvidia/llama-3.3-nemotron-super-49b-v1.5'); | ||
| assert.equal(config.small_model, 'nvidia-nim/meta/llama-3.1-8b-instruct'); | ||
| assert.deepEqual(config.enabled_providers, ['nvidia-nim']); | ||
|
|
||
| const provider = config.provider?.['nvidia-nim']; | ||
| assert.ok(provider, 'NVIDIA NIM provider must be configured'); | ||
| assert.equal(provider.options?.baseURL, 'https://integrate.api.nvidia.com/v1'); | ||
| assert.equal(provider.options?.apiKey, '{env:NVIDIA_API_KEY}'); | ||
| assert.ok(provider.models?.['nvidia/llama-3.3-nemotron-super-49b-v1.5']); | ||
| assert.ok(provider.models?.['meta/llama-3.1-8b-instruct']); | ||
| assert.ok(provider.models?.['meta/llama-3.3-70b-instruct']); | ||
|
|
||
| const serialized = JSON.stringify(config); | ||
| assert.doesNotMatch(serialized, /github-models/i); | ||
| assert.doesNotMatch(serialized, /STRIX_GITHUB_MODELS_TOKEN/); | ||
| assert.doesNotMatch(serialized, /COPILOT_GITHUB_TOKEN/); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
관사를 수정하십시오.
Line 57의
a NVIDIA NIM-only candidate set은 문법적으로 맞지 않습니다.an NVIDIA NIM-only candidate set으로 변경하십시오.🤖 Prompt for AI Agents