Echo is an AI chat assistant application built with Chainlit and OpenRouter. It provides a beautiful, conversational interface for interacting with multiple AI models through a single platform — with OAuth authentication, streaming responses, and persistent chat history.
- 🔐 OAuth Authentication — Sign in with GitHub or Google
- 🤖 Multiple AI Models — Access various AI models through OpenRouter API
- 💬 Chat History & Threads — Conversations are saved and resumable per user
- ⚙️ Live Settings — Switch model, temperature, and context window mid-chat
- 🐳 Docker Ready — Fully containerized for easy deployment
- 🎨 Modern UI — Clean, responsive interface built with Chainlit
- 🔄 Streaming Responses — Real-time AI responses with token-level streaming
-
Pull the image from Docker Hub:
docker pull ragilhadi/echo:latest
-
Create a
.envfile:cp .env.example .env # Edit .env — fill in OPENROUTER_API_KEY, CHAINLIT_AUTH_SECRET, # and at least one OAuth provider (GitHub or Google)
Generate the auth secret:
chainlit create-secret
-
Run with Docker Compose:
docker-compose up -d
-
Access the application: Open your browser and navigate to
http://localhost:8000
-
Clone the repository:
git clone <repository-url> cd chatbot-web
-
Create
.envfile:cp .env.example .env # Edit .env — add your keys and secrets -
Build and run with Docker Compose:
docker-compose up -d --build
| Variable | Required | Description |
|---|---|---|
OPENROUTER_API_KEY |
✅ | Your OpenRouter API key |
CHAINLIT_AUTH_SECRET |
✅ | JWT signing secret (generate with chainlit create-secret) |
OAUTH_GITHUB_CLIENT_ID |
⬜ | GitHub OAuth app client ID |
OAUTH_GITHUB_CLIENT_SECRET |
⬜ | GitHub OAuth app client secret |
OAUTH_GOOGLE_CLIENT_ID |
⬜ | Google OAuth app client ID |
OAUTH_GOOGLE_CLIENT_SECRET |
⬜ | Google OAuth app client secret |
CHAINLIT_URL |
⬜ | Public URL when behind a reverse proxy |
At least one OAuth provider (GitHub or Google) must be configured.
- Visit OpenRouter
- Sign up for an account
- Navigate to API Keys section
- Generate a new API key
- Add it to your
.envfile
- Go to GitHub Developer Settings → OAuth Apps
- Create a new OAuth app
- Set callback URL to
http://localhost:8000/auth/oauth/github/callback - Copy Client ID and Client Secret to
.env
- Go to Google Cloud Console → Credentials
- Create a new OAuth 2.0 Client ID
- Set authorized redirect URI to
http://localhost:8000/auth/oauth/google/callback - Copy Client ID and Client Secret to
.env
.
├── app.py # Main Chainlit application (lifecycle hooks)
├── constants.py # Application constants & default system prompt
├── chainlit.md # Welcome screen content
├── .chainlit/
│ └── config.toml # Chainlit UI & feature configuration
├── modules/
│ ├── __init__.py # Module exports
│ ├── message_manager.py # Message formatting, trimming, sanitization
│ └── client/ # OpenRouter API client
│ ├── __init__.py
│ ├── base.py # Abstract base chat client
│ ├── openrouter.py # OpenRouter implementation
│ └── exception.py # Custom exceptions
├── Dockerfile # Docker image definition
├── docker-compose.yml # Docker Compose configuration
├── requirements.txt # Python dependencies
└── README.md # This file
- Sign in via GitHub or Google on the login page
- Type a message or pick a starter prompt
- The AI responds with streaming tokens in real time
Click the ⚙️ gear icon in the chat bar to open the settings panel:
- Model — Choose from available OpenRouter models
- Temperature — Control creativity (0 = focused, 2 = creative)
- Context Window — Number of conversation pairs sent to the model
- Previous conversations appear in the sidebar
- Click a thread to resume it
- Start a new conversation with the ➕ button
# 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 keys chainlit create-secret # generate CHAINLIT_AUTH_SECRET
-
Run the application:
chainlit run app.py -w
The
-wflag enables hot-reload during development.
- UI Framework: Chainlit
- AI API: OpenRouter
- Authentication: OAuth 2.0 (GitHub, Google)
- 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 and Chainlit auth secret - Verify at least one OAuth provider is configured
- Verify Docker and Docker Compose are properly installed
Enjoy chatting with Echo! 🔊