Skip to content

Commit 39f4972

Browse files
authored
Upgrade litellm, suppress bugs (#506)
1 parent 51528ca commit 39f4972

5 files changed

Lines changed: 96 additions & 5 deletions

File tree

docs/fundamentals/ruler.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,7 @@ for traj in judged_group.trajectories:
335335

336336
- Use cheaper judge models (e.g., Qwen3 32B)
337337
- Reduce group size
338+
339+
<Note>
340+
Since RULER uses LiteLLM under the hood, ART automatically suppresses harmless Pydantic serialization warnings from LiteLLM ([related issue](https://github.com/BerriAI/litellm/issues/11759)). To disable this behavior, set `SUPPRESS_LITELLM_SERIALIZATION_WARNINGS=0` in your environment.
341+
</Note>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires-python = ">=3.11"
77
dependencies = [
88
"openai>=2.14.0",
99
"typer>=0.15.2",
10-
"litellm==1.74.1",
10+
"litellm>=1.74.1",
1111
"weave>=0.51.51",
1212
"tinker>=0.7.0",
1313
"tinker-cookbook>=0.1.0",

src/art/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import os
22

3+
from dotenv import load_dotenv
4+
5+
load_dotenv()
6+
7+
if os.getenv("SUPPRESS_LITELLM_SERIALIZATION_WARNINGS", "1") == "1":
8+
from art.utils.suppress_litellm_serialization_warnings import (
9+
suppress_litellm_serialization_warnings,
10+
)
11+
12+
suppress_litellm_serialization_warnings()
13+
314
# Create a dummy GuidedDecodingParams class and inject it into vllm.sampling_params for trl compatibility
415
try:
516
import vllm.sampling_params
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import warnings
2+
3+
4+
def suppress_litellm_serialization_warnings():
5+
"""
6+
Suppress litellm's internal Pydantic serialization warnings.
7+
8+
These warnings occur due to a known litellm issue (#11759) where response
9+
types (Message, StreamingChoices) have mismatched field counts during
10+
internal serialization. The warnings don't affect functionality.
11+
12+
Scoped to only silence:
13+
- UserWarning category
14+
- From pydantic.main module
15+
- Matching "Pydantic serializer warnings: PydanticSerializationUnexpectedValue"
16+
"""
17+
warnings.filterwarnings(
18+
"ignore",
19+
category=UserWarning,
20+
module=r"pydantic\.main",
21+
message=r"Pydantic serializer warnings:\s+PydanticSerializationUnexpectedValue",
22+
)

uv.lock

Lines changed: 58 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)