Rules for building an intelligent router that selects the optimal DeepSeek model (V3, R1, Coder) based on task type, complexity, and cost constraints.
## DeepSeek Multi-Model Router Configuration ### Model Selection Matrix | Task Type | Primary Model | Fallback | Notes | |-----------|--------------|----------|-------| | Simple Q&A | deepseek-chat (V3) | — | Fastest, cheapest | | Code generation | deepseek-chat (V3) | claude-coder | V3 handles most coding well | | Code review | deepseek-chat (V3) | deepseek-reasoner | Use R1 for security audits | | Math/Logic | deepseek-reasoner (R1) | — | Always use R1 for math | | Debugging | deepseek-reasoner (R1) | deepseek-chat | R1 excels at root cause analysis | | Architecture | deepseek-reasoner (R1) | deepseek-chat | Complex tradeoff analysis | | Creative writing | deepseek-chat (V3) | — | R1 is overly analytical | | Data analysis | deepseek-chat (V3) | deepseek-reasoner | Use R1 for complex statistical reasoning | | Translation | deepseek-chat (V3) | — | V3 handles 100+ languages | ### Routing Rules 1. Classify the task using keyword detection and intent analysis 2. Check complexity: if tokens > 2000 or nested sub-problems > 3, escalate to R1 3. Apply cost constraints: if budget remaining < 20%, prefer V3 4. Implement fallback: if primary model returns low-confidence response, retry with fallback ### Configuration - V3 temperature: 0.7 (general), 0.3 (code), 0.9 (creative) - R1 temperature: 0.6 (always) - Max tokens: V3=4096, R1=8192 - Timeout: V3=30s, R1=120s ### Monitoring Track model selection distribution, accuracy per model per task type, and cost per task type to continuously refine routing rules.
System rules for designing inter-service communication in microservices architectures with DeepSeek Coder, covering sync/async patterns, error handling, and resilience.
System rules for generating content in multiple languages with DeepSeek V3, covering translation quality, cultural adaptation, locale-specific formatting, and quality assurance.
System rules for safe code refactoring with DeepSeek R1, requiring test coverage verification, incremental changes, and behavior preservation checks.
System rules for using DeepSeek V3 to generate clear, maintainable technical documentation including API docs, architecture docs, and onboarding guides.
System rules for DeepSeek Coder to generate optimized database queries, with requirements for EXPLAIN analysis, indexing recommendations, and performance targets.
System rules for using DeepSeek V3 to generate infrastructure code, CI/CD pipelines, and operational runbooks with security and reliability best practices.