UntilDot commited on
Commit
11cdaee
·
verified ·
1 Parent(s): 0aed15a

Update templates/docs.html

Browse files
Files changed (1) hide show
  1. templates/docs.html +128 -140
templates/docs.html CHANGED
@@ -7,73 +7,57 @@
7
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
8
  <link rel="stylesheet" href="/static/style.css" />
9
  </head>
10
- <body class="bg0 text-fg0 transition-colors duration-300 flex flex-col min-h-screen">
11
-
12
- <!-- Top Fixed Bar -->
13
- <header class="flex items-center justify-between p-4 bg1 shadow-md sticky top-0 z-50">
14
- <h1 class="text-2xl font-bold">Documentation</h1>
15
- <div class="space-x-2 flex items-center">
16
- <a href="/" id="chatButton" class="px-3 py-1 rounded bg-blue hover:bg-purple text-fg0 transition">← Chat</a>
17
- <button id="langToggle" class="px-3 py-1 rounded bg-blue hover:bg-purple text-fg0 transition">🌐</button>
18
- <button id="themeToggle" class="px-3 py-1 rounded bg-blue hover:bg-purple text-fg0 transition">🌙</button>
19
  </div>
 
20
  </header>
21
 
22
- <!-- Scrollable Main Content -->
23
- <main class="flex-1 overflow-y-auto p-6 space-y-8 flex flex-col items-center">
24
-
25
- <div class="w-full max-w-3xl space-y-8">
26
-
27
- <!-- English Section -->
28
- <section id="en" class="space-y-8">
29
-
30
- <div class="space-y-4">
31
- <h2 class="text-xl font-semibold">What is MoA Chat?</h2>
32
- <p>
33
- MoA Chat is a minimalistic, self-hostable AI chat platform based on the Mixture of Agents (MoA) architecture.
34
- It queries multiple AI models (LLMs) simultaneously and combines their answers into a final response.
35
- </p>
36
- </div>
37
-
38
- <div class="space-y-4">
39
- <h2 class="text-xl font-semibold">How It Works</h2>
40
- <img src="https://github.com/togethercomputer/MoA/raw/main/assets/moa-explained.png" alt="MoA Architecture" class="rounded shadow-lg mx-auto max-w-md">
41
- <p>
42
- Three models (LLM-A, LLM-B, LLM-C) answer the prompt individually. A fourth model (LLM-D) acts as an aggregator,
43
- synthesizing the responses into a single high-quality answer.
44
- </p>
45
- </div>
46
-
47
- <div class="space-y-4">
48
- <h2 class="text-xl font-semibold">Features</h2>
49
- <ul class="list-disc list-inside space-y-2">
50
- <li>🔹 Modern, responsive, and fast web UI</li>
51
- <li>🔹 Gruvbox Material theming with auto light/dark mode</li>
52
- <li>🔹 Parallel API querying for faster responses</li>
53
- <li>🔹 Dynamic model loading — no hardcoding needed</li>
54
- <li>🔹 100% free and self-hostable</li>
55
- </ul>
56
- </div>
57
-
58
- <div class="space-y-4">
59
- <h2 class="text-xl font-semibold">How to Self-Host</h2>
60
-
61
- <p>Clone the repository:</p>
62
- <pre class="bg-statusline1 p-4 rounded overflow-x-auto"><code>git clone https://github.com/your-repo/moa-chat.git
63
- cd moa-chat</code></pre>
64
-
65
- <p>Deploy to Hugging Face Spaces or locally via Docker:</p>
66
- <pre class="bg-statusline1 p-4 rounded overflow-x-auto"><code>docker build -t moa-chat .
67
- docker run -p 7860:7860 moa-chat</code></pre>
68
-
69
- <p>Create your API keys and add them to Hugging Face Secrets:</p>
70
- <pre class="bg-statusline1 p-4 rounded overflow-x-auto"><code>OPENROUTER_API_KEY=your-openrouter-key
71
  GROK_API_KEY=your-grok-key
72
  TOGETHER_API_KEY=your-together-key
73
  GROQ_API_KEY=your-groq-key</code></pre>
74
 
