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: 5 additions & 1 deletion src/openai_messages_token_helper/model_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@
"gpt-5-mini": 272000,
"gpt-5-nano": 272000,
"gpt-5-chat": 128000,
"gpt-5.1": 272000,
"gpt-5.1-chat": 111616,
"gpt-5.2": 272000,
"gpt-5.2-chat": 111616,
}


AOAI_2_OAI = {"gpt-35-turbo": "gpt-3.5-turbo", "gpt-35-turbo-16k": "gpt-3.5-turbo-16k", "gpt-4v": "gpt-4-turbo-vision"}

# Set of reasoning models that cannot have token usage pre-estimated
REASONING_MODELS = {"gpt-5", "gpt-5-mini", "gpt-5-nano"}
REASONING_MODELS = {"gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-5.1-chat", "gpt-5.2"}

logger = logging.getLogger("openai_messages_token_helper")

Expand Down
4 changes: 4 additions & 0 deletions tests/test_modelhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def test_get_token_limit():
assert get_token_limit("gpt-5-mini") == 272000
assert get_token_limit("gpt-5-nano") == 272000
assert get_token_limit("gpt-5-chat") == 128000
assert get_token_limit("gpt-5.1") == 272000
assert get_token_limit("gpt-5.1-chat") == 111616
assert get_token_limit("gpt-5.2") == 272000
assert get_token_limit("gpt-5.2-chat") == 111616


def test_get_token_limit_error():
Expand Down