Repository navigation
feat(llm): switch default LLM to gpt-6-luna - #196
Conversation
- DEFAULT_LLM_CALLABLE / ANSWER_RELEVANCE_LLM_MODEL -> gpt-6-luna; add it to _KNOWN_JSON_CAPABLE_MODELS (gpt-5.6-sol kept for stored configs). - traced_completion: send max_completion_tokens instead of max_tokens and pass allowed_openai_params for reasoning_effort. litellm 1.81/1.82 (capped by guardrails-ai) doesn't map the gpt-6 family, so OpenAI rejected max_tokens and litellm dropped reasoning_effort. - answer_relevance_custom_llm: max_tokens 512 -> 1024 (gpt-6-luna peaked at 428). topic_relevance_llm stays at 1024 (peak 496). - Re-ran topic-relevance and answer-relevance evals; updated README/docs tables and all gpt-5.6-sol references. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
| OPENAI_API_KEY: str | None = None | ||
| ANSWER_RELEVANCE_LLM_MODEL: str = "gpt-5.6-sol" | ||
| DEFAULT_LLM_CALLABLE: str = "gpt-5.6-sol" | ||
| ANSWER_RELEVANCE_LLM_MODEL: str = "gpt-6-luna" |
There was a problem hiding this comment.
🔴 Users of answer_relevance with default settings will see far more correct answers rejected, because the default judge now false-rejects 18–19 of 50 correct answers instead of 11. The cause is ANSWER_RELEVANCE_LLM_MODEL switching to gpt-6-luna at config.py:40. The PR's own November eval shows accuracy dropping from 0.89 to 0.81–0.82. Fix: keep ANSWER_RELEVANCE_LLM_MODEL on gpt-5.6-sol until the default prompt is tuned for gpt-6-luna. That setting is separate from DEFAULT_LLM_CALLABLE, so topic relevance can still move.
Why this was flagged
AnswerRelevanceCustomLLMSafetyValidatorConfig.llm_callable defaults to settings.ANSWER_RELEVANCE_LLM_MODEL (answer_relevance_custom_llm_safety_validator_config.py:14), and so does AnswerRelevanceCustomLLM.__init__ (answer_relevance_custom_llm.py:48). So every guardrail request that uses answer_relevance without an explicit llm_callable now goes to gpt-6-luna. Per the updated README (backend/app/core/validators/README.md, answer relevance notes), gpt-6-luna rejected 18–19 of 50 correct answers, against 11 for gpt-5.6-sol. That means about 36–38% of good answers fail the check instead of 22%, and nothing is gained because no model passed a wrong answer. The README also shows the slowest 5% of calls at 4.7–7.8s. The PR description calls the extra false rejects a known heads-up. In fact they hit every default-config tenant on every call, and the two settings are already separate, so the cost is avoidable.
Verification: Trigger: any answer_relevance guardrail request that doesn't set llm_callable explicitly. config.py:40 now reads ANSWER_RELEVANCE_LLM_MODEL: str = "gpt-6-luna" (it was "gpt-5.6-sol"). So every default request now goes to gpt-6-luna. With unchanged prompts, correct answers are rejected about 1.7x as often as on the base branch, and the PR makes no prompt change to offset it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code review found no new issues
No new issues were found in this update; 1 finding from earlier reviews is still open above.
Still open from earlier reviews (1):
- 🔴
backend/app/core/config.py:40—Users of answer_relevance with default settings will see far more correct answers rejected, because the default judge n…
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
- Drop ANSWER_RELEVANCE_LLM_MODEL; answer relevance uses DEFAULT_LLM_CALLABLE like the other LLM validators. Document it in .env.example and the developer guide's env var table. - Remove gpt-6-luna from _KNOWN_JSON_CAPABLE_MODELS (litellm already reports response_format support for it). - Drop model names and eval dates from code comments so model switches don't need to touch them. - Docs: point llm_callable defaults at DEFAULT_LLM_CALLABLE, drop optional llm_callable lines that only restated the default (kept for llm_critic, where it's required), remove "use the default model" advice, and shorten the eval write-ups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep this PR to the gpt-5.6-sol -> gpt-6-luna switch. List both DEFAULT_LLM_CALLABLE and ANSWER_RELEVANCE_LLM_MODEL in the .env examples so the models can be changed from the environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code review found no new issues
No new issues were found in this update; 1 finding from earlier reviews is still open above.
Still open from earlier reviews (1):
- Unresolved: 1 blocking on lines changed since (possibly already fixed).
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code review found no new issues
No new issues were found in this update; 1 finding from earlier reviews is still open above.
1 optional suggestion (a nit or a note on pre-existing code) was found and not posted.
Still open from earlier reviews (1):
- Unresolved: 1 blocking on lines changed since (possibly already fixed).
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
This review covers commit a586c00, which is no longer the latest commit on this pull request; later commits are not covered by it.
There was a problem hiding this comment.
Code review found no new issues
No new issues were found in this update; 1 finding from earlier reviews is still open above.
Still open from earlier reviews (1):
- Unresolved: 1 blocking on lines changed since (possibly already fixed).
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
Summary
Closes #189
Glific moves to the 6-series on 1 Dec and kaapi-backend already defaults to
gpt-6-luna. This aligns guardrails.DEFAULT_LLM_CALLABLEandANSWER_RELEVANCE_LLM_MODEL→gpt-6-luna. Both can be set as env vars and are now listed in.env.example/.env.test.example. Addedgpt-6-lunato_KNOWN_JSON_CAPABLE_MODELS;gpt-5.6-solstays in the list.max_tokens("usemax_completion_tokens") and LiteLLM droppedreasoning_effortas unsupported.traced_completion, which all three LLM validators use, now sendsmax_completion_tokensand passesallowed_openai_params=["reasoning_effort"]. Verified live againstgpt-6-luna,gpt-5.6-solandgpt-4o-mini.gpt-6-lunapeaked at 428) and topic relevance at 1024 (peak 496).Eval results (November 2026, same rows for every model)
Topic relevance (100 rows, 32 out of scope, schema v2, threshold 2):
gpt-6-lunascored 0.88–0.90 accuracy and 0.79–0.83 F1, close togpt-5.6-sol(0.90 / 0.82). It's about 1.4x slower.Answer relevance (100 pairs):
gpt-6-lunascored 0.81–0.82 accuracy against 0.89 forgpt-5.6-sol. It's stricter: it rejected 18–19 of 50 correct answers, against 11 forgpt-5.6-sol. No model passed a wrong answer. The October pairs weren't committed, so this is a new, reproducible set built from the topic-relevance datasets. Its correct answers were written bygpt-4o-mini.Heads-up
validator_configrows with an explicitllm_callable: gpt-5.6-solwon't follow the new default. They need updating separately if they should move.gpt-6-luna's stricter answer-relevance judging may raise false rejects for answer_relevance users who use the default prompt.Test plan
pytest app/tests: 371 passed, 14 skipped, including the livegpt-6-lunatopic-relevance teststraced_completionparameter mapping🤖 Generated with Claude Code