Skip to content

Add DeepSeek V3.2 DSML format support with synthetic template#17

Merged
ochafik merged 1 commit intomainfrom
feat/deepseek-v3-dsml-support
Dec 20, 2025
Merged

Add DeepSeek V3.2 DSML format support with synthetic template#17
ochafik merged 1 commit intomainfrom
feat/deepseek-v3-dsml-support

Conversation

@ochafik
Copy link
Owner

@ochafik ochafik commented Dec 20, 2025

Summary

Implements support for DeepSeek V3.2's DSML (Domain Specific Markup Language) format, superseeds #11 (cc/ @hksdpc255)

DeepSeek V3.2 doesn't provide a Jinja template but uses a custom Python encoding with DSML format:

<|DSML|parameter name="key" string="true">value</|DSML|parameter>

Changes

  • Simplified argument needle detection: Changed from specific patterns ("argument_needle":, ="argument_needle") to broader "argument_needle" pattern which matches both JSON keys and DSML attribute values
  • Local .jinja file support: Fetch script now handles local .jinja files in MODEL_IDS (for synthetic test templates)
  • Synthetic template: Added synthetic-deepseek-v3.2-dsml.jinja replicating V3.2's Python encoding logic (from encoding_dsv32.py)
  • Integrated testing: Added synthetic template to MODEL_IDS, generates 3 test cases (simple, system, tool_use)

Test plan

  • All 248 tests pass
  • Capability detection correctly identifies DSML format (supports_tool_calls: true, requires_object_arguments: true)
  • Synthetic template tests pass for all contexts

Closes #11

🤖 Generated with Claude Code

DeepSeek V3.2 doesn't provide a Jinja template but uses a custom Python
encoding (encoding_dsv32.py) with DSML format for tool calls:
  <|DSML|parameter name="key" string="true">value</|DSML|parameter>

Changes:
- Simplify argument needle detection to use broader `"argument_needle"`
  pattern which matches both JSON keys and DSML attribute values
- Add support for local .jinja files in fetch script (for synthetic templates)
- Add synthetic-deepseek-v3.2-dsml.jinja replicating V3.2's Python encoding
- Add capability test for the synthetic template

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ochafik ochafik requested a review from CISC December 20, 2025 13:53
@ochafik ochafik marked this pull request as ready for review December 20, 2025 13:56
@ochafik ochafik removed the request for review from CISC December 20, 2025 14:06
@ochafik ochafik merged commit 1dc671b into main Dec 20, 2025
28 checks passed
@hksdpc255
Copy link
Collaborator

@ochafik I have already write a jinja template for deepseek v3.2 (with the help of claude, but not fully vibe coding), see: https://github.com/hksdpc255/llama.cpp/blob/c9315a3c739167e150202870fb5ff6093a4b7162/models/templates/DeepSeek-V3.2.jinja. I'm not sure if it is better than yours. Which one should we use?

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