28594_usage_tracking
Showing
2 changed files
with
41 additions
and
0 deletions
| ... | @@ -5,6 +5,46 @@ const cors = require('cors') | ... | @@ -5,6 +5,46 @@ const cors = require('cors') |
| 5 | require('dotenv').config() | 5 | require('dotenv').config() |
| 6 | const rateLimit = require('express-rate-limit') | 6 | const rateLimit = require('express-rate-limit') |
| 7 | const anchorme = require("anchorme").default; | 7 | const anchorme = require("anchorme").default; |
| 8 | const tiktoken = require('@dqbd/tiktoken'); | ||
| 9 | const tiktokenModels = [ | ||
| 10 | 'text-davinci-003', | ||
| 11 | 'text-davinci-002', | ||
| 12 | 'text-davinci-001', | ||
| 13 | 'text-curie-001', | ||
| 14 | 'text-babbage-001', | ||
| 15 | 'text-ada-001', | ||
| 16 | 'davinci', | ||
| 17 | 'curie', | ||
| 18 | 'babbage', | ||
| 19 | 'ada', | ||
| 20 | 'code-davinci-002', | ||
| 21 | 'code-davinci-001', | ||
| 22 | 'code-cushman-002', | ||
| 23 | 'code-cushman-001', | ||
| 24 | 'davinci-codex', | ||
| 25 | 'cushman-codex', | ||
| 26 | 'text-davinci-edit-001', | ||
| 27 | 'code-davinci-edit-001', | ||
| 28 | 'text-embedding-ada-002', | ||
| 29 | 'text-similarity-davinci-001', | ||
| 30 | 'text-similarity-curie-001', | ||
| 31 | 'text-similarity-babbage-001', | ||
| 32 | 'text-similarity-ada-001', | ||
| 33 | 'text-search-davinci-doc-001', | ||
| 34 | 'text-search-curie-doc-001', | ||
| 35 | 'text-search-babbage-doc-001', | ||
| 36 | 'text-search-ada-doc-001', | ||
| 37 | 'code-search-babbage-code-001', | ||
| 38 | 'code-search-ada-code-001', | ||
| 39 | 'gpt2', | ||
| 40 | 'gpt-4', | ||
| 41 | 'gpt-4-0314', | ||
| 42 | 'gpt-4-32k', | ||
| 43 | 'gpt-4-32k-0314', | ||
| 44 | 'gpt-3.5-turbo', | ||
| 45 | 'gpt-3.5-turbo-0301' | ||
| 46 | ]; | ||
| 47 | const encoding_for_model = tiktoken.encoding_for_model; | ||
| 8 | 48 | ||
| 9 | // Open AI Configuration | 49 | // Open AI Configuration |
| 10 | // console.log(process.env.OPENAI_API_ORG) | 50 | // console.log(process.env.OPENAI_API_ORG) | ... | ... |
| ... | @@ -9,6 +9,7 @@ | ... | @@ -9,6 +9,7 @@ |
| 9 | "author": "", | 9 | "author": "", |
| 10 | "license": "ISC", | 10 | "license": "ISC", |
| 11 | "dependencies": { | 11 | "dependencies": { |
| 12 | "@dqbd/tiktoken": "^1.0.7", | ||
| 12 | "anchorme": "^2.1.2", | 13 | "anchorme": "^2.1.2", |
| 13 | "body-parser": "^1.20.1", | 14 | "body-parser": "^1.20.1", |
| 14 | "cors": "^2.8.5", | 15 | "cors": "^2.8.5", | ... | ... |
-
Please register or sign in to post a comment