kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

Feat/deepseek v3.1 thinking support

Open shameez-struggles-to-commit opened this issue 3 months ago • 1 comments

🎯 Problem

DeepSeek V3.1 models from Chutes.ai were using incorrect chat templates, preventing thinking mode from working properly. The models were being treated as standard OpenAI models instead of using the specialized DeepSeek V3.1 format.

🔧 Solution

  • Created specialized chat template for DeepSeek V3.1 models with proper <|begin▁of▁sentence|>, <|User|>, <|Assistant|> format
  • Enhanced Chutes.ai provider to detect and route V3.1 models to the correct template
  • Updated OpenAI provider with V3.1 model detection logic
  • Added model configurations for deepseek-v3.1 and deepseek-v3.1-reasoner with proper pricing

📁 Files Changed

  • src/api/transform/deepseek-v3.1-format.ts - New chat template converter
  • src/api/providers/chutes.ts - Enhanced with V3.1 support
  • src/api/providers/openai.ts - Added V3.1 detection logic
  • packages/types/src/providers/deepseek.ts - Added V3.1 model configs

✅ Testing

  • ✅ Build completed successfully (51.404s, no errors)
  • ✅ All lint and type checks passed
  • ✅ Template verified to produce correct format with <think> tags
  • ✅ Thinking mode now works properly with V3.1 models

🚀 Impact

Fixes thinking mode for DeepSeek V3.1 models from Chutes.ai, enabling proper reasoning capabilities that were previously broken due to incorrect chat templates.

⚠️ No Changeset found

Latest commit: 83415ba4f7151c1f6c215ff435538dd23451ca64

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Sep 02 '25 21:09 changeset-bot[bot]

any update?

Ve-Jo avatar Sep 12 '25 15:09 Ve-Jo