j_r_r_token 1.0.0-arm64-darwin → 1.1.0-arm64-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -0
- data/README.md +8 -8
- data/j_r_r_token.gemspec +1 -1
- data/lib/j_r_r_token/2.7/j_r_r_token.bundle +0 -0
- data/lib/j_r_r_token/3.0/j_r_r_token.bundle +0 -0
- data/lib/j_r_r_token/3.1/j_r_r_token.bundle +0 -0
- data/lib/j_r_r_token/3.2/j_r_r_token.bundle +0 -0
- data/lib/j_r_r_token/3.3/j_r_r_token.bundle +0 -0
- data/lib/j_r_r_token/3.4/j_r_r_token.bundle +0 -0
- data/lib/j_r_r_token/version.rb +1 -1
- metadata +2 -5
- data/.rspec +0 -3
- data/Rakefile +0 -27
- data/ring.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00ad7ba724d46812408a7b8a85d9386b102de6ed1efb95ba21b33f66f0b732a7
|
4
|
+
data.tar.gz: 953b06ce59d00dc7b4351ea3deebd479da6451c08095343b4cc38128a48f2a45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f337b60a007c53b8ed640db0c5874cbdd3dc3a5e3953680b84023554a64cd6c4be570fb7d028f0ced9d1987b17e0c8faffacda08a6826aea3d7d72f1b7e057d0
|
7
|
+
data.tar.gz: 8d32c0f4efb44ea80c227159b039e441a22023751801da14cfe0bb8b7eb651fc3fe6ead495c1bb07111036bd543fd9f527b83387028e03a0a4fc7a5a505aac01
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
---
|
11
|
+
## [1.1.0] - 2025-08-26
|
12
|
+
### New Functionality
|
13
|
+
- Added support for the `gpt-5` model name, which maps to the `o200k_base` tokenizer model.
|
14
|
+
|
15
|
+
#### New contributors
|
16
|
+
- [8edaf40](https://github.com/LoganBresnahan/j_r_r_token/commit/8edaf4021dae4ae41dcfa53fa5fb0fe61d9b0b9c) by [jordanmoore753](https://github.com/jordanmoore753)
|
17
|
+
- [a9738c7](https://github.com/LoganBresnahan/j_r_r_token/commit/a9738c7f0d4e7e691af8b8219e89d09b4a3367c0) by [lsysophia](https://github.com/lsysophia)
|
18
|
+
|
19
|
+
---
|
20
|
+
## [1.0.4] - 2025-08-01
|
21
|
+
### Change
|
22
|
+
- Bump version for RubyGems.
|
23
|
+
|
24
|
+
---
|
25
|
+
## [1.0.3] - 2025-08-01
|
26
|
+
### Fix
|
27
|
+
- Add Cargo files back to the gemspec.
|
28
|
+
### Change
|
29
|
+
- Adjust specs.
|
30
|
+
|
31
|
+
---
|
32
|
+
## [1.0.2] - 2025-08-01
|
33
|
+
### Change
|
34
|
+
- Refine Model Prefix Matching so 4 and 4* match to the correct Core BPE.
|
35
|
+
|
36
|
+
---
|
37
|
+
## [1.0.1] - 2025-08-01
|
38
|
+
### Change
|
39
|
+
- Slim down gem by removing unnecessary files defined in the gemspec.
|
40
|
+
- Refine Model Prefix Matching so 4 and 4* match to the correct Core BPE.
|
41
|
+
|
10
42
|
---
|
11
43
|
## [1.0.0] - 2025-08-01
|
12
44
|
### Breaking Change
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# JRRToken [<img src="ring.png" width="32px" alt="One ring to rule them all, one ring to find them, One ring to bring them all and in the darkness bind them.">](https://
|
1
|
+
# JRRToken [<img src="https://github.com/LoganBresnahan/j_r_r_token/raw/main/.github/assets/ring.png" width="32px" alt="One ring to rule them all, one ring to find them, One ring to bring them all and in the darkness bind them.">](https://www.youtube.com/watch?v=lemgdzLDYqA)
|
2
2
|
|
3
|
-
(Just Ruby Rust Tokens)
|
3
|
+
(Just Ruby, Rust, & Tokens)
|
4
4
|
|
5
5
|
JRRToken provides a high-performance, native Ruby interface for counting tokens using the powerful [tiktoken-rs](https://github.com/zurawiki/tiktoken-rs) library. It leverages the speed of Rust to offer a fast and efficient way to calculate token counts for various OpenAI models.
|
6
6
|
|
@@ -15,16 +15,16 @@ Extensive Model Support: Includes tokenizers for all modern and legacy OpenAI mo
|
|
15
15
|
## Install
|
16
16
|
|
17
17
|
#### Gemfile
|
18
|
-
`gem 'j_r_r_token', '~> 1.
|
18
|
+
`gem 'j_r_r_token', '~> 1.1'`
|
19
19
|
|
20
20
|
#### Command Line
|
21
|
-
`gem install j_r_r_token -v '~> 1.
|
21
|
+
`gem install j_r_r_token -v '~> 1.1'`
|
22
22
|
|
23
23
|
## Use
|
24
24
|
|
25
25
|
### Count tokens for a specific model (the model keyword is required)
|
26
26
|
```Ruby
|
27
|
-
count = JRRToken::Tokenizer.count("hello world!", model: "gpt-
|
27
|
+
count = JRRToken::Tokenizer.count("hello world!", model: "gpt-5")
|
28
28
|
```
|
29
29
|
|
30
30
|
### The gem recognizes many aliases, including older models
|
@@ -42,10 +42,10 @@ If you provide an unsupported model name, the gem will raise an `ArgumentError`.
|
|
42
42
|
## Supported Models
|
43
43
|
The gem automatically maps dozens of model names and prefixes to the correct underlying tokenizer. You don't need to know the tokenizer's base name (e.g., cl100k_base); just use the model name you're working with.
|
44
44
|
|
45
|
-
- o200k_base Models (e.g.,
|
46
|
-
- cl100k_base Models (e.g.,
|
45
|
+
- o200k_base Models (e.g., gpt-5, gpt-4.1, gpt-4o)
|
46
|
+
- cl100k_base Models (e.g., gpt-4, gpt-3.5)
|
47
47
|
- p50k_base Models (e.g., text-davinci-003)
|
48
|
-
- r50k_base Models (e.g.,
|
48
|
+
- r50k_base Models (e.g., gpt-2)
|
49
49
|
- p50k_edit Models
|
50
50
|
|
51
51
|
## Developing JRRToken Locally
|
data/j_r_r_token.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.files = Dir.chdir(__dir__) do
|
26
26
|
`git ls-files -z`.split("\x0").reject do |f|
|
27
27
|
(File.expand_path(f) == __FILE__) ||
|
28
|
-
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
28
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .github/ .git .circleci .rspec appveyor Gemfile Rakefile])
|
29
29
|
end
|
30
30
|
end
|
31
31
|
spec.bindir = "exe"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/j_r_r_token/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: j_r_r_token
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: arm64-darwin
|
6
6
|
authors:
|
7
7
|
- Logan Bresnahan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,11 +61,9 @@ executables: []
|
|
61
61
|
extensions: []
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
|
-
- ".rspec"
|
65
64
|
- CHANGELOG.md
|
66
65
|
- LICENSE
|
67
66
|
- README.md
|
68
|
-
- Rakefile
|
69
67
|
- j_r_r_token.gemspec
|
70
68
|
- lib/j_r_r_token.rb
|
71
69
|
- lib/j_r_r_token/2.7/j_r_r_token.bundle
|
@@ -75,7 +73,6 @@ files:
|
|
75
73
|
- lib/j_r_r_token/3.3/j_r_r_token.bundle
|
76
74
|
- lib/j_r_r_token/3.4/j_r_r_token.bundle
|
77
75
|
- lib/j_r_r_token/version.rb
|
78
|
-
- ring.png
|
79
76
|
- sig/j_r_r_token.rbs
|
80
77
|
homepage: https://github.com/LoganBresnahan/j_r_r_token
|
81
78
|
licenses:
|
data/.rspec
DELETED
data/Rakefile
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
require "rake/extensiontask"
|
5
|
-
require "rb_sys/extensiontask"
|
6
|
-
|
7
|
-
GEMSPEC = Gem::Specification.load("j_r_r_token.gemspec")
|
8
|
-
|
9
|
-
RbSys::ExtensionTask.new("j_r_r_token", GEMSPEC) do |ext|
|
10
|
-
ext.lib_dir = "lib/j_r_r_token"
|
11
|
-
end
|
12
|
-
|
13
|
-
# Only require rspec if it's available
|
14
|
-
begin
|
15
|
-
require "rspec/core/rake_task"
|
16
|
-
RSpec::Core::RakeTask.new(:spec)
|
17
|
-
task default: %i[compile spec]
|
18
|
-
rescue LoadError
|
19
|
-
puts "RSpec not available"
|
20
|
-
task default: :compile
|
21
|
-
end
|
22
|
-
|
23
|
-
task :native, [:platform] do |_t, platform:|
|
24
|
-
sh "bundle", "exec", "rb-sys-dock", "--platform", platform, "--build"
|
25
|
-
end
|
26
|
-
|
27
|
-
task build: :compile
|
data/ring.png
DELETED
Binary file
|