Skip to content

Latest commit

ย 

History

History
256 lines (172 loc) ยท 5.26 KB

File metadata and controls

256 lines (172 loc) ยท 5.26 KB

OpenLLM Monitor - Quick Start Guide

๐Ÿš€ Get Started in 5 Minutes

This quick start guide will get you up and running with OpenLLM Monitor in just a few minutes.

Prerequisites

  • โœ… Node.js 18+ installed
  • โœ… MongoDB running (local or cloud)
  • โœ… Git installed

Step 1: Download and Setup

# Clone the repository
git clone <your-repo-url>
cd openllm-monitor

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install

Step 2: Configure Environment

Create backend/.env file:

# Database (Required)
MONGODB_URI=mongodb://localhost:27017/openllm-monitor

# Server Configuration
PORT=3001
NODE_ENV=development
FRONTEND_URL=http://localhost:5173

# LLM Provider API Keys (Add the ones you use)
OPENAI_API_KEY=your-openai-key-here
OPENROUTER_API_KEY=your-openrouter-key-here
MISTRAL_API_KEY=your-mistral-key-here

# Ollama (if using local LLMs)
OLLAMA_BASE_URL=http://localhost:11434

Step 3: Start the Application

Open 3 terminals:

Terminal 1 - MongoDB (if using local MongoDB):

# Start MongoDB service
mongod

Terminal 2 - Backend:

cd backend
npm run dev

Terminal 3 - Frontend:

cd frontend
npm run dev

Step 4: Access the Dashboard

  1. Open your browser
  2. Go to: http://localhost:5173
  3. You should see the OpenLLM Monitor dashboard! ๐ŸŽ‰

Step 5: Test the System

Option A: Use Built-in Test Endpoints

  1. Navigate to Logs page
  2. The system automatically logs all LLM requests
  3. Check the Dashboard for real-time metrics

Option B: Manual API Test

Open a new terminal and test the API:

# Test health endpoint
curl http://localhost:3001/api/health

# Test logs endpoint
curl http://localhost:3001/api/logs

Quick MongoDB Setup (If Needed)

Option 1: Use Docker (Easiest)

docker run -d -p 27017:27017 --name mongodb mongo:latest

Option 2: Use the Provided Scripts

# Windows PowerShell
.\scripts\setup-mongodb.ps1

# Windows Command Prompt
.\scripts\setup-mongodb.bat

Option 3: MongoDB Atlas (Cloud)

  1. Go to MongoDB Atlas
  2. Create a free cluster
  3. Get connection string
  4. Update MONGODB_URI in .env

Verify Everything is Working

โœ… Backend: Visit http://localhost:3001/api/health - should return {"status":"OK"}

โœ… Frontend: Visit http://localhost:5173 - should show the dashboard

โœ… Database: Check the logs show connection to MongoDB

โœ… WebSocket: Dashboard should show "Connected" status

โœ… Verification Checklist

After setup, verify everything is working correctly:

1. Services Running

2. Dashboard Features

  • Dashboard loads without errors
  • Real-time updates working
  • Navigation between pages works
  • No console errors in browser

3. API Functionality

  • Can view existing logs
  • Can create new test requests
  • Analytics data displays correctly
  • Provider configurations accessible

4. Database

  • MongoDB collections created
  • Sample data visible
  • Queries performing well
  • Indexes created properly

๐Ÿงช Test Commands

# Test backend health
curl http://localhost:3001/api/health

# Test API info
curl http://localhost:3001/api/info

# Test logs endpoint
curl http://localhost:3001/api/logs

# Test provider endpoint
curl http://localhost:3001/api/providers

Expected Health Response

A healthy API should return:

{
  "status": "healthy",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "version": "1.0.0",
  "database": "connected"
}

What's Next?

1. Configure Providers

  • Go to Settings โ†’ Providers
  • Add your API keys
  • Test connections

2. Start Monitoring

  • Your LLM requests will automatically appear in Logs
  • View real-time metrics on Dashboard
  • Analyze performance in Analytics

3. Try Replay Feature

  • Go to Replay page
  • Test prompts across different providers
  • Compare responses and costs

Troubleshooting

"Cannot connect to MongoDB"

  • Make sure MongoDB is running
  • Check the connection string in .env
  • Try: mongod --version to verify installation

"Frontend won't load"

  • Check if backend is running on port 3001
  • Verify CORS settings in backend
  • Check browser console for errors

"API keys not working"

  • Verify API keys are correct
  • Check if you have credits/quota
  • Test API keys directly with provider APIs

"Port already in use"

  • Backend (3001): Kill the process or change PORT in .env
  • Frontend (5173): Vite will automatically try the next available port

Need Help?

Success! ๐ŸŽ‰

You now have OpenLLM Monitor running! Start making LLM requests and watch them appear in real-time on your dashboard.


Next Step: Read the complete User Guide to learn about all the powerful features available.