Error when trying Nvidia Ai

I want to try out the new NVIDIA Nemotron 70b model trough Nvidia OpenaAI API. Code works fine with an OpenAi GPT4o model but added a new “OpenAI Chat Model” to an Agent node, added the API key, although it said it was wrong but I guess it checked against OpenAi and not Nvidia.
Anyway, I get error “400 status code (no body)” when running the Agent.
If I supply a invalid password I get code 401 with same text.
I tested the model with the supplied curl command and it worked.

Sample code from Nvidia is:

from openai import OpenAI

client = OpenAI(
  base_url = "https://integrate.api.nvidia.com/v1",
  api_key = "$API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC"
)

completion = client.chat.completions.create(
  model="nvidia/llama-3.1-nemotron-70b-instruct",
  messages=[{"role":"user","content":"Write a limerick about the wonders of GPU computing."}],
  temperature=0.5,
  top_p=1,
  max_tokens=1024,
  stream=True
)

for chunk in completion:
  if chunk.choices[0].delta.content is not None:
    print(chunk.choices[0].delta.content, end="")

Information on your n8n setup

  • n8n 1.64.3
  • Running n8n via Docker.
  • Operating system: Ubuntu 24.04.1 LTS

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Answering this myself for refference.

Got help on Discord, apparently the Nvidia implementation of OpenAi API does not currently work with Agents.

When using with a Basic LLM Chain, it times out now because of high usage. The website doesn’t work either so my tests will have to wait.

1 Like

Hey @Andrei_Ignat,

That is a great find, Thanks for sharing.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.