Update templates/docs.html
Browse files- templates/docs.html +139 -90
templates/docs.html
CHANGED
@@ -1,125 +1,174 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en" class="bg0 text-fg0 dark">
|
3 |
<head>
|
4 |
-
<meta charset="UTF-8"
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0"
|
6 |
<title>Documentation - MoA Chat</title>
|
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 p-6">
|
11 |
|
12 |
-
|
13 |
-
<h1 class="text-3xl font-bold">MoA Chat Documentation</h1>
|
14 |
-
<button id="themeToggle" class="bg-blue px-3 py-1 rounded text-fg0 hover:bg-purple transition">🌙</button>
|
15 |
-
</header>
|
16 |
|
17 |
-
<div class="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
<p class="mb-4 text-lg">
|
22 |
-
<strong>MoA (Model of Agents)</strong> is a method that allows multiple AI models to collaborate to generate a higher-quality response than a single model could.
|
23 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
<p class="mb-4">
|
25 |
-
|
|
|
26 |
</p>
|
27 |
-
<
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
<
|
36 |
-
|
37 |
-
|
|
|
|
|
38 |
</p>
|
39 |
-
<p class="text-center text-sm opacity-70">Source: Together Computer, MoA Architecture Overview</p>
|
40 |
-
</section>
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
<li>Click ⚙️ to open the model configuration panel.</li>
|
46 |
-
<li>Select your preferred models for LLM-A, LLM-B, LLM-C, and Aggregator (LLM-D).</li>
|
47 |
-
<li>Type your message in the chat input box.</li>
|
48 |
-
<li>Press <strong>Send</strong> and watch the system generate a unified, better answer!</li>
|
49 |
-
</ol>
|
50 |
-
</section>
|
51 |
|
52 |
-
<section class="mb-10">
|
53 |
-
<h2 class="text-2xl font-semibold mb-4 text-blue">Features</h2>
|
54 |
-
<ul class="list-disc ml-6 text-lg">
|
55 |
-
<li>Parallel querying of multiple free and premium LLMs (OpenRouter, Together, Grok, etc.).</li>
|
56 |
-
<li>Structured system prompts for consistent quality.</li>
|
57 |
-
<li>Aggregator model intelligently fuses outputs into a coherent final response.</li>
|
58 |
-
<li>Dynamic Light/Dark Gruvbox Material theme.</li>
|
59 |
-
<li>Secure: No API keys exposed to frontend.</li>
|
60 |
-
<li>Minimal, fast, mobile-friendly interface.</li>
|
61 |
-
</ul>
|
62 |
</section>
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
<p class="text-lg">
|
70 |
-
|
71 |
</p>
|
72 |
-
</section>
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
<
|
77 |
-
|
78 |
-
<li
|
79 |
-
<li
|
80 |
-
<li><code>templates/</code> — Contains <code>index.html</code> and <code>docs.html</code>.</li>
|
81 |
-
<li><code>static/</code> — Contains <code>style.css</code> and <code>script.js</code>.</li>
|
82 |
</ul>
|
83 |
-
</section>
|
84 |
|
85 |
-
|
86 |
-
<
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
</p>
|
90 |
-
<
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
</p>
|
93 |
-
<p class="text-
|
94 |
-
|
95 |
</p>
|
96 |
-
</section>
|
97 |
|
98 |
-
|
|
|
|
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
</div>
|
104 |
|
105 |
<script>
|
106 |
-
|
107 |
-
const
|
108 |
-
themeToggle.addEventListener(
|
109 |
-
|
110 |
-
|
111 |
-
themeToggle.textContent = isDark ? "🌙" : "☀️";
|
112 |
});
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
themeToggle.textContent = "☀️";
|
122 |
-
}
|
123 |
});
|
124 |
</script>
|
125 |
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en" class="bg0 text-fg0 dark">
|
3 |
<head>
|
4 |
+
<meta charset="UTF-8" />
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6 |
<title>Documentation - MoA Chat</title>
|
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 |
+
<style>
|
10 |
+
.sticky-buttons {
|
11 |
+
position: fixed;
|
12 |
+
top: 1rem;
|
13 |
+
right: 1rem;
|
14 |
+
display: flex;
|
15 |
+
gap: 0.5rem;
|
16 |
+
z-index: 1000;
|
17 |
+
}
|
18 |
+
.sticky-buttons button {
|
19 |
+
padding: 0.5rem 0.75rem;
|
20 |
+
background-color: var(--blue);
|
21 |
+
color: var(--fg1);
|
22 |
+
border: none;
|
23 |
+
border-radius: 0.375rem;
|
24 |
+
font-weight: bold;
|
25 |
+
cursor: pointer;
|
26 |
+
transition: background-color 0.3s;
|
27 |
+
}
|
28 |
+
.sticky-buttons button:hover {
|
29 |
+
background-color: var(--purple);
|
30 |
+
color: var(--fg0);
|
31 |
+
}
|
32 |
+
</style>
|
33 |
</head>
|
|
|
34 |
|
35 |
+
<body class="bg0 text-fg0 transition-colors duration-300">
|
|
|
|
|
|
|
36 |
|
37 |
+
<div class="sticky-buttons">
|
38 |
+
<button id="themeToggle">🌙</button>
|
39 |
+
<a href="/" class="px-3 py-2 bg-blue text-fg0 rounded hover:bg-purple transition text-center">← Chat</a>
|
40 |
+
<button id="langToggle">🇬🇧/🇪🇸</button>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<main class="flex flex-col items-center p-6 space-y-6 max-w-4xl mx-auto">
|
44 |
+
|
45 |
+
<!-- English Section -->
|
46 |
+
<section id="en" lang="en">
|
47 |
+
|
48 |
+
<h1 class="text-3xl font-bold mb-6">MoA Chat Documentation</h1>
|
49 |
|
50 |
+
<p class="text-lg mb-4">
|
51 |
+
MoA Chat is a multi-agent AI system where several AI models answer a prompt independently, and a fourth model (the Aggregator) synthesizes their responses into a final answer.
|
|
|
|
|
52 |
</p>
|
53 |
+
|
54 |
+
<img src="https://raw.githubusercontent.com/togethercomputer/MoA/main/assets/moa-explained.png" alt="MoA Diagram" class="rounded shadow mb-6">
|
55 |
+
|
56 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">How it Works</h2>
|
57 |
+
<ul class="list-disc list-inside mb-6">
|
58 |
+
<li>LLM-A, LLM-B, and LLM-C receive your prompt and answer independently.</li>
|
59 |
+
<li>LLM-D (Aggregator) combines their answers into one final response.</li>
|
60 |
+
</ul>
|
61 |
+
|
62 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">How to Self-Host</h2>
|
63 |
+
<ol class="list-decimal list-inside mb-6 space-y-2">
|
64 |
+
<li>Clone the repository.</li>
|
65 |
+
<li>Create a `.env` file with your API keys (OpenRouter, Together, Grok, etc.).</li>
|
66 |
+
<li>Edit `llm/model_config.json` to configure providers and models.</li>
|
67 |
+
<li>Run the app:
|
68 |
+
<pre class="bg-statusline1 rounded p-3 mt-2 overflow-x-auto">pip install -r requirements.txt
|
69 |
+
python app.py</pre>
|
70 |
+
</li>
|
71 |
+
<li>Deploy to Hugging Face Spaces if you prefer (using Docker or Python template).</li>
|
72 |
+
</ol>
|
73 |
+
|
74 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">Adding More Models</h2>
|
75 |
<p class="mb-4">
|
76 |
+
To add models, simply edit `llm/model_config.json`.
|
77 |
+
Example:
|
78 |
</p>
|
79 |
+
<pre class="bg-statusline1 rounded p-3 overflow-x-auto">
|
80 |
+
"models": {
|
81 |
+
"newmodel/awesome-13b": "openrouter",
|
82 |
+
"another/model-v2": "together"
|
83 |
+
}
|
84 |
+
</pre>
|
85 |
|
86 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">License</h2>
|
87 |
+
<p class="mb-2">
|
88 |
+
This project is licensed under the GNU Affero General Public License v3.0 (AGPLv3).
|
89 |
+
</p>
|
90 |
+
<p class="mb-6 text-sm opacity-70">
|
91 |
+
You are free to use, modify, and share this project as long as you also make your changes available under the same license.
|
92 |
</p>
|
|
|
|
|
93 |
|
94 |
+
<footer class="text-center text-sm opacity-70">
|
95 |
+
Made with ❤️ in Panamá • Powered by Open Source
|
96 |
+
</footer>
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
</section>
|
99 |
|
100 |
+
<!-- Spanish Section -->
|
101 |
+
<section id="es" lang="es" class="hidden">
|
102 |
+
|
103 |
+
<h1 class="text-3xl font-bold mb-6">Documentación de MoA Chat</h1>
|
104 |
+
|
105 |
+
<p class="text-lg mb-4">
|
106 |
+
MoA Chat es un sistema de múltiples agentes donde varios modelos de IA responden a una solicitud de forma independiente, y un cuarto modelo (el Agregador) sintetiza sus respuestas en una sola.
|
107 |
</p>
|
|
|
108 |
|
109 |
+
<img src="https://raw.githubusercontent.com/togethercomputer/MoA/main/assets/moa-explained.png" alt="Diagrama MoA" class="rounded shadow mb-6">
|
110 |
+
|
111 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">Cómo Funciona</h2>
|
112 |
+
<ul class="list-disc list-inside mb-6">
|
113 |
+
<li>LLM-A, LLM-B y LLM-C reciben tu pregunta y responden de forma independiente.</li>
|
114 |
+
<li>LLM-D (Agregador) combina esas respuestas en una sola.</li>
|
|
|
|
|
115 |
</ul>
|
|
|
116 |
|
117 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">Cómo Autoalojar</h2>
|
118 |
+
<ol class="list-decimal list-inside mb-6 space-y-2">
|
119 |
+
<li>Clona el repositorio.</li>
|
120 |
+
<li>Crea un archivo `.env` con tus claves API (OpenRouter, Together, Grok, etc.).</li>
|
121 |
+
<li>Edita `llm/model_config.json` para configurar proveedores y modelos.</li>
|
122 |
+
<li>Ejecuta:
|
123 |
+
<pre class="bg-statusline1 rounded p-3 mt-2 overflow-x-auto">pip install -r requirements.txt
|
124 |
+
python app.py</pre>
|
125 |
+
</li>
|
126 |
+
<li>O despliega en Hugging Face Spaces si prefieres.</li>
|
127 |
+
</ol>
|
128 |
+
|
129 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">Agregar Más Modelos</h2>
|
130 |
+
<p class="mb-4">
|
131 |
+
Para agregar modelos, simplemente edita `llm/model_config.json`.
|
132 |
+
Ejemplo:
|
133 |
</p>
|
134 |
+
<pre class="bg-statusline1 rounded p-3 overflow-x-auto">
|
135 |
+
"models": {
|
136 |
+
"newmodel/awesome-13b": "openrouter",
|
137 |
+
"another/model-v2": "together"
|
138 |
+
}
|
139 |
+
</pre>
|
140 |
+
|
141 |
+
<h2 class="text-2xl font-semibold mt-6 mb-2">Licencia</h2>
|
142 |
+
<p class="mb-2">
|
143 |
+
Este proyecto está licenciado bajo la Licencia Pública General Affero de GNU v3.0 (AGPLv3).
|
144 |
</p>
|
145 |
+
<p class="mb-6 text-sm opacity-70">
|
146 |
+
Puedes usar, modificar y compartir este proyecto siempre que también compartas tus cambios bajo la misma licencia.
|
147 |
</p>
|
|
|
148 |
|
149 |
+
<footer class="text-center text-sm opacity-70">
|
150 |
+
Hecho con ❤️ en Panamá • Impulsado por Software Libre
|
151 |
+
</footer>
|
152 |
|
153 |
+
</section>
|
154 |
+
|
155 |
+
</main>
|
|
|
156 |
|
157 |
<script>
|
158 |
+
// === Theme Toggle ===
|
159 |
+
const themeToggle = document.getElementById('themeToggle');
|
160 |
+
themeToggle.addEventListener('click', () => {
|
161 |
+
document.documentElement.classList.toggle('dark');
|
162 |
+
themeToggle.textContent = document.documentElement.classList.contains('dark') ? '🌙' : '☀️';
|
|
|
163 |
});
|
164 |
|
165 |
+
// === Language Toggle ===
|
166 |
+
const langToggle = document.getElementById('langToggle');
|
167 |
+
const en = document.getElementById('en');
|
168 |
+
const es = document.getElementById('es');
|
169 |
+
langToggle.addEventListener('click', () => {
|
170 |
+
en.classList.toggle('hidden');
|
171 |
+
es.classList.toggle('hidden');
|
|
|
|
|
172 |
});
|
173 |
</script>
|
174 |
|