Update README.md
Browse files
README.md
CHANGED
@@ -1,10 +1,112 @@
|
|
1 |
---
|
2 |
title: Flask
|
3 |
-
emoji:
|
4 |
colorFrom: purple
|
5 |
colorTo: purple
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
---
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
title: Flask
|
3 |
+
emoji: 🤖
|
4 |
colorFrom: purple
|
5 |
colorTo: purple
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
---
|
9 |
|
10 |
+
# MoA Chat
|
11 |
+
|
12 |
+
MoA Chat is a multi-agent AI chat platform where several LLMs respond in parallel, and an aggregator model combines their outputs into a single response.
|
13 |
+
|
14 |
+
## Features
|
15 |
+
|
16 |
+
- Python 3 backend using Flask
|
17 |
+
- Frontend with HTML, JavaScript, TailwindCSS (optional)
|
18 |
+
- Simultaneous queries to multiple AI models
|
19 |
+
- Aggregator LLM refines the combined output
|
20 |
+
- Supports light and dark themes
|
21 |
+
- Switch documentation language between English and Spanish
|
22 |
+
- Secret API keys management
|
23 |
+
- Hugging Face Spaces compatibility
|
24 |
+
- Docker support
|
25 |
+
- Free models through OpenRouter and others
|
26 |
+
|
27 |
+
## Requirements
|
28 |
+
|
29 |
+
- Python 3.11+
|
30 |
+
- pip
|
31 |
+
- API keys for model providers
|
32 |
+
|
33 |
+
## Installation
|
34 |
+
|
35 |
+
1. Clone the repository:
|
36 |
+
|
37 |
+
```bash
|
38 |
+
git clone https://huggingface.co/spaces/UntilDot/Flask
|
39 |
+
cd Flask
|
40 |
+
```
|
41 |
+
|
42 |
+
2. Create a `.env` file:
|
43 |
+
|
44 |
+
```env
|
45 |
+
OPENROUTER_API_KEY=your-openrouter-key
|
46 |
+
TOGETHER_API_KEY=your-together-key
|
47 |
+
GROK_API_KEY=your-grok-key
|
48 |
+
GROQ_API_KEY=your-groq-key
|
49 |
+
```
|
50 |
+
|
51 |
+
3. Install dependencies:
|
52 |
+
|
53 |
+
```bash
|
54 |
+
pip install -r requirements.txt
|
55 |
+
```
|
56 |
+
|
57 |
+
4. Run the application:
|
58 |
+
|
59 |
+
```bash
|
60 |
+
python app.py
|
61 |
+
```
|
62 |
+
|
63 |
+
The server will be available at `http://localhost:7860`.
|
64 |
+
|
65 |
+
## Adding New Models
|
66 |
+
|
67 |
+
Edit the file `llm/model_config.json` to register new models and providers.
|
68 |
+
|
69 |
+
Example:
|
70 |
+
|
71 |
+
```json
|
72 |
+
{
|
73 |
+
"providers": {
|
74 |
+
"openrouter": {
|
75 |
+
"url": "https://openrouter.ai/api/v1/chat/completions",
|
76 |
+
"key_env": "OPENROUTER_API_KEY"
|
77 |
+
}
|
78 |
+
},
|
79 |
+
"models": {
|
80 |
+
"deepseek/deepseek-chat-v3-0324:free": "openrouter"
|
81 |
+
}
|
82 |
+
}
|
83 |
+
```
|
84 |
+
|
85 |
+
## Docker Support
|
86 |
+
|
87 |
+
To build and run using Docker:
|
88 |
+
|
89 |
+
Create the following `Dockerfile`:
|
90 |
+
|
91 |
+
```Dockerfile
|
92 |
+
FROM python:3.11-slim
|
93 |
+
WORKDIR /app
|
94 |
+
COPY requirements.txt ./
|
95 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
96 |
+
COPY . .
|
97 |
+
EXPOSE 7860
|
98 |
+
CMD ["python", "app.py"]
|
99 |
+
```
|
100 |
+
|
101 |
+
Then:
|
102 |
+
|
103 |
+
```bash
|
104 |
+
docker build -t moa-chat .
|
105 |
+
docker run -d -p 7860:7860 --env-file .env moa-chat
|
106 |
+
```
|
107 |
+
|
108 |
+
Environment variables or an `.env` file are required for API keys.
|
109 |
+
|
110 |
+
## License
|
111 |
+
|
112 |
+
Licensed under the Apache License 2.0.
|