j_r_r_token 1.0.0-x86_64-linux-musl → 1.1.0-x86_64-linux-musl

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc09b1151f597c852f9573052001af91040f8aa35be021ef77a8ffb6af719a55
4
- data.tar.gz: dfbac04ea1064878bd2270904c46955e7943bfb85e8360198025c8caabeb166d
3
+ metadata.gz: b0dbe3f695b827041ff28504659a75dfb3ec892f21c22a14ecddb6f0ebe92d6a
4
+ data.tar.gz: 67932c953a2a92f120e81f7e92ac58ce9b15f208bae1ba41620f204d5342bbd2
5
5
  SHA512:
6
- metadata.gz: ed1b9ce5ebcc1a913f6f879620fb2a3f9f128f2bc0ff801ab0883e53a9f0c8461d82c8f3537532ab1d43b62d16fa4298490563bc0a5c43489b4207ee240bf1ed
7
- data.tar.gz: d1ea9fbe37a82eb2e7d7881b4b82b9d3eac764f150e17be380d436d23d2ddee9c24fb1610901d8d5d4dd2d609f94bd885bd2801c59001ac598932138be713139
6
+ metadata.gz: a217698950589dbaf8323e3f62f5b9ba3dc213a6e04201be9c31f26031abf9cce19d9c56b6b64ec87f6166af3feb7bc220b44070262268ea7d1456fbf9c0899d
7
+ data.tar.gz: 1ea69bb4dfacdb2dcf36064a945f1eab128df00531376098ebc5fce105d4a4d581cfa9c8260cf506f402091c8a39e6abac58eb56df329f55d42c8365748511ea
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://youtu.be/lemgdzLDYqA?si=Z_Ls3hbJ-Xv38oJN)
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.0.0'`
18
+ `gem 'j_r_r_token', '~> 1.1'`
19
19
 
20
20
  #### Command Line
21
- `gem install j_r_r_token -v '~> 1.0.0'`
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-4.1")
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., GPT-4o)
46
- - cl100k_base Models (e.g., GPT-4, GPT-3.5)
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., GPT-2)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JRRToken
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
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.0.0
4
+ version: 1.1.0
5
5
  platform: x86_64-linux-musl
6
6
  authors:
7
7
  - Logan Bresnahan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-01 00:00:00.000000000 Z
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.so
@@ -75,7 +73,6 @@ files:
75
73
  - lib/j_r_r_token/3.3/j_r_r_token.so
76
74
  - lib/j_r_r_token/3.4/j_r_r_token.so
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
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
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