A sleek, modern chatbot powered by free LLMs from OpenRouter
Accessible AI conversations with cutting-edge language models
- 💬 Real-time Streaming - Get responses as they're generated
- 🛡️ Secure API Key Management - Your credentials stay private
- 🚀 Powered by Z-AI GLM - Advanced Z-ai/glm-4.5-air:free model
- 📊 Conversation History - Persistent chat sessions
- 🎨 Modern UI - Built with Streamlit for a clean interface
- 🛠️ Production Ready - Secure, efficient, and reliable
graph LR
A[User Input] --> B[Streamlit Frontend]
B --> C[API Key Validation]
C --> D[OpenRouter API]
D --> E[Z-ai/glm-4.5-air:free]
E --> D
D --> F[Response Streaming]
F --> G[Streamlit Display]
G --> H[Conversation History]
H --> B
-
Clone the repository
git clone https://github.com/BLShaw/or-chat.git cd or-chat -
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env
Edit
.envand add your OpenRouter API key:OPENROUTER_API_KEY=your_actual_api_key_here -
Launch the application
streamlit run app.py
Your chatbot will be available at http://localhost:8501
sequenceDiagram
participant U as User
participant S as Streamlit UI
participant A as or-chat
participant O as OpenRouter API
U->>S: Enter API Key
S->>A: Store securely in session
U->>S: Input message
S->>A: Validate and prepare request
A->>O: Send request with API key
O->>A: Stream model response
A->>S: Process and display
S->>U: Show response in chat
| Technology | Purpose |
|---|---|
| Interactive web interface | |
| Core application logic | |
| LLM API gateway | |
| Advanced language model |
- Architecture: GLM-4.5
- Type: Advanced reasoning model
- Cost: Free tier available
- Latency: Optimized for quick responses
- 🔐 API Key Isolation: Never stored or transmitted insecurely
- 🛡️ Input Validation: Length and content verification
- 🧱 Rate Limiting: Built-in protection against API abuse
- 📦 Session Management: Secure conversation persistence
| Metric | Value |
|---|---|
| Response Time | < 1 second (typical) |
| Memory Usage | < 100MB for 50 messages |
| Max Input Length | 2000 characters |
| Session History | 50 messages max |
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
graph LR
A[Input Token] --> B[GLM-4.5 Processing]
B --> C[Response Generation]
C --> D[Quality Check]
D --> E[Stream to UI]
B -.-> F[Context Understanding]
F -.-> G[Multi-turn Coherence]
G -.-> B
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or feature requests, please open an issue.