Skip to content

Commit 635be97

Browse files
authored
chore(llmobs): remove tiktoken dependency (#15129)
[MLOB-4128] Drops the optional tiktoken dependency from ddtrace. Also removes tiktoken estimation of tokens from the openai integration. This was only used by customers that explicitly rejected streamed token metrics from streamed chat/responses, which is an extreme minority of users. We made the call that this optional dependency wasn't worth the maintenance burden (difficulty in updating python versions, other third party libraries, etc) in our ddtrace 4.0 major release. We'll just default to estimating the token count with our super simple heuristic if token counts are not provided by openai. This PR also updates testing to test openai==2.2.0. <!-- Provide an overview of the change and motivation for the change --> <!-- Describe your testing strategy or note what tests are included --> <!-- Note any risks associated with this change, or "None" if no risks --> <!-- Any other information that would be helpful for reviewers --> [MLOB-4128]: https://datadoghq.atlassian.net/browse/MLOB-4128?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ## Description <!-- Provide an overview of the change and motivation for the change --> ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers --> [MLOB-4128]: https://datadoghq.atlassian.net/browse/MLOB-4128?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [MLOB-4128]: https://datadoghq.atlassian.net/browse/MLOB-4128?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 118b4c3 commit 635be97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+871
-778
lines changed

.riot/requirements/132e4bd.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/132e4bd.in
6+
#
7+
annotated-types==0.7.0
8+
anyio==4.11.0
9+
attrs==25.4.0
10+
certifi==2025.10.5
11+
coverage[toml]==7.11.0
12+
distro==1.9.0
13+
h11==0.16.0
14+
httpcore==1.0.9
15+
httpx==0.28.1
16+
hypothesis==6.45.0
17+
idna==3.11
18+
iniconfig==2.1.0
19+
jiter==0.11.0
20+
mock==5.2.0
21+
multidict==6.7.0
22+
openai==2.3.0
23+
opentracing==2.4.0
24+
packaging==25.0
25+
pillow==11.3.0
26+
pluggy==1.6.0
27+
propcache==0.4.1
28+
pydantic==2.12.2
29+
pydantic-core==2.41.4
30+
pygments==2.19.2
31+
pytest==8.4.2
32+
pytest-asyncio==0.21.1
33+
pytest-cov==7.0.0
34+
pytest-mock==3.15.1
35+
pytest-randomly==4.0.1
36+
pyyaml==6.0.3
37+
sniffio==1.3.1
38+
sortedcontainers==2.4.0
39+
tqdm==4.67.1
40+
typing-extensions==4.15.0
41+
typing-inspection==0.4.2
42+
urllib3==1.26.20
43+
vcrpy==7.0.0
44+
wrapt==1.17.3
45+
yarl==1.22.0

.riot/requirements/134082f.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.13
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/134082f.in
6+
#
7+
annotated-types==0.7.0
8+
anyio==4.11.0
9+
attrs==25.4.0
10+
certifi==2025.10.5
11+
coverage[toml]==7.11.0
12+
distro==1.9.0
13+
h11==0.16.0
14+
httpcore==1.0.9
15+
httpx==0.28.1
16+
hypothesis==6.45.0
17+
idna==3.11
18+
iniconfig==2.1.0
19+
jiter==0.11.0
20+
mock==5.2.0
21+
multidict==6.7.0
22+
openai==1.66.0
23+
opentracing==2.4.0
24+
packaging==25.0
25+
pillow==11.3.0
26+
pluggy==1.6.0
27+
propcache==0.4.1
28+
pydantic==2.12.2
29+
pydantic-core==2.41.4
30+
pygments==2.19.2
31+
pytest==8.4.2
32+
pytest-asyncio==0.21.1
33+
pytest-cov==7.0.0
34+
pytest-mock==3.15.1
35+
pytest-randomly==4.0.1
36+
pyyaml==6.0.3
37+
sniffio==1.3.1
38+
sortedcontainers==2.4.0
39+
tqdm==4.67.1
40+
typing-extensions==4.15.0
41+
typing-inspection==0.4.2
42+
urllib3==1.26.20
43+
vcrpy==7.0.0
44+
wrapt==1.17.3
45+
yarl==1.22.0

.riot/requirements/d3fea5a.txt renamed to .riot/requirements/14aa6df.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
5-
# pip-compile --allow-unsafe --no-annotate .riot/requirements/d3fea5a.in
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/14aa6df.in
66
#
77
annotated-types==0.7.0
88
anyio==4.11.0
99
attrs==25.4.0
1010
certifi==2025.10.5
11-
charset-normalizer==3.4.3
12-
coverage[toml]==7.10.7
11+
coverage[toml]==7.11.0
1312
distro==1.9.0
1413
h11==0.16.0
1514
httpcore==1.0.9
1615
httpx==0.28.1
1716
hypothesis==6.45.0
18-
idna==3.10
17+
idna==3.11
1918
iniconfig==2.1.0
2019
jiter==0.11.0
2120
mock==5.2.0
@@ -25,21 +24,18 @@ opentracing==2.4.0
2524
packaging==25.0
2625
pillow==11.3.0
2726
pluggy==1.6.0
28-
propcache==0.4.0
29-
pydantic==2.12.0
30-
pydantic-core==2.41.1
27+
propcache==0.4.1
28+
pydantic==2.12.2
29+
pydantic-core==2.41.4
3130
pygments==2.19.2
3231
pytest==8.4.2
3332
pytest-asyncio==0.21.1
3433
pytest-cov==7.0.0
3534
pytest-mock==3.15.1
3635
pytest-randomly==4.0.1
3736
pyyaml==6.0.3
38-
regex==2025.9.18
39-
requests==2.32.5
4037
sniffio==1.3.1
4138
sortedcontainers==2.4.0
42-
tiktoken==0.12.0
4339
tqdm==4.67.1
4440
typing-extensions==4.15.0
4541
typing-inspection==0.4.2

.riot/requirements/1547cc9.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1547cc9.in
6+
#
7+
annotated-types==0.7.0
8+
anyio==4.11.0
9+
attrs==25.4.0
10+
certifi==2025.10.5
11+
coverage[toml]==7.10.7
12+
distro==1.9.0
13+
exceptiongroup==1.3.0
14+
h11==0.16.0
15+
httpcore==1.0.9
16+
httpx==0.28.1
17+
hypothesis==6.45.0
18+
idna==3.11
19+
importlib-metadata==8.7.0
20+
iniconfig==2.1.0
21+
jiter==0.11.0
22+
mock==5.2.0
23+
multidict==6.7.0
24+
openai==1.76.2
25+
opentracing==2.4.0
26+
packaging==25.0
27+
pillow==11.3.0
28+
pluggy==1.6.0
29+
propcache==0.4.1
30+
pydantic==2.12.2
31+
pydantic-core==2.41.4
32+
pygments==2.19.2
33+
pytest==8.4.2
34+
pytest-asyncio==0.21.1
35+
pytest-cov==7.0.0
36+
pytest-mock==3.15.1
37+
pytest-randomly==4.0.1
38+
pyyaml==6.0.3
39+
sniffio==1.3.1
40+
sortedcontainers==2.4.0
41+
tomli==2.3.0
42+
tqdm==4.67.1
43+
typing-extensions==4.15.0
44+
typing-inspection==0.4.2
45+
urllib3==1.26.20
46+
vcrpy==7.0.0
47+
wrapt==1.17.3
48+
yarl==1.22.0
49+
zipp==3.23.0

.riot/requirements/162cf2e.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/162cf2e.in
6+
#
7+
annotated-types==0.7.0
8+
anyio==4.11.0
9+
attrs==25.4.0
10+
certifi==2025.10.5
11+
coverage[toml]==7.11.0
12+
distro==1.9.0
13+
h11==0.16.0
14+
httpcore==1.0.9
15+
httpx==0.28.1
16+
hypothesis==6.45.0
17+
idna==3.11
18+
iniconfig==2.1.0
19+
jiter==0.11.0
20+
mock==5.2.0
21+
multidict==6.7.0
22+
openai==1.109.1
23+
opentracing==2.4.0
24+
packaging==25.0
25+
pillow==11.3.0
26+
pluggy==1.6.0
27+
propcache==0.4.1
28+
pydantic==2.12.2
29+
pydantic-core==2.41.4
30+
pygments==2.19.2
31+
pytest==8.4.2
32+
pytest-asyncio==0.21.1
33+
pytest-cov==7.0.0
34+
pytest-mock==3.15.1
35+
pytest-randomly==4.0.1
36+
pyyaml==6.0.3
37+
sniffio==1.3.1
38+
sortedcontainers==2.4.0
39+
tqdm==4.67.1
40+
typing-extensions==4.15.0
41+
typing-inspection==0.4.2
42+
urllib3==1.26.20
43+
vcrpy==7.0.0
44+
wrapt==1.17.3
45+
yarl==1.22.0

.riot/requirements/164ce6e.txt

Lines changed: 0 additions & 49 deletions
This file was deleted.

.riot/requirements/1ce4e3f.txt renamed to .riot/requirements/169d13a.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
# This file is autogenerated by pip-compile with Python 3.8
33
# by the following command:
44
#
5-
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1ce4e3f.in
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/169d13a.in
66
#
77
annotated-types==0.7.0
88
anyio==4.5.2
99
attrs==25.3.0
10-
certifi==2025.4.26
11-
charset-normalizer==3.4.2
10+
certifi==2025.10.5
1211
coverage[toml]==7.6.1
1312
distro==1.9.0
1413
exceptiongroup==1.3.0
1514
h11==0.16.0
1615
httpcore==1.0.9
1716
httpx==0.28.1
1817
hypothesis==6.45.0
19-
idna==3.10
18+
idna==3.11
2019
importlib-metadata==8.5.0
2120
iniconfig==2.1.0
2221
jiter==0.9.1
@@ -35,17 +34,14 @@ pytest-asyncio==0.21.1
3534
pytest-cov==5.0.0
3635
pytest-mock==3.14.1
3736
pytest-randomly==3.15.0
38-
pyyaml==6.0.2
39-
regex==2024.11.6
40-
requests==2.32.4
37+
pyyaml==6.0.3
4138
sniffio==1.3.1
4239
sortedcontainers==2.4.0
43-
tiktoken==0.7.0
44-
tomli==2.2.1
40+
tomli==2.3.0
4541
tqdm==4.67.1
4642
typing-extensions==4.13.2
4743
urllib3==1.26.20
4844
vcrpy==6.0.2
49-
wrapt==1.17.2
45+
wrapt==2.0.0
5046
yarl==1.15.2
5147
zipp==3.20.2

.riot/requirements/16a63d7.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/16a63d7.in
6+
#
7+
annotated-types==0.7.0
8+
anyio==4.11.0
9+
attrs==25.4.0
10+
certifi==2025.10.5
11+
coverage[toml]==7.11.0
12+
distro==1.9.0
13+
h11==0.16.0
14+
httpcore==1.0.9
15+
httpx==0.28.1
16+
hypothesis==6.45.0
17+
idna==3.11
18+
iniconfig==2.1.0
19+
jiter==0.11.0
20+
mock==5.2.0
21+
multidict==6.7.0
22+
openai==1.76.2
23+
opentracing==2.4.0
24+
packaging==25.0
25+
pillow==11.3.0
26+
pluggy==1.6.0
27+
propcache==0.4.1
28+
pydantic==2.12.2
29+
pydantic-core==2.41.4
30+
pygments==2.19.2
31+
pytest==8.4.2
32+
pytest-asyncio==0.21.1
33+
pytest-cov==7.0.0
34+
pytest-mock==3.15.1
35+
pytest-randomly==4.0.1
36+
pyyaml==6.0.3
37+
sniffio==1.3.1
38+
sortedcontainers==2.4.0
39+
tqdm==4.67.1
40+
typing-extensions==4.15.0
41+
typing-inspection==0.4.2
42+
urllib3==1.26.20
43+
vcrpy==7.0.0
44+
wrapt==1.17.3
45+
yarl==1.22.0

0 commit comments

Comments
 (0)