आप max_tokens: 100 के साथ एक छोटा प्रॉम्प्ट भेजते हैं, अनुरोध सफल होता है, और choices[0].message.content ख़ाली है। कुछ टूटा नहीं है: जवाब कभी शुरू ही नहीं हुआ।
होता क्या है
रीज़निंग मॉडल दिखने वाले जवाब से पहले एक छिपी हुई सोच (chain of thought) लिखते हैं। दोनों एक ही max_tokens बजट बाँटते हैं। सीमा छोटी हो, तो रीज़निंग पूरा बजट खा जाती है, और स्टैंडर्ड chat-completions ढाँचे में तब finish_reason की वैल्यू length होती है।
तीन समाधान
1. जगह छोड़ें। BroadNet के डॉक्स की सलाह के अनुसार max_tokens को 1,000 या उससे ज़्यादा रखें। रीज़निंग मॉडल के लिए max_tokens कैलकुलेटर आपके जवाब की लंबाई के हिसाब से सीमा तय करता है और लागत दिखाता है।
2. कम रीज़निंग करवाएँ। आसान कामों के लिए reasoning_effort को low पर सेट करें:
import os
from openai import OpenAI
client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])
response = client.chat.completions.create(
model="broadnet/deepseek-v4.1-flash",
reasoning_effort="low",
max_tokens=1000,
messages=[{"role": "user", "content": "Classify: 'refund my order' -> intent?"}],
)
3. usage पर नज़र रखें। जब मॉडल इसे रिपोर्ट करता है, तो usage.completion_tokens_details.reasoning_tokens बताता है कि कितना रीज़निंग में गया:
print(response.choices[0].finish_reason) # "length" means the budget ran out
details = response.usage.completion_tokens_details # None if the model doesn't report it
print(details.reasoning_tokens if details else "not reported")
स्ट्रीम में stream_options={"include_usage": True} जोड़ें, वही usage आख़िरी chunk में आता है। स्ट्रीमिंग chat completions देखें।
कौन-से मॉडल रीज़निंग करते हैं
| मॉडल | पहले रीज़निंग करता है |
|---|---|
DeepSeek V4.1 Flash (broadnet/deepseek-v4.1-flash) |
हाँ |
GLM 5.3 (broadnet/glm-5.3) |
हाँ |
Qwen3.8 27B (broadnet/qwen3.8-27b) |
हाँ |
BroadNet Gemma 4 VL 26B (broadnet/gemma-4-26b-a4b) |
सूचीबद्ध नहीं |
समस्या का समाधान
contentख़ाली,finish_reasonहैlength.max_tokensबढ़ाएँ याreasoning_effortकोlowपर सेट करें।contentख़ाली,finish_reasonहैstop. वजह सीमा नहीं थी। अपना प्रॉम्प्ट जाँचें और पूरा जवाब प्रिंट करके देखें कि क्या लौटा।completion_tokens_detailsपरAttributeError. मॉडल ने उस अनुरोध के लिए ब्रेकडाउन रिपोर्ट नहीं किया; ऊपर के उदाहरण की तरहNoneकी जाँच रखें।- स्ट्रीम में पहला टोकन देर से आता है। मॉडल जवाब लिखने से पहले रीज़निंग कर रहा है। कम
reasoning_effortसे इंतज़ार घट सकता है।
अगर आप दिन भर एजेंट चलाते हैं, तो उपयोग के अनुसार भुगतान में रीज़निंग टोकन जुड़ते जाते हैं। BroadNet प्राइसिंग कैलकुलेटर दिखाता है कि कब एक फ़्लैट अनलिमिटेड प्लान सस्ता पड़ता है।
