Class OllamaProviderConfig
java.lang.Object
hudson.model.AbstractDescribableImpl<AiProviderConfig>
io.jenkins.plugins.changeinvestigator.ai.provider.AiProviderConfig
io.jenkins.plugins.changeinvestigator.ai.provider.OllamaProviderConfig
- All Implemented Interfaces:
Describable<AiProviderConfig>,Serializable
A local (or self-hosted) Ollama instance, via its OpenAI-compatibility layer
(
{baseUrl}/chat/completions). No Jenkins credential is required - Ollama itself does
not check the Authorization header - but one may optionally be selected for a
reverse-proxied Ollama setup that adds its own auth in front, in which case it is sent as a
Bearer token exactly like every other OpenAI-compatible provider in this plugin.
There is deliberately no hardcoded default of http://localhost:11434/v1: on a
containerized Jenkins controller or agent, "localhost" inside the container is not the
Docker host running Ollama, and defaulting to it would silently fail in exactly the setup
most users running Ollama actually have. The base URL is required input instead, with
guidance in the README on the container-networking values that typically work (e.g.
http://host.docker.internal:11434/v1 for Docker Desktop, or the host's LAN IP).
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.jenkins.plugins.changeinvestigator.ai.provider.AiProviderConfig
AiProviderConfig.AiProviderConfigDescriptor -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int timeoutSeconds) Builds a provider bound to this configuration's resolved settings, ready to make one (or more)AiProvider.chatCompletion(io.jenkins.plugins.changeinvestigator.ai.AiAnalysisRequest)calls.getModel()The model identifier this configuration will request, for display purposes.voidsetCredentialsId(String credentialsId) Methods inherited from class io.jenkins.plugins.changeinvestigator.ai.provider.AiProviderConfig
testConnectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Describable
getDescriptor
-
Field Details
-
DEFAULT_MODEL
- See Also:
-
-
Constructor Details
-
OllamaProviderConfig
-
-
Method Details
-
getBaseUrl
-
getModel
Description copied from class:AiProviderConfigThe model identifier this configuration will request, for display purposes.- Specified by:
getModelin classAiProviderConfig
-
getCredentialsId
-
setCredentialsId
-
createProvider
public AiProvider createProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int timeoutSeconds) Description copied from class:AiProviderConfigBuilds a provider bound to this configuration's resolved settings, ready to make one (or more)AiProvider.chatCompletion(io.jenkins.plugins.changeinvestigator.ai.AiAnalysisRequest)calls. Resolving the credential happens inside this method, not before it, so the plaintext secret's lifetime is limited to the call that actually needs it.- Specified by:
createProviderin classAiProviderConfig- Parameters:
objectMapper- shared Jackson mapper for building/parsing request and response JSONtimeoutSeconds- administrator-configured connect/request timeout (a global, not per-provider, setting - seeChangeInvestigatorGlobalConfiguration)
-