Class LLMProvider

java.lang.Object
io.forgeai.jenkins.llm.LLMProvider
All Implemented Interfaces:
ExtensionPoint, Describable<LLMProvider>, Serializable
Direct Known Subclasses:
AnthropicProvider, OllamaProvider, OpenAICompatibleProvider

public abstract class LLMProvider extends Object implements ExtensionPoint, Describable<LLMProvider>, Serializable
Extension point for LLM backends. Implement this interface (plus a Descriptor) to add a new provider — even from a separate plugin — without modifying ForgeAI itself.
See Also:
  • Field Details

    • endpoint

      protected String endpoint
    • modelId

      protected String modelId
  • Constructor Details

    • LLMProvider

      public LLMProvider()
  • Method Details

    • complete

      public abstract String complete(String systemPrompt, String userPrompt, int maxTokens) throws LLMException
      Throws:
      LLMException
    • healthCheck

      public abstract boolean healthCheck()
    • displayName

      public abstract String displayName()
    • defaultParallelism

      public int defaultParallelism()
      How many analyzer requests this provider handles well at once, used when the global "Parallel LLM requests" setting is left at 0 (automatic).
    • httpClient

      protected static okhttp3.OkHttpClient httpClient(long connectTimeoutSeconds, long readTimeoutSeconds)
      Builds an HTTP client that honours the Jenkins proxy settings (Manage Jenkins → System → HTTP Proxy Configuration), including no-proxy hosts and proxy credentials.
    • getEndpoint

      public String getEndpoint()
    • setEndpoint

      @DataBoundSetter public void setEndpoint(String v)
    • getModelId

      public String getModelId()
    • setModelId

      @DataBoundSetter public void setModelId(String v)
    • getApiKeyCredentialId

      public String getApiKeyCredentialId()
    • setApiKeyCredentialId

      @DataBoundSetter public void setApiKeyCredentialId(String v)
    • resolveApiKey

      protected String resolveApiKey()
    • getDescriptor

      public LLMProvider.LLMProviderDescriptor getDescriptor()
      Specified by:
      getDescriptor in interface Describable<LLMProvider>
    • all