Online Demo: freemindgpt.com/reflectionanyllm
Important: This demo is running on OpenRouter's free tier, utilizing Gemini-pro-1.5
, . While it showcases basic functionality, for more advanced use cases, models like GPT-4o, LLaMA 3.1 70b, or 405b would offer far better performance. The demo may also occasionally stop working if usage limits are exceeded.
This was requested to share with the public on the following Reddit thread by me: https://www.reddit.com/r/LocalLLaMA/comments/1fgo671/openai_sent_me_an_email_threatening_a_ban_if_i/
ReflectionAnyLLM is a lightweight proof-of-concept that enables basic chain-of-thought (CoT) reasoning with any Large Language Model (LLM) that supports the OpenAI-compatible API. The flexibility of this project allows it to interface with local or remote LLMs, giving you the ability to switch between providers with minimal setup.
The project can be integrated with multiple LLM providers, including but not limited to:
By replacing the API key and endpoint, you can easily adapt this project to work with other LLMs that support OpenAI's API format.
chat.php
file.To get started with ReflectionAnyLLM, you’ll need a local web server. The following servers are recommended based on your operating system:
Note: MySQL is not required, but your server must have PHP installed with the curl
extension enabled. Running php -S
(PHP's built-in server) will not work out of the box, as this project relies on the curl
extension to handle API requests.
Before running the project, ensure you have the following:
curl
: Ensure the curl
extension is enabled in your PHP configuration. This is critical for handling API requests.index.html
and chat.php
files to your web server’s public directory:
htdocs/
htdocs/
/var/www/
curl
extension is active on your PHP server:
php.ini
file, ensure that extension=curl
is not commented out.Once set up, navigate to the project directory through your browser:
http://localhost/
in your web browser.ReflectionAnyLLM/
├── index.html # Front-end HTML file
└── chat.php # Backend PHP script for handling API requests
The front-end interacts with the back-end PHP script, which makes API requests to the LLM. You can modify the API settings by editing the chat.php
file, where you can:
This flexibility allows the project to be used with any compatible LLM service, enabling quick testing and iteration.
This project was developed as a quick demo and should be considered a prototype. Here are some key things to note:
chat.php
.chat.php
, is not secured and is not suitable for production environments. It was created quickly to demonstrate basic functionality and lacks robust security practices.While this project serves as a simple demonstration of basic LLM interactions, it can be expanded in several ways:
If there’s interest from the community, I may continue developing and improving this project. Feedback and suggestions are welcome!
ReflectionAnyLLM can be easily adapted to various programming languages. If you create a port in another language, feel free to submit it by opening an issue on the repository, and I'll gladly list it here. Don't forget to attribute the original project when submitting your port!
Please note that different languages provide different results but the basic is the same, for example some might use a termnial, some might be a webui.
Here are the currently available ports:
I created this project based on a request from Reddit, and I’m happy to share it with the community. If you find ways to improve it or want to contribute new features, please fork the repository and submit a pull request.
This project is licensed under the MIT License, meaning you're free to use, modify, and distribute it, as long as attribution is provided.
Feel free to explore, modify, and share your improvements! If you have any questions or encounter issues, don’t hesitate to reach out.