Repository navigation
chore(llm): switch default LLM from gpt-4o/gpt-4o-mini to gpt-5.6-sol #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2cd30ef
516ef25
2b7509a
a94c7a0
62ac0a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| from litellm import completion, get_supported_openai_params | ||
| from litellm import supports_reasoning as _litellm_supports_reasoning | ||
|
|
||
| # Passed to litellm/OpenAI to force a strict JSON object response. | ||
| JSON_OBJECT_RESPONSE_FORMAT = {"type": "json_object"} | ||
|
|
@@ -19,8 +20,7 @@ def traced_completion(**kwargs): | |
| # Models known to support JSON-object response_format that litellm may not list yet. | ||
| _KNOWN_JSON_CAPABLE_MODELS = frozenset( | ||
| { | ||
| "gpt-4o-mini", | ||
| "gpt-4o", | ||
| "gpt-5.6-sol", | ||
| "gpt-5-mini", | ||
| "gpt-5.4-mini", | ||
| "gpt-5.4-nano", | ||
|
|
@@ -42,3 +42,15 @@ def supports_response_format(model: str) -> bool: | |
| return "response_format" in (get_supported_openai_params(model=model) or []) | ||
| except Exception: | ||
| return False | ||
|
|
||
|
|
||
| def supports_reasoning(model: str) -> bool: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use this in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 2b7509a. |
||
| """Return True if the given model is a reasoning model (accepts ``reasoning_effort``). | ||
|
|
||
| Reasoning models count hidden reasoning tokens against the completion budget, | ||
| so callers use this to set a low effort and leave room for the visible answer. | ||
| """ | ||
| try: | ||
| return bool(_litellm_supports_reasoning(model=model)) | ||
| except Exception: | ||
| return False | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,7 +220,7 @@ def test_fails_on_unexpected_llm_response(validator): | |
|
|
||
| def test_llm_callable_is_forwarded(): | ||
| v = AnswerRelevanceCustomLLM( | ||
| llm_callable="gpt-4o", | ||
| llm_callable="openai/gpt-5.6-sol", | ||
| input=QUERY, | ||
| output=ANSWER_RELEVANT, | ||
| ) | ||
|
|
@@ -231,4 +231,19 @@ def test_llm_callable_is_forwarded(): | |
| mock_llm.return_value = _make_llm_response("YES") | ||
| v._validate(ANSWER_RELEVANT) | ||
|
|
||
| assert mock_llm.call_args.kwargs["model"] == "gpt-4o" | ||
| assert mock_llm.call_args.kwargs["model"] == "openai/gpt-5.6-sol" | ||
|
|
||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Empty LLM reply | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
|
|
||
|
Comment on lines
+236
to
+241
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove these
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the budget and effort tests in 2b7509a, since they only restated the constants. I kept |
||
| def test_empty_content_returns_unexpected_response_fail(validator): | ||
| with patch( | ||
| "app.core.validators.answer_relevance_custom_llm.completion" | ||
| ) as mock_llm: | ||
| mock_llm.return_value = _make_llm_response(None) | ||
| result = validator._validate(ANSWER_RELEVANT) | ||
|
|
||
| assert isinstance(result, FailResult) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gpt-4o-mini is going to be deprecated in January 2027. So we could make this toggle now instead of doing it closer to the deprecation date.