Skip to content

loke-js/LLM-Orchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

AI Orchestrator - Setup Guide

📌 Project Overview

This project is an AI Orchestrator that processes user inputs using an LLM (Groq) to determine the correct task and executes the corresponding Docker container for processing. The frontend provides a chat-based interface to interact with the backend.

AI Orchestrator Architecture


🚀 How the Orchestrator Works

1️⃣ User Input and Task Identification

  • The frontend sends user input (prompt) to the orchestrator backend.
  • The LLM (Groq) processes the input and extracts the relevant task type (e.g., data-cleaning, sentiment-analysis).
  • The LLM returns a structured JSON containing:
    {
      "task": "data-cleaning",
      "input": { "data": [...dataset provided by user] }
    }

2️⃣ Running the Correct Docker Container

  • Based on the identified task, the orchestrator selects and runs the corresponding Docker container.
  • The orchestrator executes:
    docker run --rm <task-container-name> '<input-data>'
  • The container processes the input data and generates an output.

3️⃣ Sending Processed Output to Frontend

  • The orchestrator captures the processed data from the container output.
  • The result is formatted into a structured response and sent back to the frontend.
  • The chat UI displays:
    • The task response from the backend.
    • The processed dataset in a structured format.

🚀 Backend Setup

1️⃣ Navigate to Backend Directory

cd api

2️⃣ Install Dependencies

Ensure you have Node.js installed, then run:

npm install

3️⃣ Set Up Environment Variables

Create a .env file in the api/ directory and add:

GROQ_API_KEY=your_groq_api_key_here
PORT=4000

Replace your_groq_api_key_here with your actual Groq API key.

4️⃣ Start Backend Server

npm start

This will start the backend at http://localhost:4000.

5️⃣ Build and Run Docker Containers

docker-compose up --build

This will:

  • Build and start the required task containers (e.g., data-cleaning, sentiment-analysis).
  • Start the orchestrator service.

🚀 Frontend Setup

1️⃣ Navigate to Frontend Directory

cd client

2️⃣ Install Dependencies

npm install

3️⃣ Start the Frontend Server

npm run dev

This will start the frontend at http://localhost:5173.


✅ Verifying Setup

Once both backend and frontend are running, open the browser and go to:

  • Frontend UI: http://localhost:5173
  • Backend API: http://localhost:4000/api/process/prompt

You should be able to interact with the AI Orchestrator through the chat interface.


🛠 Troubleshooting

  • Backend not starting? Ensure PORT is correctly set in .env.
  • Docker not running? Run docker ps to check running containers.
  • Frontend API errors? Ensure backend is running at http://localhost:4000.

🚀 Now your AI Orchestrator is fully set up! Enjoy!