Class ProviderModelConfig

java.lang.Object
com.github.copilot.rpc.ProviderModelConfig

@CopilotExperimental public class ProviderModelConfig extends Object
A BYOK (Bring Your Own Key) model definition in the multi-provider registry.

References a NamedProviderConfig by provider and becomes selectable under the provider-qualified id provider/id. All setter methods return this for method chaining.

Experimental. Multi-provider BYOK configuration is experimental and may change or be removed in future SDK or CLI releases.

Example Usage

var model = new ProviderModelConfig().setId("gpt-x").setProvider("my-openai").setWireModel("gpt-x-2025");
Since:
1.0.0
See Also:
  • Constructor Details

    • ProviderModelConfig

      public ProviderModelConfig()
  • Method Details

    • getId

      public String getId()
      Gets the model identifier.
      Returns:
      the model id
    • setId

      public ProviderModelConfig setId(String id)
      Sets the model identifier, unique within its provider.

      Combined with provider to form the selection id provider/id.

      Parameters:
      id - the model id
      Returns:
      this config for method chaining
    • getProvider

      public String getProvider()
      Gets the name of the provider this model is served by.
      Returns:
      the provider name
    • setProvider

      public ProviderModelConfig setProvider(String provider)
      Sets the name of the NamedProviderConfig this model is served by.
      Parameters:
      provider - the provider name
      Returns:
      this config for method chaining
    • getWireModel

      public String getWireModel()
      Gets the model name sent to the provider API for inference.
      Returns:
      the wire model name, or null if not set
    • setWireModel

      public ProviderModelConfig setWireModel(String wireModel)
      Sets the model name sent to the provider API for inference.

      Use this when the provider's model name differs from id.

      Parameters:
      wireModel - the wire model name
      Returns:
      this config for method chaining
    • getModelId

      public String getModelId()
      Gets the well-known model ID used to look up agent config and default token limits.
      Returns:
      the model ID, or null if not set
    • setModelId

      public ProviderModelConfig setModelId(String modelId)
      Sets the well-known model ID used to look up agent config and default token limits.
      Parameters:
      modelId - the model ID
      Returns:
      this config for method chaining
    • getName

      public String getName()
      Gets the human-readable display name.
      Returns:
      the display name, or null if not set
    • setName

      public ProviderModelConfig setName(String name)
      Sets the human-readable display name.
      Parameters:
      name - the display name
      Returns:
      this config for method chaining
    • getMaxPromptTokens

      public OptionalInt getMaxPromptTokens()
      Gets the maximum prompt token override.
      Returns:
      an OptionalInt containing the max prompt tokens, or OptionalInt.empty() if not set
    • setMaxPromptTokens

      public ProviderModelConfig setMaxPromptTokens(int maxPromptTokens)
      Sets the maximum prompt tokens override.
      Parameters:
      maxPromptTokens - the max prompt tokens
      Returns:
      this config for method chaining
    • clearMaxPromptTokens

      public ProviderModelConfig clearMaxPromptTokens()
      Clears the maxPromptTokens setting, reverting to the default behavior.
      Returns:
      this config for method chaining
    • getMaxContextWindowTokens

      public OptionalInt getMaxContextWindowTokens()
      Gets the maximum context window token override.
      Returns:
      an OptionalInt containing the max context window tokens, or OptionalInt.empty() if not set
    • setMaxContextWindowTokens

      public ProviderModelConfig setMaxContextWindowTokens(int maxContextWindowTokens)
      Sets the maximum context window tokens override.
      Parameters:
      maxContextWindowTokens - the max context window tokens
      Returns:
      this config for method chaining
    • clearMaxContextWindowTokens

      public ProviderModelConfig clearMaxContextWindowTokens()
      Clears the maxContextWindowTokens setting, reverting to the default behavior.
      Returns:
      this config for method chaining
    • getMaxOutputTokens

      public OptionalInt getMaxOutputTokens()
      Gets the maximum output token override.
      Returns:
      an OptionalInt containing the max output tokens, or OptionalInt.empty() if not set
    • setMaxOutputTokens

      public ProviderModelConfig setMaxOutputTokens(int maxOutputTokens)
      Sets the maximum output tokens override.
      Parameters:
      maxOutputTokens - the max output tokens
      Returns:
      this config for method chaining
    • clearMaxOutputTokens

      public ProviderModelConfig clearMaxOutputTokens()
      Clears the maxOutputTokens setting, reverting to the default behavior.
      Returns:
      this config for method chaining
    • getCapabilities

      public ModelCapabilitiesOverride getCapabilities()
      Gets the per-property model capability overrides.
      Returns:
      the capabilities override, or null if not set
    • setCapabilities

      public ProviderModelConfig setCapabilities(ModelCapabilitiesOverride capabilities)
      Sets per-property model capability overrides, deep-merged over runtime defaults.
      Parameters:
      capabilities - the capabilities override
      Returns:
      this config for method chaining