Echo is a AI chat assistant application built with Streamlit and OpenRouter. It provides a beautiful, intuitive interface for interacting with multiple AI models through a single platform.
- 🤖 Multiple AI Models - Access various AI models through OpenRouter API
- 💬 Multi-Room Chat - Create and manage multiple chat rooms
- 💾 Persistent History - All conversations are saved in SQLite database
- 🐳 Docker Ready - Fully containerized for easy deployment
- 🎨 Modern UI - Clean, responsive interface built with Streamlit
- 🔄 Streaming Responses - Real-time AI responses with streaming support
-
Pull the image from Docker Hub:
docker pull ragilhadi/echo:latest
-
Create a
.envfile with your OpenRouter API key:OPENROUTER_API_KEY=your_api_key_here
-
Create a
docker-compose.ymlfile:services: echo: image: ragilhadi/echo:latest container_name: echo ports: - "8501:8501" volumes: - ./echo_data:/app/data environment: - DB_PATH=/app/data/chat_history.db env_file: - .env restart: unless-stopped volumes: echo_data: driver: local
-
Run the application:
docker-compose up -d
-
Access the application: Open your browser and navigate to
http://localhost:8501
-
Clone the repository:
git clone <repository-url> cd chatbot-web
-
Create
.envfile:cp .env.example .env # Edit .env and add your OPENROUTER_API_KEY -
Build and run with Docker Compose:
docker-compose up -d --build
OPENROUTER_API_KEY(required) - Your OpenRouter API keyDB_PATH(optional) - Path to SQLite database file (default:chat_history.db)
- Visit OpenRouter
- Sign up for an account
- Navigate to API Keys section
- Generate a new API key
- Add it to your
.envfile
.
├── app.py # Main Streamlit application
├── constants.py # Application constants
├── modules/
│ ├── client/ # OpenRouter API client
│ │ ├── base.py # Base chat client
│ │ ├── openrouter.py # OpenRouter implementation
│ │ └── exception.py # Custom exceptions
│ ├── db/ # Database layer
│ │ └── db.py # SQLite database operations
│ └── frontend/ # Frontend components
│ ├── components/ # UI components
│ └── managers/ # State and data managers
├── Dockerfile # Docker image definition
├── docker-compose.yml # Docker Compose configuration
├── requirements.txt # Python dependencies
└── README.md # This file
- On the homepage, enter a name for your chat room
- Click "Create New Chat Room"
- Start chatting with AI models
- Switch Rooms: Use the sidebar to navigate between different chat rooms
- Delete Room: Remove a chat room and all its messages
- Clear History: Clear conversation history while keeping the room
- Choose from available OpenRouter models in the chat interface
- Models are dynamically loaded from OpenRouter API
- Free models are available for testing
All chat data is stored in a SQLite database that persists in the Docker volume:
- Volume Location:
./echo_dataon your host machine - Database File:
chat_history.db - Tables:
chat_rooms,messages
To backup your data, simply copy the ./echo_data directory.
# Start the application
docker-compose up -d
# View logs
docker-compose logs -f echo
# Stop the application
docker-compose down
# Rebuild and restart
docker-compose up -d --build
# Remove everything including volumes
docker-compose down -v-
Install Python 3.11+
-
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your API key -
Run the application:
streamlit run app.py
- Frontend: Streamlit
- AI API: OpenRouter
- Database: SQLite
- Containerization: Docker & Docker Compose
- Language: Python 3.11
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
Ragil Prasetyo
- Email: ragilhprasetyo@gmail.com
If you encounter any issues or have questions:
- Check the logs:
docker-compose logs -f echo - Ensure your
.envfile has a valid OpenRouter API key - Verify Docker and Docker Compose are properly installed
Enjoy chatting with Echo! 🔊