Noname980799 commited on
Commit
7771cd8
·
verified ·
1 Parent(s): 5f7c105

Create for me an AI agent site using DeepHermes 3 Llama 3 8B Preview (free) fetch("https://openrouter.ai/api/v1/chat/completions", {

Browse files

method: "POST",
headers: {
"Authorization": "Bearer <OPENROUTER_API_KEY>",
"HTTP-Referer": "<YOUR_SITE_URL>", // Optional. Site URL for rankings on openrouter.ai.
"X-Title": "<YOUR_SITE_NAME>", // Optional. Site title for rankings on openrouter.ai.
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "nousresearch/deephermes-3-llama-3-8b-preview:free",
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
})
}); and this is the APIKEY of it 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

Files changed (2) hide show
  1. README.md +8 -5
  2. index.html +317 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Hermesmind Ai Agent Hub
3
- emoji: 🐢
4
- colorFrom: purple
5
- colorTo: gray
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: HermesMind AI Agent Hub 🤖
3
+ colorFrom: blue
4
+ colorTo: pink
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
index.html CHANGED
@@ -1,19 +1,318 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>HermesMind - AI Agent Interface</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
12
+ <style>
13
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
14
+
15
+ * {
16
+ font-family: 'Inter', sans-serif;
17
+ }
18
+
19
+ .chat-message.user {
20
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
21
+ color: white;
22
+ border-radius: 18px 18px 4px 18px;
23
+ margin-left: auto;
24
+ }
25
+
26
+ .chat-message.ai {
27
+ background: #f1f5f9;
28
+ color: #334155;
29
+ border-radius: 18px 18px 18px 4px;
30
+ }
31
+
32
+ .typing-indicator {
33
+ display: inline-flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ }
37
+
38
+ .typing-dot {
39
+ width: 8px;
40
+ height: 8px;
41
+ margin: 0 3px;
42
+ background-color: #94a3b8;
43
+ border-radius: 50%;
44
+ animation: typing-dot 1.4s infinite ease-in-out both;
45
+ }
46
+
47
+ .typing-dot:nth-child(1) { animation-delay: -0.32s; }
48
+ .typing-dot:nth-child(2) { animation-delay: -0.16s; }
49
+
50
+ @keyframes typing-dot {
51
+ 0%, 80%, 100% { transform: scale(0.8); }
52
+ 40% { transform: scale(1); }
53
+ }
54
+
55
+ .vanta-background {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ width: 100%;
60
+ height: 100%;
61
+ z-index: -1;
62
+ }
63
+ </style>
64
+ </head>
65
+ <body class="bg-gray-50 min-h-screen flex flex-col">
66
+ <div id="vanta-background" class="vanta-background"></div>
67
+
68
+ <!-- Header -->
69
+ <header class="bg-white/80 backdrop-blur-sm border-b border-gray-200/50 sticky top-0 z-10">
70
+ <div class="container mx-auto px-4 py-4">
71
+ <div class="flex items-center justify-between">
72
+ <div class="flex items-center space-x-3">
73
+ <div class="bg-gradient-to-r from-purple-600 to-blue-600 p-2 rounded-lg">
74
+ <i data-feather="cpu" class="text-white w-6 h-6"></i>
75
+ </div>
76
+ <h1 class="text-2xl font-bold text-gray-800">HermesMind</h1>
77
+ </div>
78
+ <div class="flex items-center space-x-4">
79
+ <button class="text-gray-600 hover:text-purple-600 transition-colors">
80
+ <i data-feather="settings" class="w-5 h-5"></i>
81
+ </button>
82
+ <button class="text-gray-600 hover:text-purple-600 transition-colors">
83
+ <i data-feather="help-circle" class="w-5 h-5"></i>
84
+ </button>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </header>
89
+
90
+ <!-- Main Content -->
91
+ <main class="flex-1 container mx-auto px-4 py-8 max-w-4xl">
92
+ <div class="bg-white/90 backdrop-blur-sm rounded-xl shadow-lg border border-gray-200/50 overflow-hidden">
93
+ <!-- Chat Header -->
94
+ <div class="bg-gradient-to-r from-purple-50 to-blue-50 px-6 py-4 border-b border-gray-200/50">
95
+ <div class="flex items-center space-x-3">
96
+ <div class="bg-gradient-to-r from-purple-600 to-blue-600 p-2 rounded-full">
97
+ <i data-feather="message-circle" class="text-white w-5 h-5"></i>
98
+ </div>
99
+ <div>
100
+ <h2 class="font-semibold text-gray-800">DeepHermes 3 Llama 3 8B</h2>
101
+ <p class="text-sm text-gray-600">Powered by OpenRouter AI</p>
102
+ </div>
103
+ </div>
104
+ </div>
105
+
106
+ <!-- Chat Messages -->
107
+ <div id="chat-container" class="h-96 overflow-y-auto p-6 space-y-4">
108
+ <div class="chat-message ai max-w-xs md:max-w-md p-4">
109
+ <p>Hello! I'm HermesMind, your AI assistant powered by DeepHermes 3. How can I help you today?</p>
110
+ </div>
111
+ </div>
112
+
113
+ <!-- Input Area -->
114
+ <div class="border-t border-gray-200/50 p-6">
115
+ <form id="chat-form" class="flex space-x-3">
116
+ <div class="flex-1 relative">
117
+ <input
118
+ type="text"
119
+ id="user-input"
120
+ placeholder="Ask me anything..."
121
+ class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent outline-none transition-all"
122
+ autocomplete="off"
123
+ >
124
+ <div class="absolute right-3 top-3 text-gray-400">
125
+ <i data-feather="edit-3" class="w-4 h-4"></i>
126
+ </div>
127
+ </div>
128
+ <button
129
+ type="submit"
130
+ class="bg-gradient-to-r from-purple-600 to-blue-600 text-white px-6 py-3 rounded-lg hover:from-purple-700 hover:to-blue-700 transition-all flex items-center space-x-2 disabled:opacity-50 disabled:cursor-not-allowed"
131
+ id="send-button"
132
+ >
133
+ <i data-feather="send" class="w-4 h-4"></i>
134
+ <span>Send</span>
135
+ </button>
136
+ </form>
137
+ <p class="text-xs text-gray-500 mt-3 text-center">
138
+ Powered by OpenRouter API • Your conversations are secure and private
139
+ </p>
140
+ </div>
141
+ </div>
142
+
143
+ <!-- Features Section -->
144
+ <div class="grid md:grid-cols-3 gap-6 mt-8">
145
+ <div class="bg-white/90 backdrop-blur-sm p-6 rounded-xl shadow border border-gray-200/50">
146
+ <div class="bg-purple-100 p-3 rounded-lg inline-block mb-4">
147
+ <i data-feather="zap" class="text-purple-600 w-6 h-6"></i>
148
+ </div>
149
+ <h3 class="font-semibold text-gray-800 mb-2">Fast Responses</h3>
150
+ <p class="text-gray-600 text-sm">Get instant answers from our advanced AI model with minimal latency.</p>
151
+ </div>
152
+ <div class="bg-white/90 backdrop-blur-sm p-6 rounded-xl shadow border border-gray-200/50">
153
+ <div class="bg-blue-100 p-3 rounded-lg inline-block mb-4">
154
+ <i data-feather="shield" class="text-blue-600 w-6 h-6"></i>
155
+ </div>
156
+ <h3 class="font-semibold text-gray-800 mb-2">Secure API</h3>
157
+ <p class="text-gray-600 text-sm">Your API key is handled securely with encrypted communication channels.</p>
158
+ </div>
159
+ <div class="bg-white/90 backdrop-blur-sm p-6 rounded-xl shadow border border-gray-200/50">
160
+ <div class="bg-green-100 p-3 rounded-lg inline-block mb-4">
161
+ <i data-feather="code" class="text-green-600 w-6 h-6"></i>
162
+ </div>
163
+ <h3 class="font-semibold text-gray-800 mb-2">Open Source</h3>
164
+ <p class="text-gray-600 text-sm">Built on open standards and transparent AI models for trust and reliability.</p>
165
+ </div>
166
+ </div>
167
+ </main>
168
+
169
+ <!-- Footer -->
170
+ <footer class="bg-white/80 backdrop-blur-sm border-t border-gray-200/50 mt-12">
171
+ <div class="container mx-auto px-4 py-6">
172
+ <div class="flex flex-col md:flex-row justify-between items-center">
173
+ <div class="flex items-center space-x-2 mb-4 md:mb-0">
174
+ <i data-feather="brain" class="text-purple-600 w-6 h-6"></i>
175
+ <span class="font-medium text-gray-800">HermesMind AI</span>
176
+ </div>
177
+ <div class="flex space-x-6 text-sm text-gray-600">
178
+ <a href="#" class="hover:text-purple-600 transition-colors">Privacy</a>
179
+ <a href="#" class="hover:text-purple-600 transition-colors">Terms</a>
180
+ <a href="#" class="hover:text-purple-600 transition-colors">API Docs</a>
181
+ </div>
182
+ </div>
183
+ <p class="text-center text-xs text-gray-500 mt-4">
184
+ © 2023 HermesMind AI Agent. Powered by DeepHermes 3 and OpenRouter.
185
+ </p>
186
+ </div>
187
+ </footer>
188
+
189
+ <script>
190
+ // Initialize Vanta.js background
191
+ VANTA.NET({
192
+ el: "#vanta-background",
193
+ mouseControls: true,
194
+ touchControls: true,
195
+ gyroControls: false,
196
+ minHeight: 200.00,
197
+ minWidth: 200.00,
198
+ scale: 1.00,
199
+ scaleMobile: 1.00,
200
+ color: 0x7c73e6,
201
+ backgroundColor: 0xf1f5f9,
202
+ points: 10.00,
203
+ maxDistance: 25.00,
204
+ spacing: 18.00
205
+ });
206
+
207
+ // Initialize Feather Icons
208
+ feather.replace();
209
+
210
+ // API Configuration
211
+ const API_KEY = "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";
212
+ const API_URL = "https://openrouter.ai/api/v1/chat/completions";
213
+
214
+ // DOM Elements
215
+ const chatForm = document.getElementById('chat-form');
216
+ const userInput = document.getElementById('user-input');
217
+ const chatContainer = document.getElementById('chat-container');
218
+ const sendButton = document.getElementById('send-button');
219
+
220
+ // Add message to chat
221
+ function addMessage(content, isUser = false) {
222
+ const messageDiv = document.createElement('div');
223
+ messageDiv.className = `chat-message ${isUser ? 'user' : 'ai'} max-w-xs md:max-w-md p-4`;
224
+ messageDiv.innerHTML = `<p>${content}</p>`;
225
+ chatContainer.appendChild(messageDiv);
226
+ chatContainer.scrollTop = chatContainer.scrollHeight;
227
+ }
228
+
229
+ // Show typing indicator
230
+ function showTypingIndicator() {
231
+ const typingDiv = document.createElement('div');
232
+ typingDiv.className = 'chat-message ai max-w-xs md:max-w-md p-4';
233
+ typingDiv.id = 'typing-indicator';
234
+ typingDiv.innerHTML = `
235
+ <div class="typing-indicator">
236
+ <div class="typing-dot"></div>
237
+ <div class="typing-dot"></div>
238
+ <div class="typing-dot"></div>
239
+ </div>
240
+ `;
241
+ chatContainer.appendChild(typingDiv);
242
+ chatContainer.scrollTop = chatContainer.scrollHeight;
243
+ }
244
+
245
+ // Remove typing indicator
246
+ function removeTypingIndicator() {
247
+ const typingIndicator = document.getElementById('typing-indicator');
248
+ if (typingIndicator) {
249
+ typingIndicator.remove();
250
+ }
251
+ }
252
+
253
+ // Send message to API
254
+ async function sendMessage(message) {
255
+ showTypingIndicator();
256
+
257
+ try {
258
+ const response = await fetch(API_URL, {
259
+ method: "POST",
260
+ headers: {
261
+ "Authorization": `Bearer ${API_KEY}`,
262
+ "HTTP-Referer": window.location.href,
263
+ "X-Title": "HermesMind AI Agent",
264
+ "Content-Type": "application/json"
265
+ },
266
+ body: JSON.stringify({
267
+ "model": "nousresearch/deephermes-3-llama-3-8b-preview:free",
268
+ "messages": [
269
+ {
270
+ "role": "user",
271
+ "content": message
272
+ }
273
+ ]
274
+ })
275
+ });
276
+
277
+ const data = await response.json();
278
+ removeTypingIndicator();
279
+
280
+ if (data.choices && data.choices.length > 0) {
281
+ addMessage(data.choices[0].message.content, false);
282
+ } else {
283
+ addMessage("Sorry, I couldn't process your request. Please try again.", false);
284
+ }
285
+ } catch (error) {
286
+ removeTypingIndicator();
287
+ addMessage("There was an error connecting to the AI service. Please check your connection and try again.", false);
288
+ console.error("API Error:", error);
289
+ }
290
+ }
291
+
292
+ // Handle form submission
293
+ chatForm.addEventListener('submit', async (e) => {
294
+ e.preventDefault();
295
+
296
+ const message = userInput.value.trim();
297
+ if (!message) return;
298
+
299
+ // Add user message to chat
300
+ addMessage(message, true);
301
+ userInput.value = '';
302
+
303
+ // Disable send button while processing
304
+ sendButton.disabled = true;
305
+
306
+ // Send to API
307
+ await sendMessage(message);
308
+
309
+ // Re-enable send button
310
+ sendButton.disabled = false;
311
+ userInput.focus();
312
+ });
313
+
314
+ // Focus input on load
315
+ userInput.focus();
316
+ </script>
317
+ </body>
318
  </html>