Skip to content

Commit 187fa0f

Browse files
committed
fix: set LLM_NIM_URL for Option 1 to use NVIDIA API endpoint
- When Option 1 is selected (NVIDIA API key for cloud endpoints), set LLM_NIM_URL to https://integrate.api.nvidia.com/v1 - This endpoint works with NVIDIA API keys, unlike api.brev.dev which requires Brev API keys - Prevents 401 authentication errors when using NVIDIA API key with cloud endpoints - Update summary output to show LLM_NIM_URL is configured Fixes: 401 Unauthorized errors when using Option 1 with cloud endpoints
1 parent 8e44272 commit 187fa0f

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

notebooks/setup/complete_setup_guide.ipynb

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,12 +1469,15 @@
14691469
" # Remove EMBEDDING_API_KEY line if using Option 1 (will use NVIDIA_API_KEY)\n",
14701470
" content = re.sub(r'^EMBEDDING_API_KEY=.*$\\n?', '', content, flags=re.MULTILINE)\n",
14711471
" \n",
1472-
" # Update LLM_MODEL\n",
1473-
" # Option 1: Use default cloud model (nvidia/llama-3.3-nemotron-super-49b-v1)\n",
1474-
" # Option 2: Use Brev model name if provided\n",
1472+
" # Update LLM_MODEL and LLM_NIM_URL\n",
1473+
" # Option 1: Use default cloud model with NVIDIA API endpoint (integrate.api.nvidia.com)\n",
1474+
" # Option 2: Use Brev model name with Brev endpoint (api.brev.dev)\n",
14751475
" if choice == \"1\":\n",
1476-
" # Option 1: Set to default cloud model\n",
1476+
" # Option 1: Set to default cloud model with NVIDIA API endpoint\n",
14771477
" default_cloud_model = \"nvidia/llama-3.3-nemotron-super-49b-v1\"\n",
1478+
" nvidia_llm_endpoint = \"https://integrate.api.nvidia.com/v1\"\n",
1479+
" \n",
1480+
" # Update LLM_MODEL\n",
14781481
" if re.search(r'^LLM_MODEL=.*$', content, flags=re.MULTILINE):\n",
14791482
" content = re.sub(\n",
14801483
" r'^LLM_MODEL=.*$',\n",
@@ -1490,6 +1493,23 @@
14901493
" content,\n",
14911494
" flags=re.MULTILINE\n",
14921495
" )\n",
1496+
" \n",
1497+
" # Update LLM_NIM_URL to use NVIDIA API endpoint (works with NVIDIA API keys)\n",
1498+
" if re.search(r'^LLM_NIM_URL=.*$', content, flags=re.MULTILINE):\n",
1499+
" content = re.sub(\n",
1500+
" r'^LLM_NIM_URL=.*$',\n",
1501+
" f'LLM_NIM_URL={nvidia_llm_endpoint}',\n",
1502+
" content,\n",
1503+
" flags=re.MULTILINE\n",
1504+
" )\n",
1505+
" else:\n",
1506+
" # Add LLM_NIM_URL after LLM_MODEL if it doesn't exist\n",
1507+
" content = re.sub(\n",
1508+
" r'^(LLM_MODEL=.*)$',\n",
1509+
" rf'\\1\\nLLM_NIM_URL={nvidia_llm_endpoint}',\n",
1510+
" content,\n",
1511+
" flags=re.MULTILINE\n",
1512+
" )\n",
14931513
" elif brev_model:\n",
14941514
" # Option 2: Use Brev model name if provided\n",
14951515
" if re.search(r'^LLM_MODEL=.*$', content, flags=re.MULTILINE):\n",
@@ -1593,6 +1613,7 @@
15931613
" if choice == \"1\":\n",
15941614
" print(\" • NVIDIA_API_KEY: Set (will be used for all services)\")\n",
15951615
" print(\" • LLM_MODEL: Set (nvidia/llama-3.3-nemotron-super-49b-v1)\")\n",
1616+
" print(\" • LLM_NIM_URL: Set (https://integrate.api.nvidia.com/v1)\")\n",
15961617
" else:\n",
15971618
" print(\" • NVIDIA_API_KEY: Set (Brev API key for LLM)\")\n",
15981619
" print(\" • EMBEDDING_API_KEY: Set (NVIDIA API key for Embedding)\")\n",

0 commit comments

Comments
 (0)