PHP ChatGPT demo for chat and image generation
Top 15.6% on sourcepulse
This project provides a lightweight, self-hostable PHP-based web interface for interacting with OpenAI's ChatGPT and DALL-E APIs. It's designed for easy deployment and rapid response, targeting users who want a simple, customizable ChatGPT experience without complex dependencies or frameworks. The primary benefit is a fast, stream-based chat and image generation tool that can be easily modified and shared.
How It Works
The application utilizes PHP on the backend to communicate with OpenAI's API using a streaming mode, enabling real-time output as responses are generated. The frontend employs JavaScript's EventSource for efficient, server-sent events, supporting Markdown rendering, code highlighting, formula display, and image generation triggered by a leading "画" character. Its core design avoids frameworks and databases, relying on a few core PHP files for simplicity and ease of modification.
Quick Start & Requirements
key.php
.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
Direct access to OpenAI APIs from mainland China is blocked; users require a VPN, proxy, or a reverse proxy (e.g., Cloudflare Workers) for connectivity. Performance can be affected by server configuration, PHP environment settings, and proxy caching.
1 week ago
1 day