A web application that allows you to compare the speed of different Large Language Models (LLMs) by running the same prompt across multiple models simultaneously.
- Compare response times of up to 3 different LLMs at once
- Support for multiple providers (starting with OpenRouter)
- ChatGPT-like user interface with dark/light theme support
- SQLite database for storing test results
- Hot reload for both frontend and backend development
- React + Vite
- TypeScript
- ShadCn UI components
- Tailwind CSS
- Dark mode by default
- Deno
- Oak web framework
- SQLite database
- OpenRouter API integration
- Node.js (for frontend)
- Deno (for backend)
- OpenRouter API key
git clone https://github.com/marvijo-code/CodingWithGLM.git
cd CodingWithGLMcd frontend
npm installThe backend uses Deno, so no additional dependencies need to be installed.
Create a .env.local file in the backend directory:
# OpenRouter API Configuration
OPENROUTER_API_KEY=your_openrouter_api_key_here
# Database Configuration
DATABASE_PATH=./llm_speed_test.db
# Server Configuration
PORT=8000
CORS_ORIGIN=http://localhost:5173
Replace your_openrouter_api_key_here with your actual OpenRouter API key.
Create a .env.local file in the frontend directory:
# API Configuration
VITE_API_BASE_URL=http://localhost:8000
.\run.ps1chmod +x run.sh
./run.shcd backend
deno task devcd frontend
npm run dev- Frontend: http://localhost:5173
- Backend: http://localhost:8000
- Open the application in your browser
- If you haven't set up your API key, you'll be prompted to enter it
- Enter a prompt you want to test
- Select up to 3 models to compare
- Click "Run Speed Test"
- View the results, including response times and model outputs
GET /api/openrouter/models- Get available modelsPOST /api/openrouter/test-connection- Test API connectionPOST /api/openrouter/generate- Generate completionPOST /api/openrouter/api-key- Save API keyGET /api/openrouter/api-key/status- Check API key status
POST /api/speed-test/run- Run speed testGET /api/speed-test/history- Get test historyGET /api/speed-test/models- Get available modelsGET /api/speed-test/popular-models- Get popular models
GET /api/test-results- Get test resultsGET /health- Health check
Both the frontend and backend support hot reload during development:
- Frontend: Vite provides hot reload out of the box
- Backend: Deno's
--watchflag enables hot reload
CodingWithGLM/
├── backend/
│ ├── db.ts # Database setup
│ ├── deno.json # Deno configuration
│ ├── main.ts # Main server file
│ ├── routes/
│ │ ├── openRouter.ts # OpenRouter API routes
│ │ └── speedTest.ts # Speed test routes
│ ├── services/
│ │ ├── dbService.ts # Database service
│ │ ├── openRouterService.ts # OpenRouter service
│ │ └── speedTestService.ts # Speed test service
│ ├── .env.example # Environment variables example
│ └── .env.local # Local environment variables (not tracked)
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── ui/ # ShadCn UI components
│ │ │ ├── SpeedTestInterface.tsx # Main speed test component
│ │ │ ├── theme-provider.tsx # Theme provider
│ │ │ └── theme-toggle.tsx # Theme toggle
│ │ ├── lib/
│ │ │ └── utils.ts # Utility functions
│ │ ├── services/
│ │ │ └── api.ts # API service
│ │ ├── App.tsx # Main App component
│ │ ├── main.tsx # Entry point
│ │ └── index.css # Global styles
│ ├── components.json # ShadCn configuration
│ ├── deno.json # Deno configuration
│ ├── package.json # Node.js dependencies
│ ├── tailwind.config.js # Tailwind CSS configuration
│ ├── vite.config.ts # Vite configuration
│ ├── .env.example # Environment variables example
│ └── .env.local # Local environment variables (not tracked)
├── run.sh # Linux/Mac run script
├── run.ps1 # Windows run script
└── README.md # This file
This project is open source and available under the MIT License.