AI Chat: A Modern Laravel Starter Kit for Real-time AI Applications
Summary
AI Chat is a robust Laravel starter kit designed for building modern AI-powered chat applications. It features real-time streaming responses using the Prism PHP SDK, integrated with Inertia.js, Vue.js, and TailwindCSS, providing a solid foundation for dynamic user experiences. This kit enables developers to quickly launch AI chat solutions with a scalable backend and comprehensive features.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
AI Chat is a modern AI chat starter kit built with Laravel, offering a powerful foundation for developing AI-powered chat applications. It leverages Laravel's extensive ecosystem alongside the Prism PHP SDK to deliver real-time streaming responses, ensuring a dynamic and engaging user experience. This kit is ideal for developers looking to quickly launch AI chat solutions with a robust and scalable backend.
Installation
Getting started with AI Chat is straightforward. You can install it using the Laravel installer or Composer.
Using Laravel Installer:
laravel new --using=pushpak1300/ai-chat my-ai-chat
cd my-ai-chat
Using Composer:
composer create-project pushpak1300/ai-chat my-ai-chat
cd my-ai-chat
After installation, complete the setup:
# Install frontend dependencies
npm install
# Generate application key (if not done automatically)
php artisan key:generate
# Create database file (for SQLite)
touch database/database.sqlite
# Run migrations
php artisan migrate
# Start the development server
composer run dev
For more detailed instructions or troubleshooting, refer to the official repository.
Examples
AI Chat provides flexible configuration for integrating various AI providers and models.
AI Provider Configuration:
The application supports multiple AI providers such as OpenAI, Anthropic, Google Gemini, Ollama, Groq, Mistral, DeepSeek, xAI, and VoyageAI. You only need to configure the providers you intend to use by setting their respective API keys in your .env file.
Adding New Models:
AI models are defined in the app/Enums/ModelName.php file. To add support for new AI models, you need to:
- Add a new case to the
ModelNameenum with the exact model identifier used by the provider. - Implement
getName(),getDescription(), andgetProvider()methods for the new model case within the enum, mapping it to its human-readable name, description, and the correspondingPrism\Prism\Enums\Provider.
This structured approach allows for easy expansion and management of AI capabilities within your application.
Why Use It
AI Chat stands out as an excellent choice for several reasons:
- Real-time AI Responses: Experience seamless, streaming AI responses as they are generated, enhancing user interaction.
- Multiple AI Providers: Built-in support for a wide array of AI providers, offering flexibility and choice in your AI models.
- Robust Tech Stack: Leverages Laravel 12.x, Vue.js 3, Inertia.js 2.x, and TailwindCSS 4.x, ensuring a modern, performant, and maintainable application.
- Comprehensive Features: Includes an authentication system, appearance settings (light/dark mode), custom theming with Shadcn, and chat sharing capabilities.
- Developer-Friendly: Provides a solid foundation with clear documentation for setup, configuration, and future development.
Links
- GitHub Repository: https://github.com/pushpak1300/ai-chat
- Prism PHP SDK: https://prismphp.com/
- Laravel Framework: https://laravel.com
- Inertia.js: https://inertiajs.com