# @mrlowlevel/tiktoken-node

> tiktoken is a fast [BPE](https://en.wikipedia.org/wiki/Byte_pair_encoding) tokeniser for use with OpenAI's models.

Latest version **0.0.8** (published 2023-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mrlowlevel/tiktoken-node
pnpm add @mrlowlevel/tiktoken-node
yarn add @mrlowlevel/tiktoken-node
bun add @mrlowlevel/tiktoken-node
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2023-06-01 |
| First published | 2023-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 14 |
| Dependencies | 0 |
| Unpacked size | 28.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | mrlowlevel |

## Links

- npm: https://www.npmjs.com/package/@mrlowlevel/tiktoken-node
- Repository: https://github.com/adri1wald/tiktoken-node
- Homepage: https://github.com/adri1wald/tiktoken-node#readme
- Issues: https://github.com/adri1wald/tiktoken-node/issues
- npm.io page: https://npm.io/package/@mrlowlevel/tiktoken-node

## Recent versions

- 0.0.8 (latest) — 2023-06-01
- 0.0.7 — 2023-06-01
- 0.0.6 — 2023-06-01

## README

# ⏳ tiktoken-node

tiktoken is a fast [BPE](https://en.wikipedia.org/wiki/Byte_pair_encoding) tokeniser for use with
OpenAI's models.

```js
const tiktoken = require('tiktoken-node')
let enc = tiktoken.getEncoding("gpt2")
console.assert(enc.decode(enc.encode("hello world")) == "hello world")

// To get the tokeniser corresponding to a specific model in the OpenAI API:
enc = tiktoken.encodingForModel("text-davinci-003")
```

The open source version of `tiktoken-node` can be installed from npm:
```
npm install tiktoken-node
```

---
_Source: https://npm.io/package/@mrlowlevel/tiktoken-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
