|
1469 | 1469 | " # Remove EMBEDDING_API_KEY line if using Option 1 (will use NVIDIA_API_KEY)\n", |
1470 | 1470 | " content = re.sub(r'^EMBEDDING_API_KEY=.*$\\n?', '', content, flags=re.MULTILINE)\n", |
1471 | 1471 | " \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", |
1475 | 1475 | " 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", |
1477 | 1477 | " 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", |
1478 | 1481 | " if re.search(r'^LLM_MODEL=.*$', content, flags=re.MULTILINE):\n", |
1479 | 1482 | " content = re.sub(\n", |
1480 | 1483 | " r'^LLM_MODEL=.*$',\n", |
|
1490 | 1493 | " content,\n", |
1491 | 1494 | " flags=re.MULTILINE\n", |
1492 | 1495 | " )\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", |
1493 | 1513 | " elif brev_model:\n", |
1494 | 1514 | " # Option 2: Use Brev model name if provided\n", |
1495 | 1515 | " if re.search(r'^LLM_MODEL=.*$', content, flags=re.MULTILINE):\n", |
|
1593 | 1613 | " if choice == \"1\":\n", |
1594 | 1614 | " print(\" • NVIDIA_API_KEY: Set (will be used for all services)\")\n", |
1595 | 1615 | " 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", |
1596 | 1617 | " else:\n", |
1597 | 1618 | " print(\" • NVIDIA_API_KEY: Set (Brev API key for LLM)\")\n", |
1598 | 1619 | " print(\" • EMBEDDING_API_KEY: Set (NVIDIA API key for Embedding)\")\n", |
|
0 commit comments