0.0.3 • Published 2 years ago

js-tiktoken-mongodb v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

⏳ js-tiktoken

tiktoken is a BPE tokeniser for use with OpenAI's models. This is a pure JS port of the original tiktoken library.

Install the library from NPM:

npm install js-tiktoken

Usage

Basic usage follows, which includes all the OpenAI encoders and ranks:

import assert from "node:assert";
import { getEncoding, encodingForModel } from "js-tiktoken";

const enc = getEncoding("gpt2");
assert(enc.decode(enc.encode("hello world")) === "hello world");
0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago