Skip to content

Commit 94ce9b7

Browse files
committed
Add OpenAI model names
1 parent 526983a commit 94ce9b7

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.1.10] - Aug 7, 2024
6+
7+
- Add additional OpenAI.com model names to the `get_token_limit` function.
8+
59
## [0.1.9] - Aug 7, 2024
610

711
- Add gpt-4o-mini support, by adding a 33.3x multiplier to the token cost.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "openai-messages-token-helper"
33
description = "A helper library for estimating tokens used by messages sent through OpenAI Chat Completions API."
4-
version = "0.1.9"
4+
version = "0.1.10"
55
authors = [{name = "Pamela Fox"}]
66
requires-python = ">=3.9"
77
readme = "README.md"

src/openai_messages_token_helper/model_helper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
"gpt-4v": 128000,
2424
"gpt-4o": 128000,
2525
"gpt-4o-mini": 128000,
26+
# OpenAI specific model names:
27+
# https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4
28+
"gpt-4-0613": 8192,
29+
"gpt-4-turbo": 128000,
30+
"gpt-4-turbo-2024-04-09": 128000,
31+
"gpt-4-turbo-preview": 128000,
32+
"gpt-4-0125-preview": 128000,
33+
"gpt-4-1106-preview": 128000,
2634
}
2735

2836

0 commit comments

Comments
 (0)