Class NvidiaServiceSettings.Builder

All Implemented Interfaces:
WithJson<NvidiaServiceSettings.Builder>, ObjectBuilder<NvidiaServiceSettings>
Enclosing class:
NvidiaServiceSettings

public static class NvidiaServiceSettings.Builder extends WithJsonObjectBuilderBase<NvidiaServiceSettings.Builder> implements ObjectBuilder<NvidiaServiceSettings>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • apiKey

      public final NvidiaServiceSettings.Builder apiKey(String value)
      Required - A valid API key for your Nvidia endpoint. Can be found in API Keys section of Nvidia account settings.

      API name: api_key

    • url

      public final NvidiaServiceSettings.Builder url(@Nullable String value)
      The URL of the Nvidia model endpoint. If not provided, the default endpoint URL is used depending on the task type:
      • For text_embedding task - https://integrate.api.nvidia.com/v1/embeddings.
      • For completion and chat_completion tasks - https://integrate.api.nvidia.com/v1/chat/completions.
      • For rerank task - https://ai.api.nvidia.com/v1/retrieval/nvidia/reranking.

      API name: url

    • modelId

      public final NvidiaServiceSettings.Builder modelId(String value)
      Required - The name of the model to use for the inference task. Refer to the model's documentation for the name if needed. Service has been tested and confirmed to be working with the following models:
      • For text_embedding task - nvidia/llama-3.2-nv-embedqa-1b-v2.
      • For completion and chat_completion tasks - microsoft/phi-3-mini-128k-instruct.
      • For rerank task - nv-rerank-qa-mistral-4b:1. Service doesn't support text_embedding task baai/bge-m3 and nvidia/nvclip models due to them not recognizing the input_type parameter.

      API name: model_id

    • maxInputTokens

      public final NvidiaServiceSettings.Builder maxInputTokens(@Nullable Integer value)
      For a text_embedding task, the maximum number of tokens per input. Inputs exceeding this value are truncated prior to sending to the Nvidia API.

      API name: max_input_tokens

    • similarity

      public final NvidiaServiceSettings.Builder similarity(@Nullable NvidiaSimilarityType value)
      For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm.

      API name: similarity

    • rateLimit

      public final NvidiaServiceSettings.Builder rateLimit(@Nullable RateLimitSetting value)
      This setting helps to minimize the number of rate limit errors returned from the Nvidia API. By default, the nvidia service sets the number of requests allowed per minute to 3000.

      API name: rate_limit

    • rateLimit

      This setting helps to minimize the number of rate limit errors returned from the Nvidia API. By default, the nvidia service sets the number of requests allowed per minute to 3000.

      API name: rate_limit

    • self

      Specified by:
      self in class WithJsonObjectBuilderBase<NvidiaServiceSettings.Builder>
    • build

      public NvidiaServiceSettings build()
      Specified by:
      build in interface ObjectBuilder<NvidiaServiceSettings>
      Throws:
      NullPointerException - if some of the required fields are null.