MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / getSupportedModel

Function getSupportedModel

app/src/utils/countTokens.ts:36–43  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

34
35// "gpt-tokens" does not support new models. This is a temporary workaround.
36function getSupportedModel(model: string): supportModelType {
37 const modelMapping: Record<string, supportModelType> = {
38 "gpt-4-0125-preview": "gpt-4-1106-preview",
39 "gpt-3.5-turbo-0125": "gpt-3.5-turbo-1106",
40 };
41
42 return modelMapping[model] || (model as supportModelType);
43}
44
45export const countLlamaTokens = (input: string) => llamaTokenizer.encode(input).length;
46

Callers 1

countOpenAIChatTokensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected