← Back to Chat

MoA Chat - Documentation

πŸ“– What is MoA Chat?

MoA Chat is a simple but powerful chat platform where multiple AI models answer the same question at the same time, and an aggregator model combines their outputs into one final answer.

MoA Architecture

βš™οΈ Features

πŸ› οΈ Self Hosting

You can clone the project like this (includes the Dockerfile for containerization):

git clone https://huggingface.co/spaces/UntilDot/Flask

Requirements:

Install dependencies:

pip install -r requirements.txt

Run locally:

python app.py

Default port is 7860 (to match Hugging Face standard).

🐳 Docker support:

Your repository includes a Dockerfile for easy containerization when you clone it. Here's the content:

# Use a slim Python base
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy source code
COPY . .

# Expose the default Hugging Face Spaces port
EXPOSE 7860

# Run the app
CMD ["python", "app.py"]

Alternatively, you can manually create your own Dockerfile with the above content if you prefer to customize it.

To build and run the Docker container after cloning the repository:

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

Docker will NOT automatically inject secrets unless you:

πŸ”‘ Environment Variables (Secrets)

To use this app, you must set your API keys in secrets or environment variables.

Follow this syntax:

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

You can set these in:

🧩 How to Add More Models

All models and providers are declared inside:

llm/model_config.json

The structure looks like this:

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

To add a new model:

Make sure your environment variables (secrets) are correctly configured.

🏷️ Licensing

This project is licensed under Apache 2.0 β€” You are free to use, modify, and distribute, even commercially.