75
- <p>To add more models, edit <code>llm/model_config.json</code>:</p>
76
- <pre class="bg-statusline1 p-4 rounded overflow-x-auto"><code>{
 
77
  "providers": {
78
  "openrouter": {
79
  "url": "https://openrouter.ai/api/v1/chat/completions",
@@ -84,90 +68,94 @@ GROQ_API_KEY=your-groq-key</code></pre>
84
  "deepseek/deepseek-chat-v3-0324:free": "openrouter"
85
  }
86
  }</code></pre>
87
- <p>No backend code modification needed after updating the config.</p>
88
-
89
- </div>
90
-
91
- <div class="space-y-4">
92
- <h2 class="text-xl font-semibold">License</h2>
93
- <p>Licensed under <strong>Apache 2.0</strong>.</p>
94
- </div>
95
-
96
- <div class="space-y-4">
97
- <h2 class="text-xl font-semibold">Credits</h2>
98
- <p>Inspired by <a href="https://github.com/togethercomputer/MoA" target="_blank" class="text-blue hover:text-purple underline">Together MoA</a>. Built with ❤️ in Panamá.</p>
99
- </div>
100
-
101
- </section>
102
-
103
- <!-- Spanish Section -->
104
- <section id="es" class="space-y-8 hidden">
105
-
106
- <div class="space-y-4">
107
- <h2 class="text-xl font-semibold">¿Qué es MoA Chat?</h2>
108
- <p>
109
- MoA Chat es una plataforma minimalista de chat de IA, basada en la arquitectura Mixture of Agents (MoA).
110
- Permite consultar múltiples modelos de lenguaje (LLMs) simultáneamente y combinar sus respuestas.
111
- </p>
112
- </div>
113
-
114
- <div class="space-y-4">
115
- <h2 class="text-xl font-semibold">¿Cómo Funciona?</h2>
116
- <img src="https://github.com/togethercomputer/MoA/raw/main/assets/moa-explained.png" alt="Arquitectura MoA" class="rounded shadow-lg mx-auto max-w-md">
117
- <p>
118
- Tres modelos (LLM-A, LLM-B, LLM-C) responden. El modelo LLM-D agrega y sintetiza las respuestas en una final coherente.
119
- </p>
120
- </div>
121
-
122
- <div class="space-y-4">
123
- <h2 class="text-xl font-semibold">Características</h2>
124
- <ul class="list-disc list-inside space-y-2">
125
- <li>🔹 UI moderna y rápida</li>
126
- <li>🔹 Tematización Gruvbox con modo claro/oscuro automático</li>
127
- <li>🔹 Consultas paralelas para mayor rapidez</li>
128
- <li>🔹 Soporte dinámico de modelos</li>
129
- <li>🔹 100% autohospedable</li>
130
- </ul>
131
- </div>
132
-
133
- <div class="space-y-4">
134
- <h2 class="text-xl font-semibold">Cómo Autohospedarlo</h2>
135
-
136
- <p>Clona el repositorio:</p>
137
- <pre class="bg-statusline1 p-4 rounded overflow-x-auto"><code>git clone https://github.com/your-repo/moa-chat.git
138
- cd moa-chat</code></pre>
139
-
140
- <p>Despliega en Hugging Face o corre localmente con Docker:</p>
141
- <pre class="bg-statusline1 p-4 rounded overflow-x-auto"><code>docker build -t moa-chat .
142
- docker run -p 7860:7860 moa-chat</code></pre>
143
-
144
- <p>Agrega tus llaves API en Hugging Face Secrets:</p>
145
- <pre class="bg-statusline1 p-4 rounded overflow-x-auto"><code>OPENROUTER_API_KEY=tu-clave
146
- GROK_API_KEY=tu-clave
147
- TOGETHER_API_KEY=tu-clave
148
- GROQ_API_KEY=tu-clave</code></pre>
149
-
150
- <p>Edita <code>llm/model_config.json</code> para añadir modelos nuevos.</p>
151
-
152
- </div>
153
-
154
- <div class="space-y-4">
155
- <h2 class="text-xl font-semibold">Licencia</h2>
156
- <p>Licenciado bajo <strong>Apache 2.0</strong>.</p>
157
- </div>
158
-
159
- <div class="space-y-4">
160
- <h2 class="text-xl font-semibold">Créditos</h2>
161
- <p>Inspirado por <a href="https://github.com/togethercomputer/MoA" target="_blank" class="text-blue hover:text-purple underline">Together MoA</a>. Construido con ❤️ en Panamá.</p>
162
- </div>
163
-
164
- </section>
165
 
166
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
  </main>
169
 
170
- <script src="/static/docs.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  </body>
173
  </html>
 
7
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
8
  <link rel="stylesheet" href="/static/style.css" />
9
  </head>
10
+ <body class="bg0 text-fg0 transition-colors duration-300 flex flex-col items-center min-h-screen">
11
+
12
+ <header class="w-full flex justify-between p-4">
13
+ <div class="flex space-x-2">
14
+ <button id="themeToggle" class="bg-blue px-3 py-1 rounded text-fg0 hover:bg-purple transition">🌙</button>
15
+ <button id="langToggle" class="bg-blue px-3 py-1 rounded text-fg0 hover:bg-purple transition">🌐</button>
 
 
 
16
  </div>
17
+ <a href="/" class="bg-blue px-4 py-1 rounded text-fg0 hover:bg-purple transition">← Back to Chat</a>
18
  </header>
19
 
20
+ <main class="p-8 max-w-4xl w-full flex flex-col space-y-8 items-center text-center overflow-y-auto">
21
+
22
+ <section id="en" class="space-y-8">
23
+ <h1 class="text-3xl font-bold">MoA Chat - Documentation</h1>
24
+
25
+ <p><strong>MoA Chat</strong> is an experimental project inspired by the MoA (Mixture of Agents) technique where multiple AI models collaborate to produce better answers.</p>
26
+
27
+ <img src="https://github.com/togethercomputer/MoA/blob/main/assets/moa-explained.png?raw=true" alt="MoA Architecture" class="w-full max-w-2xl rounded shadow">
28
+
29
+ <h2 class="text-2xl font-semibold">🚀 Features</h2>
30
+ <ul class="list-disc list-inside text-left">
31
+ <li>Connects multiple LLMs simultaneously</li>
32
+ <li>Uses a fourth LLM as an aggregator</li>
33
+ <li>Fully open source and self-hostable</li>
34
+ <li>Built using Python and Flask</li>
35
+ <li>Deployed easily on Hugging Face Spaces</li>
36
+ </ul>
37
+
38
+ <h2 class="text-2xl font-semibold">⚙️ How to Self-Host</h2>
39
+ <p>To clone this project and run it manually:</p>
40
+ <pre><code>git clone https://huggingface.co/spaces/UntilDot/Flask
41
+ cd Flask
42
+ python3 -m venv venv
43
+ source venv/bin/activate
44
+ pip install -r requirements.txt
45
+ python app.py</code></pre>
46
+
47
+ <p>If you wish to use Docker (advanced users):</p>
48
+ <pre><code>docker build -t moa-chat .
49
+ docker run -d -p 7860:7860 --env-file .env moa-chat</code></pre>
50
+
51
+ <h2 class="text-2xl font-semibold">🔑 API Keys</h2>
52
+ <p>The system uses secrets for security. You must define these keys in your Hugging Face Space settings or your .env file:</p>
53
+ <pre><code>OPENROUTER_API_KEY=your-openrouter-key
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  GROK_API_KEY=your-grok-key
55
  TOGETHER_API_KEY=your-together-key
56
  GROQ_API_KEY=your-groq-key</code></pre>
57
 
58
+ <h2 class="text-2xl font-semibold">🛠️ Adding More Models</h2>
59
+ <p>To add new models, edit <code>llm/model_config.json</code> like this:</p>
60
+ <pre><code>{
61
  "providers": {
62
  "openrouter": {
63
  "url": "https://openrouter.ai/api/v1/chat/completions",
 
68
  "deepseek/deepseek-chat-v3-0324:free": "openrouter"
69
  }
70
  }</code></pre>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
+ <p>Each model must point to a provider. Each provider defines its own endpoint and required secret.</p>
73
+
74
+ <h2 class="text-2xl font-semibold">📖 License</h2>
75
+ <p>This project is licensed under <strong>Apache 2.0</strong>.</p>
76
+
77
+ <footer class="text-sm opacity-70 pt-8">
78
+ Made with ❤️ in Panamá
79
+ </footer>
80
+ </section>
81
+
82
+ <section id="es" class="space-y-8 hidden">
83
+ <h1 class="text-3xl font-bold">MoA Chat - Documentación</h1>
84
+
85
+ <p><strong>MoA Chat</strong> es un proyecto experimental inspirado en la técnica MoA (Mixture of Agents), donde varios modelos de IA colaboran para generar mejores respuestas.</p>
86
+
87
+ <img src="https://github.com/togethercomputer/MoA/blob/main/assets/moa-explained.png?raw=true" alt="Arquitectura MoA" class="w-full max-w-2xl rounded shadow">
88
+
89
+ <h2 class="text-2xl font-semibold">🚀 Características</h2>
90
+ <ul class="list-disc list-inside text-left">
91
+ <li>Conecta múltiples LLMs simultáneamente</li>
92
+ <li>Utiliza un cuarto LLM como agregador</li>
93
+ <li>Completamente open source y autohospedable</li>
94
+ <li>Construido con Python y Flask</li>
95
+ <li>Desplegado fácilmente en Hugging Face Spaces</li>
96
+ </ul>
97
+
98
+ <h2 class="text-2xl font-semibold">⚙️ Cómo Autohospedar</h2>
99
+ <p>Para clonar y ejecutar este proyecto manualmente:</p>
100
+ <pre><code>git clone https://huggingface.co/spaces/UntilDot/Flask
101
+ cd Flask
102
+ python3 -m venv venv
103
+ source venv/bin/activate
104
+ pip install -r requirements.txt
105
+ python app.py</code></pre>
106
+
107
+ <p>O si deseas usar Docker (usuarios avanzados):</p>
108
+ <pre><code>docker build -t moa-chat .
109
+ docker run -d -p 7860:7860 --env-file .env moa-chat</code></pre>
110
+
111
+ <h2 class="text-2xl font-semibold">🔑 Llaves API</h2>
112
+ <p>Debes definir las llaves API en la configuración del espacio o en tu archivo <code>.env</code>:</p>
113
+ <pre><code>OPENROUTER_API_KEY=tu-clave-openrouter
114
+ GROK_API_KEY=tu-clave-grok
115
+ TOGETHER_API_KEY=tu-clave-together
116
+ GROQ_API_KEY=tu-clave-groq</code></pre>
117
+
118
+ <h2 class="text-2xl font-semibold">🛠️ Agregar Modelos</h2>
119
+ <p>Para agregar modelos, edita <code>llm/model_config.json</code> así:</p>
120
+ <pre><code>{
121
+ "providers": {
122
+ "openrouter": {
123
+ "url": "https://openrouter.ai/api/v1/chat/completions",
124
+ "key_env": "OPENROUTER_API_KEY"
125
+ }
126
+ },
127
+ "models": {
128
+ "deepseek/deepseek-chat-v3-0324:free": "openrouter"
129
+ }
130
+ }</code></pre>
131
+
132
+ <p>Cada modelo debe apuntar a un proveedor que define el endpoint y la clave secreta necesaria.</p>
133
+
134
+ <h2 class="text-2xl font-semibold">📖 Licencia</h2>
135
+ <p>Este proyecto está licenciado bajo <strong>Apache 2.0</strong>.</p>
136
+
137
+ <footer class="text-sm opacity-70 pt-8">
138
+ Hecho con ❤️ en Panamá
139
+ </footer>
140
+ </section>
141
 
142
  </main>
143
 
144
+ <script>
145
+ const themeToggle = document.getElementById('themeToggle');
146
+ themeToggle.addEventListener('click', () => {
147
+ document.documentElement.classList.toggle('dark');
148
+ themeToggle.textContent = document.documentElement.classList.contains('dark') ? '🌙' : '☀️';
149
+ });
150
+
151
+ const langToggle = document.getElementById('langToggle');
152
+ const en = document.getElementById('en');
153
+ const es = document.getElementById('es');
154
+ langToggle.addEventListener('click', () => {
155
+ en.classList.toggle('hidden');
156
+ es.classList.toggle('hidden');
157
+ });
158
+ </script>
159
 
160
  </body>
161
  </html>