Skip to content
Merged
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
4 changes: 4 additions & 0 deletions docs/fundamentals/ruler.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,7 @@ for traj in judged_group.trajectories:

- Use cheaper judge models (e.g., Qwen3 32B)
- Reduce group size

<Note>
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.
</Note>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = ">=3.11"
dependencies = [
"openai>=2.14.0",
"typer>=0.15.2",
"litellm==1.74.1",
"litellm>=1.74.1",
"weave>=0.51.51",
"tinker>=0.7.0",
"tinker-cookbook>=0.1.0",
Expand Down
11 changes: 11 additions & 0 deletions src/art/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import os

from dotenv import load_dotenv

load_dotenv()

if os.getenv("SUPPRESS_LITELLM_SERIALIZATION_WARNINGS", "1") == "1":
from art.utils.suppress_litellm_serialization_warnings import (
suppress_litellm_serialization_warnings,
)

suppress_litellm_serialization_warnings()

# Create a dummy GuidedDecodingParams class and inject it into vllm.sampling_params for trl compatibility
try:
import vllm.sampling_params
Expand Down
22 changes: 22 additions & 0 deletions src/art/utils/suppress_litellm_serialization_warnings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import warnings


def suppress_litellm_serialization_warnings():
"""
Suppress litellm's internal Pydantic serialization warnings.

These warnings occur due to a known litellm issue (#11759) where response
types (Message, StreamingChoices) have mismatched field counts during
internal serialization. The warnings don't affect functionality.

Scoped to only silence:
- UserWarning category
- From pydantic.main module
- Matching "Pydantic serializer warnings: PydanticSerializationUnexpectedValue"
"""
warnings.filterwarnings(
"ignore",
category=UserWarning,
module=r"pydantic\.main",
message=r"Pydantic serializer warnings:\s+PydanticSerializationUnexpectedValue",
)
62 changes: 58 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.