A real-time chat application powered by the OpenRouter API (LLaMA 3).
Built with Laravel for the backend and Vue.js for the frontend.
- Chat with an AI assistant in real-time
- Session-based memory for contextual conversations
- Vue-powered chat UI
- OpenRouter API integration (LLaMA 3)
OPENROUTER_API_KEY=your_api_key_here
// routes/api.php
Route::post('/ai-response', [\App\Http\Controllers\GetAiResponse::class, 'getAiResponse']);
Route::get('/conversation', [\App\Http\Controllers\GetAiResponse::class, 'getConversation']);
Route::post('/conversation/save', [\App\Http\Controllers\GetAiResponse::class, 'saveConversation']);
The controller handles:
- Validating prompt input
- Maintaining session-based history
- Sending chat history to OpenRouter API
- Returning the latest assistant response
💡 Only the latest 10 messages are kept in the session to limit payload size.
npm install axios
php artisan serve
npm run dev
Then visit:
http://localhost:8000
or your configured front-end route.
{
"prompt": "Hello, how are you?"
}
{
"response": "I'm doing great, how can I help you today?"
}
Made by: Version Control
Stack: Laravel 12 + Vue.js 3 + OpenRouter API
This project is open-sourced under the MIT license.
© 2025 Version Control. All rights reserved.