From 276a27f27aeff7781a25e13fad0d568f5455ce05 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 11 Dec 2025 19:50:20 -0500 Subject: t-247: Add Provider abstraction for multi-backend LLM support - Create Omni/Agent/Provider.hs with unified Provider interface - Support OpenRouter (cloud), Ollama (local), Amp (subprocess stub) - Add runAgentWithProvider to Engine.hs for Provider-based execution - Add EngineType to Core.hs (EngineOpenRouter, EngineOllama, EngineAmp) - Add --engine flag to 'jr work' command - Worker.hs dispatches to appropriate provider based on engine type Usage: jr work # OpenRouter (default) jr work --engine=ollama # Local Ollama jr work --engine=amp # Amp CLI (stub) --- Omni/Agent/Core.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Omni/Agent/Core.hs') diff --git a/Omni/Agent/Core.hs b/Omni/Agent/Core.hs index 88f7237..fb4a4b3 100644 --- a/Omni/Agent/Core.hs +++ b/Omni/Agent/Core.hs @@ -6,6 +6,17 @@ module Omni.Agent.Core where import Alpha import Data.Aeson (FromJSON, ToJSON) +-- | Engine/provider selection for agent +data EngineType + = EngineOpenRouter + | EngineOllama + | EngineAmp + deriving (Show, Eq, Generic) + +instance ToJSON EngineType + +instance FromJSON EngineType + -- | Status of a worker agent data WorkerStatus = Idle @@ -28,7 +39,8 @@ data Worker = Worker workerPid :: Maybe Int, workerStatus :: WorkerStatus, workerPath :: FilePath, - workerQuiet :: Bool -- Disable ANSI status bar (for loop mode) + workerQuiet :: Bool, -- Disable ANSI status bar (for loop mode) + workerEngine :: EngineType -- Which LLM backend to use } deriving (Show, Eq, Generic) -- cgit v1.2.3