Skip to content

feat: add qwen 3 32B, remove deprecated model, fix reasoning #446

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

Merged
merged 2 commits into from
Jul 22, 2025

Conversation

leonardmq
Copy link
Collaborator

@leonardmq leonardmq commented Jul 19, 2025

What does this PR do?

Also noticed a lot of the smaller Qwen3 models no longer have any active provider on OpenRouter.

Summary by CodeRabbit

  • New Features

    • Added support for a "none" thinking level in model provider options.
    • Introduced new model entries for the latest Qwen 32B models with distinct reasoning capabilities.
  • Bug Fixes

    • Ensured supported parameters like "reasoning_effort" are retained and not dropped during model completion requests.

Copy link
Contributor

coderabbitai bot commented Jul 19, 2025

Warning

Rate limit exceeded

@leonardmq has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 02c137d and 4d0d60d.

📒 Files selected for processing (3)
  • libs/core/kiln_ai/adapters/ml_model_list.py (3 hunks)
  • libs/core/kiln_ai/adapters/model_adapters/litellm_adapter.py (1 hunks)
  • libs/core/kiln_ai/adapters/model_adapters/test_litellm_adapter.py (2 hunks)

Walkthrough

The changes update the model provider configuration to support the new "none" thinking level, reorganize Groq provider entries for Qwen models, and explicitly allow the "reasoning_effort" parameter in LiteLLM adapter completion kwargs to prevent it from being dropped.

Changes

File(s) Change Summary
libs/core/kiln_ai/adapters/ml_model_list.py Extended thinking_level to include "none", removed Groq provider for old Qwen model, and added/updated entries for new Qwen models.
libs/core/kiln_ai/adapters/model_adapters/litellm_adapter.py Added allowed_openai_params (with "reasoning_effort") to completion kwargs to ensure LiteLLM does not drop this parameter.

Suggested reviewers

  • scosman

Poem

In the meadow of code where the models all play,
A new "none" thinking level hops in today.
Groq's Qwen models now line up just right,
While "reasoning_effort" keeps shining bright.
🐇 With tweaks and with care,
Our AI grows rare—
Hopping forward, ever light!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
libs/core/kiln_ai/adapters/model_adapters/litellm_adapter.py (1)

372-379: allowed_openai_params list is hard-coded and may silently discard caller-supplied values

allowed_openai_params is always overwritten with ["reasoning_effort"], so any value injected through LiteLlmConfig.additional_body_options disappears. This is harmless today but makes the adapter brittle and surprises integrators who try to extend the list.

-            # This overrides the drop_params setting above for specific parameters that we know should not be dropped
-            # but litellm drops because it is not aware that the model supports them.
-            "allowed_openai_params": ["reasoning_effort"],
+            # Preserve any caller-supplied entries while ensuring we always keep
+            # `reasoning_effort`.
+            "allowed_openai_params": list(
+                set(
+                    ["reasoning_effort"]
+                    + self._additional_body_options.get("allowed_openai_params", [])
+                )
+            ),

(If additional_body_options is guaranteed not to contain the key, feel free to ignore.)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f511b4 and 02c137d.

📒 Files selected for processing (2)
  • libs/core/kiln_ai/adapters/ml_model_list.py (3 hunks)
  • libs/core/kiln_ai/adapters/model_adapters/litellm_adapter.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: leonardmq
