Class OllamaOptions
java.lang.Object
org.springframework.ai.ollama.api.OllamaOptions
- All Implemented Interfaces:
ChatOptions
,EmbeddingOptions
,ModelOptions
Helper class for creating strongly-typed Ollama options.
- Since:
- 0.8.0
- Author:
- Christian Tzolov
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.ai.embedding.EmbeddingOptions
EmbeddingOptions.EmptyEmbeddingOptions
-
Field Summary
Fields inherited from interface org.springframework.ai.embedding.EmbeddingOptions
EMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OllamaOptions
create()
Helper factory method to create a newOllamaOptions
instance.filterNonSupportedFields
(Map<String, Object> options) Filter out the non supported fields from the options.getF16KV()
getModel()
getSeed()
getStop()
getTfsZ()
getTopK()
getTopP()
void
setEmbeddingOnly
(Boolean embeddingOnly) void
void
setFrequencyPenalty
(Float frequencyPenalty) void
setLogitsAll
(Boolean logitsAll) void
setLowVRAM
(Boolean lowVRAM) void
setMainGPU
(Integer mainGPU) void
setMirostat
(Integer mirostat) void
setMirostatEta
(Float mirostatEta) void
setMirostatTau
(Float mirostatTau) void
void
setNumBatch
(Integer numBatch) void
void
void
void
setNumKeep
(Integer numKeep) void
setNumPredict
(Integer numPredict) void
setNumThread
(Integer numThread) void
setPenalizeNewline
(Boolean penalizeNewline) void
setPresencePenalty
(Float presencePenalty) void
setRepeatLastN
(Integer repeatLastN) void
setRepeatPenalty
(Float repeatPenalty) void
setRopeFrequencyBase
(Float ropeFrequencyBase) void
setRopeFrequencyScale
(Float ropeFrequencyScale) void
void
void
setTemperature
(Float temperature) void
void
void
void
setTypicalP
(Float typicalP) void
setUseMLock
(Boolean useMLock) void
setUseMMap
(Boolean useMMap) void
setUseNUMA
(Boolean useNUMA) void
setVocabOnly
(Boolean vocabOnly) toMap()
Convert theOllamaOptions
object to aMap
of key/value pairs.withEmbeddingOnly
(Boolean embeddingOnly) withFrequencyPenalty
(Float frequencyPenalty) withLogitsAll
(Boolean logitsAll) withLowVRAM
(Boolean lowVRAM) withMainGPU
(Integer mainGPU) withMirostat
(Integer mirostat) withMirostatEta
(Float mirostatEta) withMirostatTau
(Float mirostatTau) withNumBatch
(Integer numBatch) withNumCtx
(Integer numCtx) withNumGPU
(Integer numGPU) withNumGQA
(Integer numGQA) withNumKeep
(Integer numKeep) withNumPredict
(Integer numPredict) withNumThread
(Integer numThread) withPenalizeNewline
(Boolean penalizeNewline) withPresencePenalty
(Float presencePenalty) withRepeatLastN
(Integer repeatLastN) withRepeatPenalty
(Float repeatPenalty) withRopeFrequencyBase
(Float ropeFrequencyBase) withRopeFrequencyScale
(Float ropeFrequencyScale) withTemperature
(Float temperature) withTypicalP
(Float typicalP) withUseMLock
(Boolean useMLock) withUseMMap
(Boolean useMMap) withUseNUMA
(Boolean useNUMA) withVocabOnly
(Boolean vocabOnly)
-
Field Details
-
DEFAULT_MODEL
-
-
Constructor Details
-
OllamaOptions
public OllamaOptions()
-
-
Method Details
-
withModel
- Parameters:
model
- The ollama model names to use. See theOllamaModel
for the common models.
-
getModel
-
setModel
-
withUseNUMA
-
withNumCtx
-
withNumBatch
-
withNumGQA
-
withNumGPU
-
withMainGPU
-
withLowVRAM
-
withF16KV
-
withLogitsAll
-
withVocabOnly
-
withUseMMap
-
withUseMLock
-
withEmbeddingOnly
-
withRopeFrequencyBase
-
withRopeFrequencyScale
-
withNumThread
-
withNumKeep
-
withSeed
-
withNumPredict
-
withTopK
-
withTopP
-
withTfsZ
-
withTypicalP
-
withRepeatLastN
-
withTemperature
-
withRepeatPenalty
-
withPresencePenalty
-
withFrequencyPenalty
-
withMirostat
-
withMirostatTau
-
withMirostatEta
-
withPenalizeNewline
-
withStop
-
getUseNUMA
-
setUseNUMA
-
getNumCtx
-
setNumCtx
-
getNumBatch
-
setNumBatch
-
getNumGQA
-
setNumGQA
-
getNumGPU
-
setNumGPU
-
getMainGPU
-
setMainGPU
-
getLowVRAM
-
setLowVRAM
-
getF16KV
-
setF16KV
-
getLogitsAll
-
setLogitsAll
-
getVocabOnly
-
setVocabOnly
-
getUseMMap
-
setUseMMap
-
getUseMLock
-
setUseMLock
-
getEmbeddingOnly
-
setEmbeddingOnly
-
getRopeFrequencyBase
-
setRopeFrequencyBase
-
getRopeFrequencyScale
-
setRopeFrequencyScale
-
getNumThread
-
setNumThread
-
getNumKeep
-
setNumKeep
-
getSeed
-
setSeed
-
getNumPredict
-
setNumPredict
-
getTopK
- Specified by:
getTopK
in interfaceChatOptions
-
setTopK
-
getTopP
- Specified by:
getTopP
in interfaceChatOptions
-
setTopP
-
getTfsZ
-
setTfsZ
-
getTypicalP
-
setTypicalP
-
getRepeatLastN
-
setRepeatLastN
-
getTemperature
- Specified by:
getTemperature
in interfaceChatOptions
-
setTemperature
-
getRepeatPenalty
-
setRepeatPenalty
-
getPresencePenalty
-
setPresencePenalty
-
getFrequencyPenalty
-
setFrequencyPenalty
-
getMirostat
-
setMirostat
-
getMirostatTau
-
setMirostatTau
-
getMirostatEta
-
setMirostatEta
-
getPenalizeNewline
-
setPenalizeNewline
-
getStop
-
setStop
-
toMap
Convert theOllamaOptions
object to aMap
of key/value pairs.- Returns:
- The
Map
of key/value pairs.
-
create
Helper factory method to create a newOllamaOptions
instance.- Returns:
- A new
OllamaOptions
instance.
-
filterNonSupportedFields
Filter out the non supported fields from the options.- Parameters:
options
- The options to filter.- Returns:
- The filtered options.
-