An open API service indexing awesome lists of open source software.

https://github.com/jacoblincool/tiktoken-calculator

Calculate the token count for GPT-4, GPT-3.5, GPT-3, and GPT-2.
https://github.com/jacoblincool/tiktoken-calculator

gpt tiktoken tokenizer

Last synced: 4 months ago
JSON representation

Calculate the token count for GPT-4, GPT-3.5, GPT-3, and GPT-2.

Awesome Lists containing this project

README

          

# Tiktoken Calculator

Calculate the token count for GPT-4, GPT-3.5, GPT-3, and GPT-2.

> It uses [openai/tiktoken](https://github.com/openai/tiktoken) to calculate the token count.

## How to use

### HuggingFace Spaces

Go to and try it out!

### Docker

There is a pre-built Docker image available on Docker Hub:

```bash
docker run -p 7860:7860 jacoblincool/tiktoken-calculator
```

If you prefer to use Docker Compose, you can clone this repository and run:

```bash
docker compose up -d
```

### Local

I use Poetry to manage dependencies.

Setup the virtual environment after cloning this repository:

```bash
poetry install
```

Then run the app:

```bash
poetry run python app.py
```