New web interface, move llm engine to separate process
This commit is contained in:
@@ -2,20 +2,16 @@ from aiohttp import web
|
||||
import asyncio
|
||||
|
||||
from .auto_approver import AutoApprover
|
||||
from .chat_io_buffer import ChatIOBuffer
|
||||
from .config import Config
|
||||
from .iteration_logger import IterationLogger
|
||||
from .llm_engine.hf_llm_engine import HfLlmEngine
|
||||
from .llm_engine.local_llm_engine import LocalLlmEngine
|
||||
from .llm_engine.mistral_llm_engine import MistralLlmEngine
|
||||
from .llm_engine.openai_llm_engine import OpenAILlmEngine
|
||||
from .llm_engine.qwq_llm_engine import QwQLlmEngine
|
||||
from .llm_engine import LlmEngine
|
||||
from .response_parser import ResponseParser
|
||||
from .system_metrics import SystemMetrics
|
||||
from .web.api import Api
|
||||
from .web.static import Static
|
||||
from .web.websockets import Websockets
|
||||
from .web_agent import WebAgent
|
||||
from .web_io_buffer import WebIOBuffer
|
||||
from .working_memory import WorkingMemory
|
||||
|
||||
class Main:
|
||||
@@ -30,49 +26,17 @@ class Main:
|
||||
# Initialize LLM engines based on config
|
||||
self._llms = {}
|
||||
|
||||
if config.local_enabled:
|
||||
self._llms['local'] = LocalLlmEngine(
|
||||
config.local_model,
|
||||
config.local_temperature,
|
||||
config.local_token_limit,
|
||||
self._action_schema,
|
||||
config.local_api_key,
|
||||
)
|
||||
|
||||
if config.openai_enabled:
|
||||
self._llms['openai'] = OpenAILlmEngine(
|
||||
config.openai_model,
|
||||
config.openai_temperature,
|
||||
config.openai_token_limit,
|
||||
config.openai_api_key,
|
||||
)
|
||||
|
||||
if config.hf_enabled:
|
||||
self._llms['hf'] = HfLlmEngine(
|
||||
config.hf_model,
|
||||
config.hf_temperature,
|
||||
config.hf_api_key,
|
||||
)
|
||||
|
||||
if config.mistral_enabled:
|
||||
self._llms['mistral'] = MistralLlmEngine(
|
||||
config.mistral_model,
|
||||
config.mistral_temperature,
|
||||
config.mistral_token_limit,
|
||||
config.mistral_api_key,
|
||||
)
|
||||
|
||||
if config.qwq_enabled:
|
||||
self._llms['qwq'] = QwQLlmEngine(
|
||||
config.qwq_model,
|
||||
config.qwq_temperature,
|
||||
self._action_schema,
|
||||
# Use the config.llms property which returns only enabled LLMs
|
||||
for llm_name, executable_path in config.llms.items():
|
||||
self._llms[llm_name] = LlmEngine(
|
||||
executable_path=executable_path,
|
||||
action_schema_path=str(config.action_schema)
|
||||
)
|
||||
|
||||
if not self._llms:
|
||||
raise ValueError("No LLM engines enabled in configuration")
|
||||
|
||||
self._io_buffer = WebIOBuffer()
|
||||
self._io_buffer = ChatIOBuffer()
|
||||
self._working_memory = WorkingMemory()
|
||||
self._agent = WebAgent(
|
||||
system_prompt=self._system_prompt,
|
||||
|
||||
Reference in New Issue
Block a user