masx-openchat-llm / README.md
ateetvatan
updated readme
4ede07c
---
title: MASX OpenChat
emoji: πŸ€–
colorFrom: indigo
colorTo: blue
sdk: docker
pinned: false
app_file: app.py
---
# MASX OpenChat LLM
**A FastAPI service that brings the OpenChat-3.5 language model to life through a clean, scalable REST API.**
## What is this?
MASX LLM OpenChat-3.5 model.
### πŸ”‘ Key Features
- **Powered by OpenChat-3.5**: Latest conversational AI model with 7B parameters
- **FastAPI + Docker**: Clean, modular, and containerized
- **Easy integration**: REST API ready for real-world apps
---
## πŸš€ Quick Start
### Requirements
- **8GB+ RAM** (16GB+ recommended)
- **GPU with 8GB+ VRAM** (optional but faster)
### Install dependencies
```bash
pip install -r requirements.txt
```
### Config
```bash
cp env.example .env
# Edit .env with your preferred settings
```
### Start the server
```bash
python app.py
```
**That's it!** Your AI service is now running at `http://localhost:8080`
## Use
### Basic Chat Request
```bash
curl -X POST "http://localhost:8080/chat" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Hello! Can you help me write a Python function?",
"max_tokens": 256,
"temperature": 0.7
}'
```
### Response Format
```json
{
"response": "Of course! I'd be happy to help you write a Python function. What kind of function would you like to create? Please let me know what it should do, and I'll help you implement it with proper syntax and best practices."
}
```
### API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/status` | GET | Check service health and get model info |
| `/chat` | POST | Generate AI responses |
| `/docs` | GET | Interactive API documentation (Swagger UI) |
| `/redoc` | GET | Alternative API documentation |
### Request Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `prompt` | string | **required** | Your input text/question |
| `max_tokens` | integer | 256 | Maximum tokens to generate |
| `temperature` | float | 0.0 | Creativity level (0.0 = deterministic, 2.0 = very creative) |
## πŸ”§ Configuration
The service is highly configurable through environment variables. Copy `env.example` to `.env` and customize:
### Essential Settings
```bash
# Server Configuration
HOST=0.0.0.0
PORT=8080
LOG_LEVEL=info
```
### Advanced S
## 🐳 Docker Deployment
## πŸ“Š Monitoring & Health
### Health Check
```bash
curl http://localhost:8080/status
```
Response:
```json
{
"status": "ok",
"max_tokens": 4096
}
```
### Logs
The service provides comprehensive logging:
- **Application logs**: `./logs/app.log`
- **Console output**: Real-time server logs
- **Error tracking**: Detailed error information with stack traces
## πŸ› οΈ Development
### Project Structure
```
masx-openchat-llm/
β”œβ”€β”€ app.py # FastAPI application
β”œβ”€β”€ model_loader.py # Model loading and configuration
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ .env.example # Environment variables template
β”œβ”€β”€ .gitignore # Git ignore rules
└── README.md # This file
```
### Adding Features
1. **New Endpoints**: Add routes in `app.py`
2. **Model Configuration**: Modify `model_loader.py`
3. **Dependencies**: Update `requirements.txt`
4. **Environment Variables**: Add to `env.example`
---
**Made by the MASX AI **
*Ready to build the future of AI-powered applications? Start with MASX OpenChat LLM!*