PR: Kiln-AI/Kiln#418
File: libs/core/kiln_ai/adapters/ml_model_list.py:0-0
Timestamp: 2025-07-16T09:37:39.792Z
Learning: The `glm_z1_rumination_32b_0414` model was intentionally removed from the built_in_models list due to output formatting issues: output was duplicated in both `output` and `reasoning` fields, and contained random internal JSON in the output. This model should not be re-added without addressing these formatting problems.
Learnt from: leonardmq
PR: Kiln-AI/Kiln#418
File: libs/core/kiln_ai/adapters/ml_model_list.py:0-0
Timestamp: 2025-07-16T09:37:39.792Z
Learning: The `glm_z1_rumination_32b_0414` model was intentionally removed from the built_in_models list due to output formatting issues: output was duplicated in both `output` and `reasoning` fields, and contained random internal JSON in the output. This model should not be re-added without addressing these formatting problems.
Learnt from: leonardmq
PR: Kiln-AI/Kiln#341
File: libs/server/kiln_server/document_api.py:44-51
Timestamp: 2025-06-18T08:22:58.510Z
Learning: leonardmq prefers to defer fixing blocking I/O in async handlers when: the operation is very fast (milliseconds), user-triggered rather than automated, has no concurrency concerns, and would require additional testing to fix properly. He acknowledges such issues as valid but makes pragmatic decisions about timing the fixes.
Learnt from: leonardmq
PR: Kiln-AI/Kiln#402
File: libs/core/kiln_ai/adapters/embedding/litellm_embedding_adapter.py:0-0
Timestamp: 2025-07-14T03:43:07.265Z
Learning: leonardmq prefers to keep defensive validation checks even when they're technically redundant, viewing them as useful "quick sanity checks" that provide additional safety nets. He values defensive programming over strict DRY (Don't Repeat Yourself) principles when the redundant code serves as a safeguard.
Learnt from: leonardmq
PR: Kiln-AI/Kiln#388
File: libs/core/kiln_ai/datamodel/test_extraction_chunk.py:49-74
Timestamp: 2025-07-03T05:13:02.873Z
Learning: leonardmq prefers automatic cleanup of temporary files in tests using `delete=True` in `tempfile.NamedTemporaryFile()` context managers, rather than manual cleanup with `delete=False` and explicit file removal. This is because automatic cleanup is simpler, safer, and avoids leaving temporary files if tests fail before cleanup.
Learnt from: leonardmq
PR: Kiln-AI/Kiln#0
File: :0-0
Timestamp: 2025-06-27T06:45:06.591Z
Learning: leonardmq prefers unused imports to be flagged as actionable review comments rather than nitpick comments. Unused imports should be treated as concrete issues that need to be addressed, not just suggestions.
libs/core/kiln_ai/adapters/ml_model_list.py (2)
Learnt from: leonardmq
PR: Kiln-AI/Kiln#418
File: libs/core/kiln_ai/adapters/ml_model_list.py:0-0
Timestamp: 2025-07-16T09:37:39.792Z
Learning: The `glm_z1_rumination_32b_0414` model was intentionally removed from the built_in_models list due to output formatting issues: output was duplicated in both `output` and `reasoning` fields, and contained random internal JSON in the output. This model should not be re-added without addressing these formatting problems.
Learnt from: leonardmq
PR: Kiln-AI/Kiln#418
File: libs/core/kiln_ai/adapters/ml_model_list.py:0-0
Timestamp: 2025-07-16T09:37:39.792Z
Learning: The `glm_z1_rumination_32b_0414` model was intentionally removed from the built_in_models list due to output formatting issues: output was duplicated in both `output` and `reasoning` fields, and contained random internal JSON in the output. This model should not be re-added without addressing these formatting problems.
🧬 Code Graph Analysis (1)
libs/core/kiln_ai/adapters/ml_model_list.py (2)
libs/core/kiln_ai/datamodel/datamodel_enums.py (2)
  • ModelProviderName (80-99)
  • StructuredOutputMode (23-45)
libs/core/kiln_ai/adapters/parsers/test_r1_parser.py (1)
  • parser (8-9)
🔇 Additional comments (3)
libs/core/kiln_ai/adapters/ml_model_list.py (3)

201-201: LGTM! Thinking level extension aligns with PR objectives.

The addition of "none" to the thinking_level options correctly implements support for disabling thinking on Qwen3 models as mentioned in the PR description, aligning with Groq's reasoning options.


2398-2405: LGTM! Groq provider configuration for Qwen 3 32B is well-structured.

The new Groq provider configuration correctly implements support for the Qwen/Qwen3-32B model with appropriate settings for reasoning capabilities, including the r1_thinking parser and json_instructions structured output mode.


2429-2435: LGTM! Non-thinking Groq provider configuration properly implements thinking disabling.

The configuration correctly uses the new thinking_level="none" option and appropriately differs from the thinking variant by using json_schema structured output mode and omitting the parser and reasoning capabilities.

@scosman scosman merged commit 4d5c494 into main Jul 22, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants