Skip to content

Commit

Permalink
models
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaki-1052 committed Jul 23, 2024
1 parent b618d06 commit 58410f7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/portal.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@
<button id="model-claude-3.5-sonnet" data-value="claude-3-5-sonnet-20240620">Claude 3.5 Sonnet</button>
<button id="model-gpt-4o" data-value="gpt-4o">GPT-4o: Latest</button>
<button id="model-gpt-4o-mini" data-value="gpt-4o-mini">GPT-4o Mini: Cheapest</button>
<button id="model-llama-3.1-405b" data-value="llama-3.1-405b-reasoning">Llama3.1 405bb</button>
<button id="model-gpt-4-turbo" data-value="gpt-4-turbo-">GPT-4-Turbo</button>
<button id="model-gpt-3.5" data-value="gpt-3.5-turbo-0125">GPT-3.5-Turbo</button>
<button id="model-claude-haiku" data-value="claude-3-haiku-20240307">Claude Haiku</button>
<button id="model-gemini-1.5-pro" data-value="gemini-1.5-pro">Gemini-1.5 Pro</button>
<button id="model-llama-70b" data-value="llama3-70b-8192">Llama3 70b</button>
<button id="model-llama-3.1-70b" data-value="llama-3.1-70b-versatile">Llama3.1 70b</button>
<button id="model-llama-3.1-8b" data-value="llama-3.1-8b-instant">Llama3.1 8b</button>
<button id="model-mistral-large" data-value="mistral-large-latest">Mistral Large</button>
<button id="model-codestral" data-value="codestral-latest">Codestral</button>
<button id="model-claude-opus" data-value="claude-3-opus-20240229">Claude Opus</button>
<button id="model-gemini-1.5-flash" data-value="gemini-1.5-flash">Gemini-1.5 Flash</button>
<button id="model-gemini-pro" data-value="gemini-pro">Gemini Pro</button>
<button id="model-llama-70b" data-value="llama3-70b-8192">Llama3 70b</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-codestral-mamba" data-value="open-codestral-mamba">Codestral Mamba</button>
Expand Down
14 changes: 14 additions & 0 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ fetchConfig();
"Codestral-Mamba": "open-codestral-mamba",
"Mathstral": "mathstral-temp-id",
"Mistral-NeMo": "open-mistral-nemo",
"Llama 3.1 8B": "llama-3.1-8b-instant",
"Llama 3.1 70B": "llama-3.1-70b-versatile",
"Llama 3.1 405B": "llama-3.1-405b-reasoning",
// Open Router Models
"Dolphin Llama 3 70B \ud83d\udc2c": "cognitivecomputations/dolphin-llama-3-70b",
"Mistral: Codestral Mamba": "mistralai/codestral-mamba",
Expand Down Expand Up @@ -276,6 +279,9 @@ fetchConfig();
"open-codestral-mamba": "Codestral-Mamba",
"mathstral-temp-id": "Mathstral",
"open-mistral-nemo": "Mistral-NeMo",
"llama-3.1-8b-instant": "Llama 3.1 8B",
"llama-3.1-70b-versatile": "Llama 3.1 70B",
"llama-3.1-405b-reasoning": "Llama 3.1 405B",
// Open Router Models
"cognitivecomputations/dolphin-llama-3-70b": "Dolphin Llama 3 70B \ud83d\udc2c",
"mistralai/codestral-mamba": "Mistral: Codestral Mamba",
Expand Down Expand Up @@ -965,10 +971,18 @@ document.getElementById('model-claude-1.2').addEventListener('mouseover', (event
document.getElementById('model-llama-70b').addEventListener('click', () => selectModel('llama3-70b-8192'));
document.getElementById('model-llama-8b').addEventListener('click', () => selectModel('llama3-8b-8192'));

document.getElementById('model-llama-3.1-8b').addEventListener('click', () => selectModel('llama-3.1-8b-instant'));
document.getElementById('model-llama-3.1-70b').addEventListener('click', () => selectModel('llama-3.1-70b-versatile'));
document.getElementById('model-llama-3.1-405b').addEventListener('click', () => selectModel('llama-3.1-405b-reasoning'));

// Event listeners for showing Llama3 model descriptions on hover
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));

document.getElementById('model-llama-3.1-8b').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["llama-3.1-8b-instant"], event.currentTarget));
document.getElementById('model-llama-3.1-70b').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["llama-3.1-8b-instant"], event.currentTarget));
document.getElementById('model-llama-3.1-405b').addEventListener('mouseover', (event) => showCustomTooltip(modelDescriptions["llama-3.1-8b-instant"], 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));
Expand Down
21 changes: 21 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,18 @@ async function calculateCost(tokens, model) {
} else if (model === 'mixtral-8x7b-32768') {
inputCostPerMillion = 0;
outputCostPerMillion = 0;
} else if (model === 'llama-3.1-405b-reasoning') {
inputCostPerMillion = 0;
outputCostPerMillion = 0;
} else if (model === 'llama-3.1-70b-versatile') {
inputCostPerMillion = 0;
outputCostPerMillion = 0;
} else if (model === 'llama-3.1-8b-instant') {
inputCostPerMillion = 0;
outputCostPerMillion = 0;
} else {
inputCostPerMillion = 0;
outputCostPerMillion = 0;
throw new Error(`Unknown model: ${model}.`);
}

Expand Down Expand Up @@ -1983,6 +1994,16 @@ if (modelID === 'gpt-4') {
tokens = 6000; // If 'modelID' is 'gpt-4', set 'tokens' to 6000
}

if (modelID === 'gpt-4o-mini') {
tokens = 1200; // If 'modelID' is 'gpt-4', set 'tokens' to 6000
}


if (modelID.startsWith('llama-3.1')) {
tokens = 8000;
}



// Model Parameters Below!

Expand Down

0 comments on commit 58410f7

Please sign in to comment.