ChatLite 🤖
A lightweight, extensible chat application framework for building AI-powered chat interfaces. ChatLite provides an easy-to-use platform for integrating various language models with web-based chat applications.
✨ Features
- 🔄 Real-time WebSocket communication
- 🎯 Multi-model support (Llama, Qwen, etc.)
- 🌐 Web search integration
- 🎨 Customizable UI with modern design
- 🔌 Plugin architecture for easy extensions
- 💬 Chat history management
- 🎭 Multiple agent types support
- 📱 Responsive design
🚀 Quick Start
Installation
pip install chatlite
Basic Usage
import chatlite
# Start a simple chat server with Llama 3.2
chatlite.local_llama3p2()
# Or use Qwen 2.5
chatlite.local_qwen2p5()
# Custom configuration
server = chatlite.create_server(
model_type="local",
model_name="llama3.2:latest",
temperature=0.7,
max_tokens=4000
)
server.run()
Pre-configured Models
ChatLite comes with several pre-configured models:
# Use different models directly
from chatlite import mistral_7b_v3, mixtral_8x7b, qwen_72b
# Start Mistral 7B server
mistral_7b_v3()
# Start Mixtral 8x7B server
mixtral_8x7b()
# Start Qwen 72B server
qwen_72b()
💻 Frontend Integration
ChatLite includes a Flutter-based frontend that can be easily customized. Here's a basic example of connecting to the ChatLite server:
final channel = WebSocketChannel.connect(
Uri.parse('ws://localhost:8143/ws/$clientId'),
);
// Send message
channel.sink.add(json.encode({
'message': 'Hello!',
'model': 'llama3.2:latest',
'system_prompt': 'You are a helpful assistant',
'agent_type': 'WebSearchAgent',
'is_websearch_chat': true
}));
// Listen for responses
channel.stream.listen(
(message) {
final data = jsonDecode(message);
if (data['type'] == 'stream') {
print(data['message']);
}
},
onError: (error) => print('Error: $error'),
onDone: () => print('Connection closed'),
);
🔧 Configuration
ChatLite supports various configuration options:
from chatlite import create_server
server = create_server(
model_type="local", # local, huggingface, etc.
model_name="llama3.2:latest",
api_key="your-api-key", # if needed
temperature=0.7, # model temperature
max_tokens=4000, # max response length
base_url="http://localhost:11434/v1", # model API endpoint
)
🧩 Available Agents
ChatLite supports different agent types for specialized tasks:
WebSearchAgent: Internet-enabled chat with web search capabilitiesRawWebSearchAgent: Direct web search results without summarizationEmailAssistantFeature: Email composition and analysisDefaultChatFeature: Standard chat functionality
Example usage:
# Client-side configuration
message_data = {
"message": "What's the latest news about AI?",
"model": "llama3.2:latest",
"agent_type": "WebSearchAgent",
"is_websearch_chat": True
}
🎨 UI Customization
The included Flutter frontend supports extensive customization:
ThemeData(
brightness: Brightness.dark,
scaffoldBackgroundColor: const Color(0xFF1C1C1E),
primaryColor: const Color(0xFF1C1C1E),
colorScheme: const ColorScheme.dark(
primary: Color(0xFFFF7762),
secondary: Color(0xFFFF7762),
),
)
📦 Project Structure
chatlite/
├── __init__.py # Main package initialization
├── core/ # Core functionality
│ ├── config.py # Configuration handling
│ ├── model_service.py # Model interaction
│ └── features/ # Feature implementations
├── ui/ # Flutter frontend
└── examples/ # Usage examples
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
🙏 Acknowledgments
- Built with FastAPI and Flutter
- Inspired by modern chat applications
- Uses various open-source language models
Metadata
Release files for chatlite 0.1.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| chatlite-0.1.13.tar.gz | 54.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chatlite-0.1.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.2 kB
Release files / chatlite-0.1.13.tar.gz
| Download URL | chatlite-0.1.13.tar.gz |
|---|---|
| Size | 54.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0799b10c319a2e9494b29be406a2b96d80aacfa5ad6efe47f39f5b480dfd548
|
|
BLAKE2b-256 checksum How to use checksums |
b8cf802c76622935a31d0b8e511bd76fd3f1164b108fb35c06e28561691c5154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.11.0rc1 Linux/6.8.0-52-generic
|
Release files / chatlite-0.1.13-py3-none-any.whl
| Download URL | chatlite-0.1.13-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ccb2c7b58b6af5ed6f3eabeef7975d617da7c950c6bc867f7792393722e5ba64
|
|
BLAKE2b-256 checksum How to use checksums |
ace0c8ad32dd57064ff1b572ca01c1925906660399761442919e6bbee39f4539
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.11.0rc1 Linux/6.8.0-52-generic
|
Security for chatlite 0.1.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.