2904457f by Bryan Batac

- Added only allowed models

1 parent 8d85ae8a
Showing 1 changed file with 6 additions and 2 deletions
...@@ -52,7 +52,11 @@ const tiktokenModels = [ ...@@ -52,7 +52,11 @@ const tiktokenModels = [
52 let client; 52 let client;
53 let filteredModels = {}; 53 let filteredModels = {};
54 const allowedEndpoints = ["openAI", "Opensource", "Llama"]; 54 const allowedEndpoints = ["openAI", "Opensource", "Llama"];
55 const excludedModels = ["o1-preview", "o1-mini"]; 55 const allowedModels = [
56 "gpt-3.5-turbo",
57 "google/gemma-2-9b-it",
58 "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"
59 ];
56 60
57 // Open AI Configuration 61 // Open AI Configuration
58 // console.log(process.env.OPENAI_API_ORG) 62 // console.log(process.env.OPENAI_API_ORG)
...@@ -565,7 +569,7 @@ const fetchAndFilterModels = async (client) => { ...@@ -565,7 +569,7 @@ const fetchAndFilterModels = async (client) => {
565 const models = await client.get('model'); 569 const models = await client.get('model');
566 return Object.entries(JSON.parse(models)) 570 return Object.entries(JSON.parse(models))
567 .filter(([_, value]) => allowedEndpoints.includes(value.endpoint)) 571 .filter(([_, value]) => allowedEndpoints.includes(value.endpoint))
568 .filter(([_, value]) => !excludedModels.includes(value.model)) 572 .filter(([_, value]) => allowedModels.includes(value.model))
569 .reduce((acc, [key, value]) => { 573 .reduce((acc, [key, value]) => {
570 acc[key] = value; 574 acc[key] = value;
571 return acc; 575 return acc;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!