feat(models): add kimi-k2-instruct via groq provider - #643
Conversation
Co-authored-by: contact <contact@polarlights.llc>
|
Cursor Agent can help with this pull request. Just |
WalkthroughAdded 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
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 unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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.
📒 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 usedb().query.<table>.findMany()ordb().query.<table>.findFirst()
Files:
packages/models/src/models/moonshot.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use
as anyor: anyin 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: 131072withmaxOutput: 16384is plausible, but other providers list much highermaxOutput. 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 verbatimOur code passes
modelNamestrings 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:13modelName: "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 thetoolsparameter is supported for this model (console.groq.com). Additionally, Groq’s OpenAI-compatible API fully supports embeddingtoolsandtool_choicein 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” underpackages/orapps/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, removecachedInputPriceto avoid misleading pricing.
• Otherwise, ensure the adapter’s request logic checks for cache availability (e.g., via aCache-Controlheader) before settingcachedInputPrice.
Add
moonshotai/kimi-k2-instructmodel via Groq provider to expand available options for the kimi-k2 model.Summary by CodeRabbit