Package com.tnsai.llm.providers
Class OllamaClient
java.lang.Object
com.tnsai.llm.providers.AbstractLLMClient
com.tnsai.llm.providers.OllamaClient
- All Implemented Interfaces:
com.tnsai.llm.LLMClient
Ollama LLM client implementation for local and cloud deployments.
OllamaClient provides access to Ollama models running locally or on Ollama Cloud. It supports chat completion, streaming, and tool calling (function calling).
Environment Variables
- OLLAMA_BASE_URL - Custom Ollama server URL (default: http://localhost:11434)
- OLLAMA_API_KEY - API key for Ollama Cloud authentication (optional for local)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOllamaClient(String model) OllamaClient(String model, float temperature) OllamaClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey) OllamaClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey, LLMClientSettings settings) OllamaClient(String baseUrl, String model, float temperature, Integer maxTokens) OllamaClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey) -
Method Summary
Modifier and TypeMethodDescriptioncom.tnsai.llm.ChatResponsechat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) List<com.tnsai.llm.ModelInfo> streamChat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) Methods inherited from class com.tnsai.llm.providers.AbstractLLMClient
getBaseUrl, getCallTimeoutMs, getMaxTokens, getModel, getTemperature, getTopPMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tnsai.llm.LLMClient
chat, chat, chat, chat, chat, getCapabilities, streamChat, streamChat, streamChatWithHandler, streamChatWithHandler, streamChatWithSpec, streamChatWithSpec
-
Constructor Details
-
OllamaClient
-
OllamaClient
-
OllamaClient
-
OllamaClient
-
OllamaClient
-
OllamaClient
-
-
Method Details
-
chat
-
streamChat
-
listModels
-
getProviderName
-