deepseek  by dirk1983

PHP ChatGPT demo for chat and image generation

created 2 years ago
3,147 stars

Top 15.6% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Install by deploying the PHP files to a web server.
  • Requires a PHP environment (no specific version mandated) and an OpenAI API key.
  • Configuration is done via key.php.
  • See http://mm1.ltd for a demo.

Highlighted Details

  • Stream mode for fast, real-time responses.
  • Supports GPT-3.5-Turbo, GPT-4, and DALL-E image generation.
  • Markdown, code highlighting, formula display, and context-aware conversations.
  • Lightweight, framework-free PHP codebase.
  • Basic authentication and IP logging options.

Maintenance & Community

  • Active community with group discussions for support and resource sharing.
  • Links to related projects, including a commercial version and a WeChat bot.
  • Discussion encouraged via Issues and Discussions.

Licensing & Compatibility

  • Fully open-source, with no explicit license mentioned. The README states "版权没有,改动不究" (no copyright, no restrictions on modifications).
  • Compatible with commercial use and closed-source linking due to its permissive nature.

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.

Health Check
Last commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
12
Star History
6 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.