Skip to content

Commit

Permalink
qroq
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaki-1052 committed May 30, 2024
1 parent e87691d commit bd8ac85
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
5 changes: 3 additions & 2 deletions public/portal.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
<button id="model-claude-sonnet" data-value="claude-3-sonnet-20240229">Claude Sonnet</button>
<button id="model-claude-haiku" data-value="claude-3-haiku-20240307">Claude Haiku</button>
<button id="model-mistral-large" data-value="mistral-large-latest">Mistral Large</button>
<button id="model-llama-70b" data-value="llama3-70b">Llama3 70b</button>
<button id="model-llama-70b" data-value="llama3-70b-8192">Llama3 70b</button>
<button id="model-gemini-1.5-pro" data-value="gemini-1.5-pro">Gemini-1.5 Pro</button>
<button id="model-gemini-1.5-flash" data-value="gemini-1.5-flash">Gemini-1.5 Flash</button>
<button id="model-gemini-pro-vision" data-value="gemini-pro-vision">Gemini Pro Vision</button>
<button id="model-llama-8b" data-value="Llama3-8b">Llama3 8b</button>
<button id="model-llama-8b" data-value="llama3-8b-8192">Llama3 8b</button>
<button id="model-gemma-it" data-value="gemma-7b-it">Gemma 7B</button>
<button id="model-mistral-small" data-value="mistral-small-latest">Mistral Small</button>
<button id="model-mistral-medium" data-value="mistral-medium-latest">Mistral Medium</button>
<button id="model-mistral-8x7b" data-value="open-mixtral-8x7b">Mixtral 8x7b</button>
Expand Down
22 changes: 14 additions & 8 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ fetchConfig();
"Mistral-Small": "mistral-small-latest",
"Mistral-Medium": "mistral-medium-latest",
"Mistral-Large": "mistral-large-latest",
"Llama3-70b": "llama3-70b",
"Llama3-8b": "Llama3-8b",
"Llama3-70b": "llama3-70b-8192",
"Llama3-8b": "llama3-8b-8192",
"Gemma-7b": "gemma-7b-it",
// Open Router Models
"OpenRouter Auto": "openrouter/auto",
"Nous: Capybara 7B (free)": "nousresearch/nous-capybara-7b:free",
Expand Down Expand Up @@ -210,8 +211,9 @@ fetchConfig();
"mistral-small-latest": "Mistral-Small",
"mistral-medium-latest": "Mistral-Medium",
"mistral-large-latest": "Mistral-Large",
"llama3-70b": "Llama3-70b",
"Llama3-8b": "Llama3-8b",
"llama3-70b-8192": "Llama3-70b",
"llama3-8b-8192": "Llama3-8b",
"gemma-7b-it": "Gemma-7b",
// Open Router Models
"openrouter/auto": "OpenRouter Auto",
"nousresearch/nous-capybara-7b:free": "Nous: Capybara 7B (free)",
Expand Down Expand Up @@ -655,12 +657,16 @@ document.getElementById('model-claude-2.0').addEventListener('mouseover', (event
document.getElementById('model-claude-1.2').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["claude-instant-1.2"], event.currentTarget));

// Event listeners for selecting Llama3 models
document.getElementById('model-llama-70b').addEventListener('click', () => selectModel('llama3-70b'));
document.getElementById('model-llama-8b').addEventListener('click', () => selectModel('Llama3-8b'));
document.getElementById('model-llama-70b').addEventListener('click', () => selectModel('llama3-70b-8192'));
document.getElementById('model-llama-8b').addEventListener('click', () => selectModel('llama3-8b-8192'));

// Event listeners for showing Llama3 model descriptions on hover
document.getElementById('model-llama-70b').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["llama3-70b"], event.currentTarget));
document.getElementById('model-llama-8b').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["Llama3-8b"], event.currentTarget));
document.getElementById('model-llama-70b').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["llama3-70b-8192"], event.currentTarget));
document.getElementById('model-llama-8b').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["llama3-8b-8192"], event.currentTarget));

// gemma it via qroq
document.getElementById('model-gemma-it').addEventListener('click', () => selectModel('gemma-7b-it'));
document.getElementById('model-gemma-it').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["gemma-7b-it"], event.currentTarget));

// select open router models lol

Expand Down
6 changes: 3 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1218,12 +1218,12 @@ if (modelID === 'gpt-4') {
// Add any Mistral-specific headers here if necessary
};
apiUrl = 'https://api.anthropic.com/v1/messages';
} else if (modelID.startsWith('llama') || modelID.startsWith('Llama')) {
} else if (modelID.startsWith('llama') || modelID.startsWith('gemma')) {
conversationHistory.push(user_input);
headers = {
'Authorization': `Bearer ${process.env.LLAMA_API_KEY}`,
'Authorization': `Bearer ${process.env.QROQ_API_KEY}`,
};
apiUrl = 'https://api.llama-api.com/chat/completions';
apiUrl = 'https://api.groq.com/openai/v1/chat/completions';
} else if (modelID.includes('/')) {
conversationHistory.push(user_input);
headers = {
Expand Down

0 comments on commit bd8ac85

Please sign in to comment.