TiktokenSharp and Tiktoken

These are **competitors** — both provide C# tokenization libraries for OpenAI models, with TiktokenSharp offering broader encoding support (`o200k_base`, `cl100k_base`, `p50k_base`) compared to Tiktoken's `cl100k_base`-only implementation.

TiktokenSharp
52
Established
Tiktoken
45
Emerging
Maintenance 10/25
Adoption 10/25
Maturity 16/25
Community 16/25
Maintenance 10/25
Adoption 9/25
Maturity 16/25
Community 10/25
Stars: 126
Forks: 18
Downloads:
Commits (30d): 0
Language: C#
License: MIT
Stars: 82
Forks: 7
Downloads:
Commits (30d): 0
Language: C#
License: MIT
No Package No Dependents
No Package No Dependents

About TiktokenSharp

aiqinxuancai/TiktokenSharp

Token calculation for OpenAI models, using `o200k_base` `cl100k_base` `p50k_base` encoding.

This is a C# library that helps developers accurately count tokens for text processed by OpenAI's large language models like GPT-3.5 and GPT-4. It takes a model name or encoding identifier as input, along with your text, and outputs the precise token count. This tool is for C# developers building applications that integrate with OpenAI APIs and need to manage token limits effectively.

C# development OpenAI API integration token management large language models application development

About Tiktoken

tryAGI/Tiktoken

This project implements token calculation for OpenAI's gpt-4 and gpt-3.5-turbo model, specifically using `cl100k_base` encoding.

This tool helps developers accurately calculate the number of tokens in text or chat messages for OpenAI's GPT models (like GPT-4 and GPT-3.5-turbo), or for any model using a HuggingFace tokenizer. You input text or structured chat messages, and it outputs the precise token count or the tokens themselves. This is crucial for managing API costs and ensuring your prompts fit within model limits when building applications that interact with large language models.

AI application development LLM cost management prompt engineering text processing API integration

Related comparisons

Scores updated daily from GitHub, PyPI, and npm data. How scores work