Class OllamaBackend
java.lang.Object
org.episteme.core.mathematics.ml.generative.OllamaBackend
- All Implemented Interfaces:
GenerativeModel
Backend for interacting with Ollama (Local LLM server).
assumes Ollama is running on localhost:11434 by default.
- Since:
- 2.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested classes/interfaces inherited from interface GenerativeModel
GenerativeModel.Response -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<float[]> Generates vector embeddings for the given text.Generates a response for the given prompt.Returns the name of the model being used (e.g., "gpt-4", "llama3").Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GenerativeModel
generate
-
Constructor Details
-
OllamaBackend
-
-
Method Details
-
generate
Description copied from interface:GenerativeModelGenerates a response for the given prompt.- Specified by:
generatein interfaceGenerativeModel- Parameters:
prompt- the input text.- Returns:
- a future containing the generated text.
-
embed
Description copied from interface:GenerativeModelGenerates vector embeddings for the given text.- Specified by:
embedin interfaceGenerativeModel- Parameters:
text- the input text.- Returns:
- a future containing the embedding vector (as float array).
-
getModelName
Description copied from interface:GenerativeModelReturns the name of the model being used (e.g., "gpt-4", "llama3").- Specified by:
getModelNamein interfaceGenerativeModel
-