Mohit0199 commited on
Commit
17d21e3
Β·
verified Β·
1 Parent(s): cf25b7e

now i want to modify the project i want to use only the free of cost llm only i am giving you the list of the free llm can be use from openrouter without token charge use that models only

Browse files

Tongyi DeepResearch 30B A3B (free), Meituan: LongCat Flash Chat (free), NVIDIA: Nemotron Nano 9B V2 (free), DeepSeek: DeepSeek V3.1 (free), OpenAI: gpt-oss-20b (free), Z.AI: GLM 4.5 Air (free), Qwen: Qwen3 Coder 480B A35B (free), MoonshotAI: Kimi K2 0711 (free), Venice: Uncensored (free), Google: Gemma 3n 2B (free), Tencent: Hunyuan A13B Instruct (free), TNG: DeepSeek R1T2 Chimera (free), Mistral: Mistral Small 3.2 24B (free), MoonshotAI: Kimi Dev 72B (free), DeepSeek: Deepseek R1 0528 Qwen3 8B (free), DeepSeek: R1 0528 (free), Mistral: Devstral Small 2505 (free), Google: Gemma 3n 4B (free), Meta: Llama 3.3 8B Instruct (free), Qwen: Qwen3 4B (free), Qwen: Qwen3 30B A3B (free), Qwen: Qwen3 8B (free), Qwen: Qwen3 14B (free), Qwen: Qwen3 235B A22B (free), TNG: DeepSeek R1T Chimera (free), Microsoft: MAI DS R1 (free), Shisa AI: Shisa V2 Llama 3.3 70B (free), ArliAI: QwQ 32B RpR v1 (free), Agentica: Deepcoder 14B Preview (free), Meta: Llama 4 Maverick (free), Meta: Llama 4 Scout (free), Qwen: Qwen2.5 VL 32B Instruct (free), DeepSeek: DeepSeek V3 0324 (free), Mistral: Mistral Small 3.1 24B (free), Google: Gemma 3 4B (free), Google: Gemma 3 12B (free), Google: Gemma 3 27B (free), Nous: DeepHermes 3 Llama 3 8B Preview (free), Dolphin3.0 Mistral 24B (free), Qwen: Qwen2.5 VL 72B Instruct (free), Mistral: Mistral Small 3 (free), DeepSeek: R1 Distill Llama 70B (free), DeepSeek: R1 (free), Google: Gemini 2.0 Flash Experimental (free), Meta: Llama 3.3 70B Instruct (free), Qwen2.5 Coder 32B Instruct (free), Meta: Llama 3.2 3B Instruct (free), Qwen2.5 72B Instruct (free), Mistral: Mistral Nemo (free), Google: Gemma 2 9B (free), Mistral: Mistral 7B Instruct (free)

Files changed (1) hide show
  1. index.html +51 -38
index.html CHANGED
@@ -105,13 +105,19 @@
105
  <input type="password" id="apiKeyInput" placeholder="Enter your API key" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500">
106
  <p class="text-xs text-gray-400 mt-1">Your key is stored locally and never sent to our servers</p>
107
  </div>
108
- <div>
109
- <label class="block text-sm font-medium mb-1">Select Model</label>
110
- <select id="modelSelect" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500">
111
- <option value="" disabled selected>Enter API key to load models</option>
112
- </select>
113
- <p class="text-xs text-gray-400 mt-1">Models will be loaded after entering API key</p>
114
- </div>
 
 
 
 
 
 
115
  <div>
116
  <label class="block text-sm font-medium mb-1">Chat Theme</label>
117
  <div class="flex space-x-2">
@@ -134,10 +140,10 @@
134
  <div class="flex justify-center">
135
  <div class="bg-gray-700 bg-opacity-50 px-4 py-2 rounded-lg text-sm text-gray-300">
136
  <i data-feather="info" class="inline mr-2 w-4 h-4"></i>
137
- Enter your API key in settings to start chatting
138
  </div>
