Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/test_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import tiktoken
def test_gpt5_encoding():
encoding = tiktoken.encoding_for_model("gpt-5")
assert encoding.name == "o200k_base"
tokens = encoding.encode("hello world")
assert tokens == [24912, 2375] # Verify o200k_base behavior
1 change: 1 addition & 0 deletions tiktoken/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"o3": "o200k_base",
"o4-mini": "o200k_base",
# chat
"gpt-5": "o200k_base",
"gpt-4.1": "o200k_base",
"gpt-4o": "o200k_base",
"gpt-4": "cl100k_base",
Expand Down