MCPcopy
hub / github.com/OpenPipe/OpenPipe / countLlamaTokens

Function countLlamaTokens

app/src/utils/countTokens.ts:45–45  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

43}
44
45export const countLlamaTokens = (input: string) => llamaTokenizer.encode(input).length;
46
47export const countLlamaInputTokens = (input: Parameters<typeof serializeChatInput>[0]) =>
48 countLlamaTokens(serializeChatInput(input, { pipelineVersion: CURRENT_PIPELINE_VERSION }));

Callers 3

countLlamaInputTokensFunction · 0.85
countLlamaOutputTokensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected