Skip to content

feat(models): add kimi-k2-instruct via groq provider - #643

Merged
steebchen merged 3 commits into
mainfrom
cursor/add-kimi-k2-instruct-via-groq-provider-dad3
Aug 26, 2025
Merged

steebchen merged 3 commits into
mainfrom
cursor/add-kimi-k2-instruct-via-groq-provider-dad3

Conversation

@steebchen

@steebchen steebchen commented Aug 26, 2025

Copy link
Copy Markdown
Member

Add moonshotai/kimi-k2-instruct model via Groq provider to expand available options for the kimi-k2 model.


Open in Cursor Open in Web

Summary by CodeRabbit

  • New Features
    • Added a new provider option for the Kimi K2 model, expanding availability and choice.
    • Supports streaming responses and tool usage (no vision support).
    • Offers a large context window (up to ~131k tokens) and higher maximum output (up to ~16k tokens).
    • Updated pricing metadata for clearer cost handling, including differentiated cached input pricing.
    • No other user-facing changes.

Co-authored-by: contact <contact@polarlights.llc>
@cursor

cursor Bot commented Aug 26, 2025

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai

coderabbitai Bot commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Added a new "groq" provider entry for the Kimi K2 model in moonshot models, specifying model name, pricing, limits, and capabilities. No other files or logic changed.

Changes

Cohort / File(s) Summary of Changes
Model provider addition
packages/models/src/models/moonshot.ts
Appended a provider to kimi-k2: providerId "groq", modelName "moonshotai/kimi-k2-instruct", pricing (input 1.0/1e6, cached 0.5/1e6, output 3.0/1e6, request 0), limits (contextSize 131072, maxOutput 16384), flags (streaming true, vision false, tools true).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/add-kimi-k2-instruct-via-groq-provider-dad3

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@steebchen steebchen changed the title Add kimi-k2-instruct via groq provider feat(models): add kimi-k2-instruct via groq provider Aug 26, 2025
@steebchen
steebchen marked this pull request as ready for review August 26, 2025 15:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
packages/models/src/models/moonshot.ts (1)

11-23: Optional: mark provider as skipped in tests if CI lacks GROQ_API_KEY.

If your test suite does live calls and CI doesn’t provide Groq credentials, mirror the pattern used for CloudRift by skipping tests to keep pipelines green.

Apply if relevant:

 				tools: true,
+				test: "skip",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 69d8d03 and aadc104.

📒 Files selected for processing (1)
  • packages/models/src/models/moonshot.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use localStorage instead of cookies for client-side data persistence

Files:

  • packages/models/src/models/moonshot.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{js,ts}: Use drizzle with the latest object syntax for database operations
For read queries, always use db().query.<table>.findMany() or db().query.<table>.findFirst()

Files:

  • packages/models/src/models/moonshot.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Never use as any or : any in TypeScript files.

Files:

  • packages/models/src/models/moonshot.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: e2e / run
  • GitHub Check: build / run
🔇 Additional comments (5)
packages/models/src/models/moonshot.ts (5)

11-23: LGTM: groq provider entry is consistent with existing model definitions.

Field names, numeric units (per 1e6 tokens), and capability flags match the style used by other providers in this file. No type-safety issues with as const satisfies ModelDefinition[].


18-19: Confirm maxOutput and contextSize limits for Groq’s Kimi K2.

contextSize: 131072 with maxOutput: 16384 is plausible, but other providers list much higher maxOutput. Ensure 16,384 is the actual Groq ceiling to prevent avoidable 400s from the provider or unnecessary truncation.

If needed, I can mirror other providers’ maxOutput, but only after confirmation. Would you like me to adjust once verified?


13-13: Confirm Groq model identifier verbatim

Our code passes modelName strings straight through—there’s no allowlist or normalization logic in the Groq provider implementation—so the exact casing and spelling must match Groq’s API. Please:

  • Cross-check “moonshotai/kimi-k2-instruct” against Groq’s official model registry or documentation.
  • Verify by making a quick test request or consulting the Groq SDK/API reference to ensure this identifier is accepted.

Location to verify:

  • packages/models/src/models/moonshot.ts:13
    modelName: "moonshotai/kimi-k2-instruct",

22-22: No changes needed for tool support on Kimi K2 model.
Moonshot AI’s Kimi K2 Instruct (moonshotai/kimi-k2-instruct) explicitly lists Tool Use among its capabilities in Groq’s documentation, confirming that function-calling via the tools parameter is supported for this model (console.groq.com). Additionally, Groq’s OpenAI-compatible API fully supports embedding tools and tool_choice in chat completion requests (console.groq.com).


15-15: Unable to locate Groq adapter—please verify caching support
I wasn’t able to find any Groq-specific adapter or cache-control logic in the repo (no directories or files matching “groq” or “adapter” under packages/ or apps/gateway/src/). Without that, it’s unclear whether Groq actually supports prompt caching for this model.

• If Groq doesn’t support caching on kimi-k2-instruct, remove cachedInputPrice to avoid misleading pricing.
• Otherwise, ensure the adapter’s request logic checks for cache availability (e.g., via a Cache-Control header) before setting cachedInputPrice.

@steebchen
steebchen added this pull request to the merge queue Aug 26, 2025
Merged via the queue into main with commit 2451011 Aug 26, 2025
12 checks passed
@steebchen
steebchen deleted the cursor/add-kimi-k2-instruct-via-groq-provider-dad3 branch August 26, 2025 19:01
@coderabbitai coderabbitai Bot mentioned this pull request Mar 22, 2026
4 tasks
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