File size: 2,037 Bytes
c78d1b6
 
a997fd6
c78d1b6
 
 
 
 
 
a997fd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
title: Flask
emoji: 🤖
colorFrom: purple
colorTo: purple
sdk: docker
pinned: false
---

# MoA Chat

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.

## Features

- Python 3 backend using Flask
- Frontend with HTML, JavaScript, TailwindCSS (optional)
- Simultaneous queries to multiple AI models
- Aggregator LLM refines the combined output
- Supports light and dark themes
- Switch documentation language between English and Spanish
- Secret API keys management
- Hugging Face Spaces compatibility
- Docker support
- Free models through OpenRouter and others

## Requirements

- Python 3.11+
- pip
- API keys for model providers

## Installation

1. Clone the repository:

```bash
git clone https://huggingface.co/spaces/UntilDot/Flask
cd Flask
```

2. Create a `.env` file:

```env
OPENROUTER_API_KEY=your-openrouter-key
TOGETHER_API_KEY=your-together-key
GROK_API_KEY=your-grok-key
GROQ_API_KEY=your-groq-key
```

3. Install dependencies:

```bash
pip install -r requirements.txt
```

4. Run the application:

```bash
python app.py
```

The server will be available at `http://localhost:7860`.

## Adding New Models

Edit the file `llm/model_config.json` to register new models and providers.

Example:

```json
{
  "providers": {
    "openrouter": {
      "url": "https://openrouter.ai/api/v1/chat/completions",
      "key_env": "OPENROUTER_API_KEY"
    }
  },
  "models": {
    "deepseek/deepseek-chat-v3-0324:free": "openrouter"
  }
}
```

## Docker Support

To build and run using Docker:

Create the following `Dockerfile`:

```Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["python", "app.py"]
```

Then:

```bash
docker build -t moa-chat .
docker run -d -p 7860:7860 --env-file .env moa-chat
```

Environment variables or an `.env` file are required for API keys.

## License

Licensed under the Apache License 2.0.