PHPackages                             semji/gpt-3-tokenizer-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. semji/gpt-3-tokenizer-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

semji/gpt-3-tokenizer-php
=========================

PHP Text Tokenizer for GPT models

v2.0.0(3y ago)4153.8k↓65.6%4MITPHPPHP ^8.1

Since Jan 27Pushed 1y ago4 watchersCompare

[ Source](https://github.com/semji/gpt3-tokenizer-php)[ Packagist](https://packagist.org/packages/semji/gpt-3-tokenizer-php)[ RSS](/packages/semji-gpt-3-tokenizer-php/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (3)Dependencies (5)Versions (5)Used By (0)

GPT3 tokenizer
==============

[](#gpt3-tokenizer)

PHP Text Tokenizer for GPT models

About
-----

[](#about)

A PHP toolkit to tokenize text like GPT family of models process it.

Forked from  to fit our usage, fix bugs and add unit testing.

Usage
-----

[](#usage)

The mbstring PHP extension is needed for this tool to work correctly (in case non-ASCII characters are present in the tokenized text): [details here on how to install mbstring](https://www.php.net/manual/en/mbstring.installation.php)PHP 8.1 is needed too;

```
use Semji\GPT3Tokenizer\Encoder;
$prompt = "Many words map";
$encoder = new Encoder();
$encoder->encode($prompt);
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

1243d ago

Major Versions

v1.0.1 → v2.0.02023-02-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/80d5668760f3e6ba8430206c3fadd81fad346a1b13251da21442068fb96496c6?d=identicon)[Semji](/maintainers/Semji)

---

Top Contributors

[![srogier](https://avatars.githubusercontent.com/u/814069?v=4)](https://github.com/srogier "srogier (26 commits)")[![CodeRevolutionPlugins](https://avatars.githubusercontent.com/u/91943804?v=4)](https://github.com/CodeRevolutionPlugins "CodeRevolutionPlugins (8 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/semji-gpt-3-tokenizer-php/health.svg)

```
[![Health](https://phpackages.com/badges/semji-gpt-3-tokenizer-php/health.svg)](https://phpackages.com/packages/semji-gpt-3-tokenizer-php)
```

###  Alternatives

[paragonie/corner

Generic PHP Exceptions and Errors, made user-friendly.

63706.0k8](/packages/paragonie-corner)[stevegrunwell/wp-admin-tabbed-settings-pages

A polyfill for Trac #51086, bringing tabbed settings pages into WP-Admin.

1446.2k](/packages/stevegrunwell-wp-admin-tabbed-settings-pages)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