139
  </div>
140
- </div>
141
 
142
  <!-- Input Area -->
143
  <div class="border-t border-gray-700 p-4 bg-gray-800">
@@ -288,24 +294,30 @@ async function loadSettings() {
288
  // Apply theme
289
  document.body.className = `bg-gradient-to-br from-${savedTheme}-900 to-purple-900 text-white`;
290
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
 
292
- // Fetch available models from OpenRouter
293
  async function fetchModels(apiKey) {
294
  try {
295
- const response = await fetch('https://openrouter.ai/api/v1/models', {
296
- headers: {
297
- 'Authorization': `Bearer ${apiKey}`,
298
- 'HTTP-Referer': window.location.href,
299
- 'X-Title': 'ChatRouter'
300
- }
301
- });
302
-
303
- const data = await response.json();
304
- if (data.error) {
305
- addMessage('system', `Error loading models: ${data.error.message}`);
306
- return;
307
- }
308
-
309
  // Clear existing options
310
  modelSelect.innerHTML = '';
311
 
@@ -317,18 +329,19 @@ async function loadSettings() {
317
  defaultOption.selected = true;
318
  modelSelect.appendChild(defaultOption);
319
 
320
- // Add chat models with pricing info
321
- data.data
322
- .filter(model => model.description.includes('chat'))
323
- .sort((a, b) => b.top_provider.max_completion_tokens - a.top_provider.max_completion_tokens)
324
- .forEach(model => {
325
- const option = document.createElement('option');
326
- option.value = model.id;
327
- option.textContent = `${model.name} (${(model.pricing.completion / 1000).toFixed(4)}/token)`;
328
- modelSelect.appendChild(option);
329
- });
330
 
331
- } catch (error) {
 
 
 
 
332
  addMessage('system', `Error loading models: ${error.message}`);
333
  }
334
  }
@@ -542,9 +555,9 @@ messageInput.addEventListener('keydown', (e) => {
542
  setTimeout(() => {
543
  if (!localStorage.getItem('chatRouterUser')) {
544
  addMessage('system', 'Welcome to ChatRouter! Please log in to start chatting.');
545
- } else if (!localStorage.getItem('chatRouterApiKey')) {
546
- addMessage('system', 'Please enter your OpenRouter API key in settings to begin.');
547
- }
548
  }, 1000);
549
  </script>
550
  </body>
 
105
  <input type="password" id="apiKeyInput" placeholder="Enter your API key" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500">
106
  <p class="text-xs text-gray-400 mt-1">Your key is stored locally and never sent to our servers</p>
107
  </div>
108
+ <div>
109
+ <label class="block text-sm font-medium mb-1">Select Model</label>
110
+ <select id="modelSelect" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500">
111
+ <option value="" disabled selected>Select a free model</option>
112
+ <option value="tongyi/deepresearch-30b-a3b">Tongyi DeepResearch 30B A3B (FREE)</option>
113
+ <option value="meituan/longcat-flash-chat">Meituan: LongCat Flash Chat (FREE)</option>
114
+ <option value="nvidia/nemotron-nano-9b-v2">NVIDIA: Nemotron Nano 9B V2 (FREE)</option>
115
+ <option value="deepseek/deepseek-v3.1">DeepSeek: DeepSeek V3.1 (FREE)</option>
116
+ <option value="meta/llama-3.3-70b-instruct">Meta: Llama 3.3 70B Instruct (FREE)</option>
117
+ <option value="mistral/mistral-7b-instruct">Mistral: Mistral 7B Instruct (FREE)</option>
118
+ </select>
119
+ <p class="text-xs text-gray-400 mt-1">Free models available without token charges</p>
120
+ </div>
121
  <div>
122
  <label class="block text-sm font-medium mb-1">Chat Theme</label>
123
  <div class="flex space-x-2">
 
140
  <div class="flex justify-center">
141
  <div class="bg-gray-700 bg-opacity-50 px-4 py-2 rounded-lg text-sm text-gray-300">
142
  <i data-feather="info" class="inline mr-2 w-4 h-4"></i>
143
+ Select a free model from settings to start chatting
144
  </div>
145
  </div>
146
+ </div>
147
 
148
  <!-- Input Area -->
149
  <div class="border-t border-gray-700 p-4 bg-gray-800">
 
294
  // Apply theme
295
  document.body.className = `bg-gradient-to-br from-${savedTheme}-900 to-purple-900 text-white`;
296
  }
297
+ // Free models from OpenRouter
298
+ const freeModels = [
299
+ {id: 'tongyi/deepresearch-30b-a3b', name: 'Tongyi DeepResearch 30B A3B'},
300
+ {id: 'meituan/longcat-flash-chat', name: 'Meituan: LongCat Flash Chat'},
301
+ {id: 'nvidia/nemotron-nano-9b-v2', name: 'NVIDIA: Nemotron Nano 9B V2'},
302
+ {id: 'deepseek/deepseek-v3.1', name: 'DeepSeek: DeepSeek V3.1'},
303
+ {id: 'openai/gpt-oss-20b', name: 'OpenAI: gpt-oss-20b'},
304
+ {id: 'z.ai/glm-4.5-air', name: 'Z.AI: GLM 4.5 Air'},
305
+ {id: 'qwen/qwen3-coder-480b-a35b', name: 'Qwen: Qwen3 Coder 480B A35B'},
306
+ {id: 'moonshot-ai/kimi-k2-0711', name: 'MoonshotAI: Kimi K2 0711'},
307
+ {id: 'venice/uncensored', name: 'Venice: Uncensored'},
308
+ {id: 'google/gemma-3n-2b', name: 'Google: Gemma 3n 2B'},
309
+ {id: 'tencent/hunyuan-a13b-instruct', name: 'Tencent: Hunyuan A13B Instruct'},
310
+ {id: 'tng/deepseek-r1t2-chimera', name: 'TNG: DeepSeek R1T2 Chimera'},
311
+ {id: 'mistral/mistral-small-3.2-24b', name: 'Mistral: Mistral Small 3.2 24B'},
312
+ {id: 'meta/llama-3.3-70b-instruct', name: 'Meta: Llama 3.3 70B Instruct'},
313
+ {id: 'google/gemma-3n-4b', name: 'Google: Gemma 3n 4B'},
314
+ {id: 'google/gemma-3-4b', name: 'Google: Gemma 3 4B'},
315
+ {id: 'mistral/mistral-7b-instruct', name: 'Mistral: Mistral 7B Instruct'}
316
+ ];
317
 
318
+ // Fetch available free models
319
  async function fetchModels(apiKey) {
320
  try {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  // Clear existing options
322
  modelSelect.innerHTML = '';
323
 
 
329
  defaultOption.selected = true;
330
  modelSelect.appendChild(defaultOption);
331
 
332
+ // Add free models
333
+ freeModels.forEach(model => {
334
+ const option = document.createElement('option');
335
+ option.value = model.id;
336
+ option.textContent = `${model.name} (FREE)`;
337
+ modelSelect.appendChild(option);
338
+ });
 
 
 
339
 
340
+ // Verify API key is still needed for these free models
341
+ if (!apiKey) {
342
+ addMessage('system', 'Free models selected. Some features may require an API key.');
343
+ }
344
+ } catch (error) {
345
  addMessage('system', `Error loading models: ${error.message}`);
346
  }
347
  }
 
555
  setTimeout(() => {
556
  if (!localStorage.getItem('chatRouterUser')) {
557
  addMessage('system', 'Welcome to ChatRouter! Please log in to start chatting.');
558
+ } else if (!localStorage.getItem('chatRouterModel')) {
559
+ addMessage('system', 'Please select a free model from settings to begin.');
560
+ }
561
  }, 1000);
562
  </script>
563
  </body>