-
Notifications
You must be signed in to change notification settings - Fork 374
feat: NVIDIA NIM integration for local AI environment #1615
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
f32bf92
f216155
809c7fe
da877cf
1c3bb05
93d1eb7
b76a570
73501eb
80e5ac6
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "additionalDirectories": [ | ||
| "C:\\Users\\larry\\.abacusai\\tmp\\codellm-prompt-N69pQe", | ||
| "C:\\Users\\larry\\.abacusai\\tmp\\codellm-prompt-cDaecP" | ||
| ], | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(cd \"C:\\\\Users\\\\larry\\\\Documents\\\\GitHub\\\\agent-native\")", | ||
| "Bash(pnpm add *)", | ||
| "Bash(curl *)", | ||
| "Bash(powershell *)", | ||
| "Bash(taskkill *)", | ||
| "Bash(pnpm run dev *)" | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| # HANDOFF DOCUMENT — Phase 10 (NIM Integration Complete) | ||
| **Date**: Saturday, June 27, 2026 | ||
| **Context Usage**: ~60-65% (approaching handoff threshold) | ||
| **Status**: Ready for next session — Dev server running with NVIDIA NIM integration patched | ||
|
|
||
| --- | ||
|
|
||
| ## COMPLETED WORK SUMMARY | ||
|
|
||
| ### Phases 5-9: Previous Session ✅ | ||
| - Windows compatibility patches (merged to main) | ||
| - NVIDIA NIM configuration (.env setup) | ||
| - Initial API connectivity verified (127 models listed) | ||
|
|
||
| ### Phase 10: Framework Integration Fix ✅ | ||
| **ISSUE RESOLVED**: createAgentChatPlugin wasn't reading OPENAI_BASE_URL/OPENAI_MODEL from environment | ||
|
|
||
| **Changes Made** (commit 1c3bb05ac): | ||
| 1. **packages/core/src/agent/engine/ai-sdk-engine.ts**: | ||
| - Updated `PROVIDER_ENV_VARS["openai"]` to include "OPENAI_BASE_URL" and "OPENAI_MODEL" | ||
| - Modified `createAISDKEngine()` function to: | ||
| - Read `OPENAI_BASE_URL` from env and pass as `baseUrl` to engine config | ||
| - Read `OPENAI_MODEL` from env and pass as `model` to engine config | ||
| - Only applies when provider is "openai" (mirrors existing ollama pattern) | ||
|
|
||
| 2. **packages/core/src/agent/engine/builtin.ts**: | ||
| - Updated openai engine description to document OpenAI-compatible gateway support (e.g., NVIDIA NIM) | ||
|
|
||
| **Result**: When AGENT_ENGINE=ai-sdk:openai is set, the framework now: | ||
| - Reads OPENAI_BASE_URL and OPENAI_MODEL from .env at runtime | ||
| - Configures @ai-sdk/openai provider with baseURL for NVIDIA NIM (or any OpenAI-compatible endpoint) | ||
| - Automatically uses nvidia/nemotron-3-ultra-550b-a55b (1M context) for all agent dispatch calls | ||
|
|
||
| --- | ||
|
|
||
| ## CURRENT STATE | ||
|
|
||
| ### Git Status | ||
| ``` | ||
| Branch: Agent-Native_my-local-ai-environment | ||
| Recent commit: 93d1eb742 (HANDOFF.md update) | ||
| Previous commit: 1c3bb05ac (OPENAI env vars integration) | ||
| Working tree: CLEAN | ||
| Commits ahead of origin: 4 | ||
| ``` | ||
|
|
||
| ### .env Configuration (in root, .gitignore excluded) | ||
| ``` | ||
| AGENT_ENGINE=ai-sdk:openai | ||
| OPENAI_BASE_URL=https://integrate.api.nvidia.com/v1 | ||
| OPENAI_API_KEY=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 | ||
|
Comment on lines
+76
to
+80
Contributor
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. 🔴 Committed handoff document contains a live API keyThis file includes a real Additional Info |
||
| OPENAI_MODEL=nvidia/nemotron-3-ultra-550b-a55b | ||
| ``` | ||
|
|
||
| ### Running Services (Current Session — CLEAN RESTART COMPLETE) | ||
| - **Gateway**: http://127.0.0.1:8080 (localhost, all templates routed through) ✅ HEALTHY | ||
| - **Dispatch**: http://127.0.0.1:8092 (dev-lazy prewarming in background) ✅ MOUNTED | ||
| - **Agent Model**: NVIDIA Nemotron 3 Ultra 550B via https://integrate.api.nvidia.com/v1 | ||
| - **Build Status**: packages/core recompiled with env var reading; TypeScript watch mode active | ||
| - **Clean Sweep**: Fresh install (node_modules rebuilt, .nitro/.output caches cleared) — Nitro Vite environment healthy | ||
|
|
||
| --- | ||
|
|
||
| ## NEXT STEPS FOR NEW SESSION | ||
|
|
||
| ### PRIORITY 1: Verify NVIDIA NIM Integration in Dispatch (VALIDATION) ✅ SERVER READY | ||
| **Server is now healthy and running.** | ||
|
|
||
| 1. **Access Dispatch UI**: | ||
| - Browser: http://127.0.0.1:8080/dispatch | ||
| - Sign in (create account if needed) | ||
|
|
||
| 2. **Send Test Message**: | ||
| - Simple query: "Hello, what model are you running?" | ||
| - Expected response: Should mention Nemotron 550B or include context about 1M token window | ||
|
|
||
| 3. **Verify Backend Logs**: | ||
| - Check dev server output (shell 253) for any errors | ||
| - Should NOT see "OllamN3A" or Ollama errors | ||
| - Should see successful requests to https://integrate.api.nvidia.com/v1 | ||
|
|
||
| 4. **Test Agent Capabilities**: | ||
| - Basic chat completion | ||
| - Tool dispatch (if available) | ||
| - Verify response quality from 550B model | ||
|
|
||
| ### PRIORITY 2: Commit and Prepare for Merge (if tests pass) | ||
| - Changes are already committed (1c3bb05ac) | ||
| - If validation succeeds, use `/ship` skill to: | ||
| - Push branch | ||
| - Open PR | ||
| - Monitor CI/babysit until green | ||
| - Merge back to main | ||
|
|
||
| ### PRIORITY 3: Update AGENTS.md (Optional Enhancement) | ||
| - Consider adding NVIDIA NIM config tips to framework instructions | ||
| - Document when to use OPENAI_BASE_URL for OpenAI-compatible gateways | ||
|
|
||
| --- | ||
|
|
||
| ## CRITICAL FILES & LOCATIONS | ||
|
|
||
| | File | Purpose | Status | | ||
| |------|---------|--------| | ||
| | `.env` | NVIDIA NIM credentials | ✅ Configured | | ||
| | `packages/core/src/agent/engine/ai-sdk-engine.ts` | Framework engine provider | ✅ Fixed (OPENAI env vars) | | ||
| | `packages/core/src/agent/engine/builtin.ts` | Engine registration | ✅ Updated description | | ||
| | `packages/dispatch/src/server/plugins/agent-chat.ts` | Dispatch plugin | No change needed | | ||
| | `.gitignore` | Secrets exclusion | ✅ Correct | | ||
|
|
||
| --- | ||
|
|
||
| ## KNOWN ISSUES & DIAGNOSTICS | ||
|
|
||
| ### TypeScript Diagnostics | ||
| - **Status**: 65+ errors in dev-lazy.ts (not blocking) | ||
| - **Cause**: Missing @types/node in dev-lazy.ts | ||
| - **Impact**: No runtime impact; dev server works fine | ||
|
|
||
| ### Model Integration | ||
| - **Status**: FIXED ✅ | ||
| - **Was**: createAISDKEngine didn't read OPENAI_BASE_URL/OPENAI_MODEL | ||
| - **Fix Applied**: Updated to read env vars for openai provider (mirrors ollama pattern) | ||
| - **Verification Pending**: Ready to send test message in Dispatch to confirm | ||
|
|
||
| ### Vite/Nitro Initialization (RESOLVED ✅) | ||
| - **Was**: "Vite environment 'nitro' is unavailable" error on server startup | ||
| - **Cause**: Stale node_modules and build caches (59 zombie Node processes, corrupted .nitro/.output) | ||
| - **Resolution**: Clean sweep executed — `pnpm install` with fresh caches, all ports released | ||
| - **Status**: Dev server now mounts successfully, no Nitro errors | ||
|
|
||
| ### Port Conflicts (Resolved) | ||
| - **Was**: Ports 8080-8105 in use from previous session | ||
| - **Fixed**: Killed all node processes before restarting dev server | ||
|
|
||
| --- | ||
|
|
||
| ## CONTEXT MANAGEMENT | ||
|
|
||
| - **Memory**: ~60-65% of 200k token budget | ||
| - **Reason**: Large codebase (2033 core files), multiple edits to framework engine system | ||
| - **Preserved**: All working code, HANDOFF.md, committed changes | ||
| - **Next Session**: Fresh context available for testing and debugging | ||
|
|
||
| --- | ||
|
|
||
| ## HANDOFF CHECKLIST | ||
|
|
||
| - [x] Root cause identified: createAISDKEngine not reading OPENAI env vars | ||
| - [x] Code patched: PROVIDER_ENV_VARS and createAISDKEngine updated | ||
| - [x] Changes committed to git (1c3bb05ac) | ||
| - [x] Dev server restarted with fresh TypeScript compilation | ||
| - [x] All node processes cleaned up | ||
| - [x] Clean sweep executed: pnpm install with fresh caches, Nitro healthy | ||
| - [x] .env properly configured with NVIDIA NIM credentials | ||
| - [x] This handoff document updated | ||
|
|
||
| --- | ||
|
|
||
| ## HOW TO USE THIS HANDOFF | ||
|
|
||
| **For the next agent:** | ||
|
|
||
| 1. Read this entire HANDOFF.md (5 min) | ||
| 2. Keep dev server running in shell 231 (currently active) | ||
| 3. Navigate to http://127.0.0.1:8080/dispatch in browser | ||
| 4. Sign in and send a test message to verify NVIDIA NIM is being used | ||
| 5. Check console output in shell 231 for confirmation (no Ollama errors) | ||
| 6. If validation passes → use `/ship` skill to push changes | ||
| 7. If validation fails → debug and adjust framework code | ||
|
|
||
| **Key Context:** | ||
| - NVIDIA NIM 550B is now the framework's default agent model (via .env env vars) | ||
| - Commit 1c3bb05ac integrated OPENAI_* env var reading into createAISDKEngine | ||
| - No breaking changes to public API — existing templates continue to work | ||
| - Windows compatibility patches still live (from Phase 5) | ||
|
|
||
| --- | ||
|
|
||
| **Status: READY FOR VERIFICATION — Dev Server Healthy, Clean Sweep Complete** ✅ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| # install.ps1 — One-line installer for codebase-memory-mcp (Windows). | ||
| # | ||
| # Usage: see README.md for install instructions. | ||
| # | ||
| # Environment: | ||
| # CBM_DOWNLOAD_URL Override base URL for downloads (for testing) | ||
|
|
||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| # Enforce TLS 1.2+ (older PowerShell defaults to TLS 1.0 which GitHub rejects) | ||
| [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls13 | ||
|
|
||
| $Repo = "DeusData/codebase-memory-mcp" | ||
| $InstallDir = "$env:LOCALAPPDATA\Programs\codebase-memory-mcp" | ||
| $BinName = "codebase-memory-mcp.exe" | ||
| $BaseUrl = if ($env:CBM_DOWNLOAD_URL) { $env:CBM_DOWNLOAD_URL } else { "https://github.com/$Repo/releases/latest/download" } | ||
|
|
||
| # Security: reject non-HTTPS download URLs (defense-in-depth) | ||
| if (-not $BaseUrl.StartsWith("https://") -and -not $BaseUrl.StartsWith("http://localhost") -and -not $BaseUrl.StartsWith("http://127.0.0.1")) { | ||
| Write-Host "error: refusing non-HTTPS download URL: $BaseUrl" -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| # Detect variant from args (--ui or --standard) | ||
| $Variant = "standard" | ||
| $SkipConfig = $false | ||
| foreach ($arg in $args) { | ||
| if ($arg -eq "--ui") { $Variant = "ui" } | ||
| if ($arg -eq "--standard") { $Variant = "standard" } | ||
| if ($arg -eq "--skip-config") { $SkipConfig = $true } | ||
| if ($arg -like "--dir=*") { $InstallDir = $arg.Substring(6) } | ||
| } | ||
|
|
||
| Write-Host "codebase-memory-mcp installer (Windows)" | ||
| Write-Host " variant: $Variant" | ||
| Write-Host " target: $InstallDir\$BinName" | ||
| Write-Host "" | ||
|
|
||
| # Build download URL | ||
| if ($Variant -eq "ui") { | ||
| $Archive = "codebase-memory-mcp-ui-windows-amd64.zip" | ||
| } else { | ||
| $Archive = "codebase-memory-mcp-windows-amd64.zip" | ||
| } | ||
| $Url = "$BaseUrl/$Archive" | ||
|
|
||
| # Download | ||
| $TmpDir = Join-Path ([System.IO.Path]::GetTempPath()) "cbm-install-$(Get-Random)" | ||
| New-Item -ItemType Directory -Path $TmpDir -Force | Out-Null | ||
|
|
||
| Write-Host "Downloading $Archive..." | ||
| try { | ||
| Invoke-WebRequest -Uri $Url -OutFile "$TmpDir\$Archive" -UseBasicParsing | ||
| } catch { | ||
| Write-Host "error: download failed: $_" -ForegroundColor Red | ||
| Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue | ||
| exit 1 | ||
| } | ||
|
|
||
|
|
||
| # Checksum verification | ||
| $ChecksumUrl = "$BaseUrl/checksums.txt" | ||
| try { | ||
| Invoke-WebRequest -Uri $ChecksumUrl -OutFile "$TmpDir\checksums.txt" -UseBasicParsing | ||
| $checksumLine = Get-Content "$TmpDir\checksums.txt" | Where-Object { $_ -like "*$Archive*" } | ||
| if ($checksumLine) { | ||
| $expected = ($checksumLine -split '\s+')[0] | ||
| $actual = (Get-FileHash -Path "$TmpDir\$Archive" -Algorithm SHA256).Hash.ToLower() | ||
| if ($expected -ne $actual) { | ||
| Write-Host "error: CHECKSUM MISMATCH!" -ForegroundColor Red | ||
| Write-Host " expected: $expected" | ||
| Write-Host " actual: $actual" | ||
| Remove-Item -Recurse -Force $TmpDir | ||
| exit 1 | ||
| } | ||
| Write-Host "Checksum verified." | ||
| } | ||
| } catch { | ||
| Write-Host "warning: could not verify checksum (non-fatal)" | ||
| } | ||
|
|
||
| # Extract | ||
| Write-Host "Extracting..." | ||
| Expand-Archive -Path "$TmpDir\$Archive" -DestinationPath $TmpDir -Force | ||
|
|
||
| $DlBin = Join-Path $TmpDir $BinName | ||
| if (-not (Test-Path $DlBin)) { | ||
| # UI variant may have different name in zip | ||
| $UiBin = Join-Path $TmpDir "codebase-memory-mcp-ui.exe" | ||
| if (Test-Path $UiBin) { | ||
| Rename-Item $UiBin $BinName | ||
| $DlBin = Join-Path $TmpDir $BinName | ||
| } else { | ||
| Write-Host "error: binary not found after extraction" -ForegroundColor Red | ||
| Remove-Item -Recurse -Force $TmpDir | ||
| exit 1 | ||
| } | ||
| } | ||
|
|
||
| # Install | ||
| New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null | ||
| $Dest = Join-Path $InstallDir $BinName | ||
|
|
||
| # Handle replace-if-running (rename-aside) | ||
| if (Test-Path $Dest) { | ||
| $OldDest = "$Dest.old" | ||
| Remove-Item $OldDest -Force -ErrorAction SilentlyContinue | ||
| try { | ||
| Rename-Item $Dest $OldDest -ErrorAction Stop | ||
| } catch { | ||
| Write-Host "warning: could not rename existing binary (may be in use)" | ||
| } | ||
| } | ||
|
|
||
| Copy-Item $DlBin $Dest -Force | ||
|
|
||
| # Verify | ||
| try { | ||
| $ver = & $Dest --version 2>&1 | ||
| Write-Host "Installed: $ver" | ||
| } catch { | ||
| Write-Host "error: installed binary failed to run" -ForegroundColor Red | ||
| Remove-Item -Recurse -Force $TmpDir | ||
| exit 1 | ||
| } | ||
|
|
||
| # Configure agents | ||
| if ($SkipConfig) { | ||
| Write-Host "" | ||
| Write-Host "Skipping agent configuration (--skip-config)" | ||
| } else { | ||
| Write-Host "" | ||
| Write-Host "Configuring coding agents..." | ||
| try { | ||
| & $Dest install -y 2>&1 | Write-Host | ||
| } catch { | ||
| Write-Host "Agent configuration failed (non-fatal)." | ||
| Write-Host "Run manually: codebase-memory-mcp install" | ||
| } | ||
| } | ||
|
|
||
| # Add to PATH (user scope, no admin needed) | ||
| $UserPath = [Environment]::GetEnvironmentVariable("PATH", "User") | ||
| if ($UserPath -notlike "*$InstallDir*") { | ||
| [Environment]::SetEnvironmentVariable("PATH", "$UserPath;$InstallDir", "User") | ||
| $env:PATH = "$env:PATH;$InstallDir" | ||
| Write-Host "Added $InstallDir to user PATH" | ||
| } | ||
|
|
||
| # Cleanup | ||
| Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue | ||
|
|
||
| Write-Host "" | ||
| Write-Host "Done! Restart your terminal and coding agent to start using codebase-memory-mcp." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$schema": "https://agent-native.com/schema/mcp.config.json", | ||
| "servers": { | ||
| "codebase-memory": { | ||
| "command": "C:\\Users\\larry\\AppData\\Local\\Programs\\codebase-memory-mcp\\codebase-memory-mcp.exe", | ||
|
Comment on lines
+3
to
+5
Contributor
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. 🟡 Workspace MCP config hardcodes a machine-specific Windows pathThis committed workspace config points at Additional Info |
||
| "args": ["--stdio"], | ||
| "env": {} | ||
| } | ||
| } | ||
| } | ||
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.
🟡 Committed Abacus config is machine-specific and carries local permissions
This repo-level config hardcodes
C:\Users\larry\...temp directories and checks in a local command allowlist (pnpm add,powershell,taskkill, etc.). It should stay user-local rather than shipping another developer's workstation paths and trust policy in the repo.Additional Info