MCPcopy Index your code
hub / github.com/ceifa/tiktoken-node

github.com/ceifa/tiktoken-node @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
9 symbols 12 edges 6 files 0 documented · 0% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

⏳ tiktoken-node

tiktoken is a fast BPE tokeniser for use with OpenAI's models.

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

Core symbols most depended-on inside this repo

encode
called by 1
src/lib.rs
decode
called by 1
src/lib.rs
main
called by 0
build.rs
encode_batch
called by 0
src/lib.rs
get_encoding
called by 0
src/lib.rs
encoding_for_model
called by 0
src/lib.rs

Shape

Class 3
Function 3
Method 3

Languages

Rust78%
TypeScript22%

Modules by API surface

src/lib.rs6 symbols
index.d.ts2 symbols
build.rs1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add tiktoken-node \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page