Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
2904457f
authored
2024-09-27 11:03:18 +0800
by
Bryan Batac
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
- Added only allowed models
1 parent
8d85ae8a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
index.js
index.js
View file @
2904457
...
...
@@ -52,7 +52,11 @@ const tiktokenModels = [
let
client
;
let
filteredModels
=
{};
const
allowedEndpoints
=
[
"openAI"
,
"Opensource"
,
"Llama"
];
const
excludedModels
=
[
"o1-preview"
,
"o1-mini"
];
const
allowedModels
=
[
"gpt-3.5-turbo"
,
"google/gemma-2-9b-it"
,
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"
];
// Open AI Configuration
// console.log(process.env.OPENAI_API_ORG)
...
...
@@ -565,7 +569,7 @@ const fetchAndFilterModels = async (client) => {
const
models
=
await
client
.
get
(
'model'
);
return
Object
.
entries
(
JSON
.
parse
(
models
))
.
filter
(([
_
,
value
])
=>
allowedEndpoints
.
includes
(
value
.
endpoint
))
.
filter
(([
_
,
value
])
=>
!
exclud
edModels
.
includes
(
value
.
model
))
.
filter
(([
_
,
value
])
=>
allow
edModels
.
includes
(
value
.
model
))
.
reduce
((
acc
,
[
key
,
value
])
=>
{
acc
[
key
]
=
value
;
return
acc
;
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment