Skip to content
T

Tiktoken Go

go version of tiktoken

by pkoukkFree

#2090in AI
0In stores

Description

tiktoken-go is a Go port of OpenAI's tiktoken, a fast byte-pair encoding tokenizer for OpenAI models. Go programs can use it to encode text…

Highlights

  • Port of the OpenAI tiktoken BPE tokenizer
  • Encoding lookup by encoding name or by model
  • Dictionary cache set with TIKTOKEN_CACHE_DIR
  • Pluggable BPE loaders, including an offline option
  • Examples for counting tokens in chat API messages

Ratings & Reviews

No ratings yet

Be the first to rate Tiktoken Go.

People also visit

T

Tiktokenizer

Online playground for OpenAPI tokenizers

AI
Launch
G

Go Openai

OpenAI, GPT 6.1, GPT-Image-2, Whisper API clients for Go. Zero-dependency

AI
Launch
C

Chatgpt

ChatGPT Console client in Golang

AI
Launch
T

Tokentap

Intercept LLM API traffic and visualize token usage in a real-time terminal…

AI
Launch
G

Gptcli

ChatGPT in command line with OpenAI API (gpt-3.5-turbo/gpt-4/gpt-4-32k)

AI
Launch
T

TurboLLM

Run any local LLM engine, auto-tuned to your GPU

AI
Launch

Tiktoken Go FAQ

What is tiktoken-go?

A Go library that tokenizes text with the same BPE encodings as OpenAI's tiktoken.

How are the token dictionaries loaded?

They download when an encoding is first initialized. Set TIKTOKEN_CACHE_DIR to keep them on disk, or use a custom or offline BPE loader.

How do I install it?

Add it to a Go project using the install step in the README, then call GetEncoding or EncodingForModel.

Are the chat token counts exact?

The README says the chat counting method may change at any time and that official OpenAI documentation should be used when exact figures are needed.

Is it open source?

Yes. The code is public on GitHub.

What are the best Tiktoken Go alternatives?

Popular alternatives to Tiktoken Go include Tiktokenizer, Go Openai and Chatgpt. See all Tiktoken Go alternatives

Developer Stuff

Badges