reasoning के लिए DeepSeek R1
DeepSeek R1 एक open-source reasoning मॉडल है जिसे RL के साथ train किया गया है ताकि यह explicit chain-of-thought निकाले। यह AIME और MATH benchmarks पर OpenAI o1 के साथ प्रतिस्पर्धी है, जबकि लागत लगभग 30x कम है: QuickSilver Pro पर $0.56 input / $2.00 output प्रति 1M tokens बनाम o1 का $15 / $60। math, code challenges, और logic-heavy agent loops के लिए R1 open-source default है।
R1 किन कामों में अच्छा है
Math: AIME-2024, MATH-500 और Olympiad-level problems पर मजबूत। reasoning trace derivations को step-by-step दिखाता है; final answer content में आता है.
Algorithms: competitive-programming grade code generation। LiveCodeBench और Codeforces पर इसके scores o1 के करीब हैं। novel algorithm tasks में V3 से बेहतर, लेकिन CoT की वजह से धीमा.
Multi-step planning: उन agent loops में उपयोगी जहाँ planner को act करने से पहले समस्या तोड़नी होती है। हर planning call में explicit reasoning होने से tool-use decisions बेहतर हो सकते हैं.
कब R1 अतिरिक्त tokens के लायक है
R1 का उपयोग math word problems, novel algorithm design, logic puzzles, theorem proving, multi-step tool planning, और hard debugging के लिए करें। यानी वहाँ, जहाँ answer quality reasoning process पर निर्भर करती है.
R1 को factual Q&A, code completion, summarization, entity extraction, simple classification और translation में न लें। इन non-reasoning tasks में V3 सस्ता, तेज और आम तौर पर पर्याप्त है.
Cost calibration: 2000-word essay के लिए V3 लगभग 600 output tokens ले सकता है ($0.37/1000 essays), जबकि R1 उसी task पर reasoning trace सहित लगभग 2500 output tokens ले सकता है ($5.00/1000 essays)। यह 13x premium है — केवल तब दें जब इससे वास्तविक लाभ मिले।
क्विकस्टार्ट कोड
from openai import OpenAI
client = OpenAI(
base_url="https://api.quicksilverpro.io/v1",
api_key="sk-qsp-...",
)
resp = client.chat.completions.create(
model="deepseek-r1",
messages=[{
"role": "user",
"content": "A box has 12 red and 8 blue balls. Three drawn without replacement. Probability exactly two are red?",
}],
)
# Chain-of-thought reasoning:
print(resp.choices[0].message.reasoning_content)
# Final answer:
print(resp.choices[0].message.content)
print(f"Output tokens: {resp.usage.completion_tokens}")
print(f"Cost: ${resp.usage.cost:.6f}")FAQ
पब्लिश्ड math (AIME-2024, MATH-500), coding (LiveCodeBench, Codeforces), और reasoning (GPQA Diamond) benchmarks पर DeepSeek R1 आम तौर पर o1 से कुछ ही points पीछे या बराबर होता है, और अधिकतर मामलों में o1-mini से आगे निकलता है। 30x कम लागत पर यह production के लिए सबसे नज़दीकी open-source equivalent है।
सामान्य range 500-3000 tokens है। कठिन समस्याओं (जैसे IMO-स्तर math) में trace 5000 tokens से ऊपर जा सकती है। सभी reasoning tokens output tokens की तरह bill होते हैं, इसलिए लागत अनुमान में इन्हें ज़रूर शामिल करें।
R1 OpenAI tools array स्वीकार करता है, लेकिन tool calling में यह V3 जितना reliable नहीं है। agent loops के लिए बेहतर pattern यह है कि V3 को tool-calling executor रखें और कठिन planning sub-problems पर ही R1 बुलाएँ।
हाँ। आप server-side पर reasoning_content को ignore करके केवल content लौटा सकते हैं। लेकिन लागत वही रहेगी, क्योंकि answer तक पहुँचने के लिए R1 को reasoning tokens फिर भी जनरेट करने पड़ते हैं; यहाँ कोई सस्ता 'skip thinking' mode नहीं है।