Class NvidiaAiProvider

All Implemented Interfaces:
PropertyChangeSource, Rebindable

public class NvidiaAiProvider extends OpenAiChatCompletionsProvider
Dedicated AI Provider for NVIDIA NIM microservices using their OpenAI-compatible API.

Connects to https://integrate.api.nvidia.com/v1 to access NVIDIA NIM models including Nemotron, DeepSeek-R1, Qwen, and Llama reasoning models.

Author:
anahata
  • Constructor Details

    • NvidiaAiProvider

      public NvidiaAiProvider()
      Constructs a new NVIDIA AI provider with stable UUID "Nvidia".
  • Method Details

    • createModel

      protected OpenAiCompatibleModel createModel(com.fasterxml.jackson.databind.JsonNode node)
      Constructs a concrete model instance for this provider.

      Creates a specialized NvidiaModel that configures reasoning and thought extraction.

      Overrides:
      createModel in class OpenAiChatCompletionsProvider
      Parameters:
      node - The JSON node containing model metadata.
      Returns:
      A new model instance.
    • isRetryable

      public boolean isRetryable(int statusCode, String responseBody)
      Determines if an HTTP status code or response body indicates a transient failure that should trigger a retry or rotation.

      Checks for common OpenAI-compatible error codes (429, 503, 500, 499, 408).

      Adds NVIDIA-specific error checks for GPU VRAM exhaustion and engine loop failures.

      Overrides:
      isRetryable in class OpenAiChatCompletionsProvider
      Parameters:
      statusCode - The HTTP status code.
      responseBody - The raw response body.
      Returns:
      true if retryable, false otherwise.
    • getApiKeyHint

      public String getApiKeyHint()
      Gets a template or hint string to display when the API keys file is empty.

      Implementation details: Provides a standard header hint for the multi-key configuration file.

      Provides the NVIDIA-specific key hint for the api_keys.txt configuration file.

      Overrides:
      getApiKeyHint in class OpenAiChatCompletionsProvider
      Returns:
      The API key hint text.