pkoukk/tiktoken-go
go version of tiktoken
This is a Go language implementation of OpenAI's tiktoken library. It helps developers working with Go applications to accurately count and tokenize text for use with various OpenAI models, such as GPT-3.5 and GPT-4. You provide text or chat messages, and it outputs the corresponding token IDs and the total token count.
895 stars. No commits in the last 6 months.
Use this if you are a Go developer building applications that interact with OpenAI's models and need to manage token limits or process text for these models efficiently.
Not ideal if you are not a Go developer or are working with models other than those supported by OpenAI's tiktoken.
Stars
895
Forks
102
Language
Go
License
MIT
Category
Last pushed
Sep 10, 2025
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/llm-tools/pkoukk/tiktoken-go"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
aiqinxuancai/TiktokenSharp
Token calculation for OpenAI models, using `o200k_base` `cl100k_base` `p50k_base` encoding.
dqbd/tiktokenizer
Online playground for OpenAPI tokenizers
microsoft/Tokenizer
Typescript and .NET implementation of BPE tokenizer for OpenAI LLMs.
lenML/tokenizers
a lightweight no-dependency fork from transformers.js (only tokenizers)
tryAGI/Tiktoken
This project implements token calculation for OpenAI's gpt-4 and gpt-3.5-turbo model,...