Interface ModelProvider

All Known Implementing Classes:
OllamaProvider

public interface ModelProvider
Abstraction over any LLM backend (Ollama, OpenAI, Anthropic, …). Implement this interface to add a new provider.
  • Method Details

    • chat

      ChatResponse chat(String model, List<ChatMessage> messages, List<ToolDefinition> tools)
      Send a chat request with optional tool definitions.
      Parameters:
      model - provider-specific model name (e.g. "qwen2.5-coder:7b")
      messages - conversation history (must include the new user message)
      tools - tool definitions available to the model (may be empty)
      Returns:
      the model's response
    • getName

      String getName()
      Provider name for display purposes.
    • listModels

      List<String> listModels()
      Fetch the list of available models from this provider.
      Returns:
      a list of model names