Reasoning effort
အသစ်reasoning လုပ်သော model သည် ၎င်း၏ reasoning စာသားကို အဖြေဘေးတွင် ကိုယ်ပိုင် field တစ်ခုဖြင့် ပြန်ပေးသည်။ Host လုပ်ထားသော open-weight models များတွင် request field တစ်ခုက model သည် မဖြေမီ reasoning မည်မျှနက်ရှိုင်းစွာ လုပ်မည်ကို သတ်မှတ်သည်။
POST https://api.shannon-ai.com/v1/chat/completions
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.shannon-ai.com/v1")
response = client.chat.completions.create(
model="Kimi-K3-3BIT-REAP",
reasoning_effort="low",
messages=[{"role": "user", "content": "Is 221 a prime number?"}],
)
message = response.choices[0].message
print("Reasoning:", getattr(message, "reasoning_content", None))
print("Answer:", message.content)
print("Reasoning tokens:", response.usage.completion_tokens_details.reasoning_tokens) import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.shannon-ai.com/v1" });
const response = await client.chat.completions.create({
model: "Kimi-K3-3BIT-REAP",
reasoning_effort: "low",
messages: [{ role: "user", content: "Is 221 a prime number?" }],
});
const message = response.choices[0].message;
console.log("Reasoning:", message.reasoning_content);
console.log("Answer:", message.content);
console.log("Reasoning tokens:", response.usage.completion_tokens_details.reasoning_tokens); curl https://api.shannon-ai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Kimi-K3-3BIT-REAP",
"reasoning_effort": "low",
"messages": [
{"role": "user", "content": "Is 221 a prime number?"}
]
}' ပြန်ကြားချက်တွင် reasoning စာသားကို reasoning_content တွင်၊ အဖြေကို content တွင်၊ reasoning tokens များကို usage တွင် ပါသည်-
{
"id": "chatcmpl-2a6c8e0b4d1f4a3c9e7b5d3f1a8c6e4b",
"object": "chat.completion",
"created": 1791590400,
"model": "Kimi-K3-3BIT-REAP",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "No. 221 = 13 x 17, so it is not prime.",
"reasoning_content": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 43,
"total_tokens": 57,
"prompt_tokens_details": {"cached_tokens": 0},
"completion_tokens_details": {"reasoning_tokens": 27}
}
} ဘယ် model များက reasoning လုပ်သည်
| Model | reasoning စာသား ပြန်ပေးသည် | effort field ကို အသုံးပြုသည် |
|---|---|---|
shannon-1.6-lite | — | — |
shannon-1.6-pro, shannon-2-lite, shannon-2-pro, shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro, shannon-coder-1 | ဟုတ်သည် | — |
| Host လုပ်ထားသော open-weight မော်ဒယ်တိုင်း | ဟုတ်သည် | ဟုတ်သည် |
ဤအရာများသည် GET /v1/models က id တစ်ခုစီအတွက် ဖော်ပြသော capabilities.reasoning နှင့် capabilities.reasoning_effort အလံများ ဖြစ်သည်။ model က reasoning စာသား ထုတ်ပေးမှသာ ပြန်ကြားချက်တွင် ပါသည်။ Model များနှင့် ဈေးနှုန်း
Effort ကို သတ်မှတ်ခြင်း
Endpoint တစ်ခုစီတွင် effort ကို ရေးသားပုံ ကိုယ်ပိုင်ရှိသည်။ ၎င်းတို့အားလုံးသည် တူညီသော အဆင့်လေးခုထဲမှ တစ်ခုကို ရွေးသည်။
| Field | Type | Default | ဖော်ပြချက် | အသုံးပြုသော model |
|---|---|---|---|---|
reasoning_effort | string | high | /v1/chat/completions။ model သည် မဖြေမီ reasoning မည်မျှ နက်နက်ရှိုင်းရှိုင်း လုပ်သည်- off၊ low၊ medium သို့မဟုတ် high။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
reasoning | object | string | /v1/chat/completions။ {"effort": "low"} သို့မဟုတ် သာမန် string အဖြစ် တူညီသောတန်ဖိုး။ field နှစ်ခုလုံး ပို့ပါက reasoning_effort ကို ယူသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ | |
reasoning.effort | string | high | /v1/responses။ object {"effort": "low"} အဖြစ် ရေးသည်။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
thinking | object | /v1/messages။ {"type": "enabled", "budget_tokens": n} သို့မဟုတ် {"type": "disabled"}။ budget သည် အဆင့်များထဲမှ တစ်ခုကို ရွေးသည်၊ အောက်ပိုင်းရှိ ဇယားကို ကြည့်ပါ။ | Host လုပ်ထားသော open-weight မော်ဒယ်များ |
{
"model": "Kimi-K3-3BIT-REAP",
"reasoning_effort": "low",
"messages": [{"role": "user", "content": "Is 221 a prime number?"}]
} {
"model": "Kimi-K3-3BIT-REAP",
"reasoning": {"effort": "low"},
"input": "Is 221 a prime number?"
} {
"model": "Kimi-K3-3BIT-REAP",
"max_tokens": 1024,
"thinking": {"type": "enabled", "budget_tokens": 2048},
"messages": [{"role": "user", "content": "Is 221 a prime number?"}]
} | တန်ဖိုး | လက်ခံသည့် အခြားတန်ဖိုး | အကျိုးသက်ရောက်မှု |
|---|---|---|
off | none, minimal | reasoning မရှိ။ ပြန်ကြားချက်တွင် reasoning စာသား မပါပါ။ |
low | reasoning အတိုချုပ်။ | |
medium | default | အလယ်အလတ် အနက်။ |
high | max | အနက်ဆုံးအဆင့်။ တန်ဖိုးမပို့သော request ၏ အဆင့်ဖြစ်သည်။ |
- တန်ဖိုးများကို စာလုံးအကြီးအသေး မခွဲခြားဘဲ ဖတ်သည်။
- တန်ဖိုး
defaultသည်mediumဟု ဆိုလိုသည်။ field ကို မထည့်လျှင်highဟု ဆိုလိုသည်။ - Shannon models (
shannon-*) သည် request တိုင်းတွင် ကိုယ်ပိုင်အနက်ကို သတ်မှတ်သည်၊GET /v1/modelsသည် ၎င်းတို့အတွက်reasoning_effort: falseကို ဖော်ပြသည်။
/v1/messages တွင် thinking အတွက် သတ်မှတ်ထားသော ပမာဏ (budget)
/v1/messages တွင် thinking field က အဆင့်ကို ရွေးသည်။ budget_tokens သည် အထက်ပါအဆင့်များထဲမှ တစ်ခုကို ရွေးပေးသည်၊ ၎င်းသည် ကိုယ်ပိုင် token ကန့်သတ်ချက် မဟုတ်ပါ။ adaptive ကို enabled ကဲ့သို့ ဖတ်သည်။
| သင်ပို့သည့်အရာ | အဆင့် |
|---|---|
{"type": "disabled"} | off |
n သည် 2,048 အထိ ဖြစ်သော {"type": "enabled", "budget_tokens": n} | low |
n သည် 2,049 မှ 8,192 အထိ | medium |
ပိုကြီးသော n၊ သို့မဟုတ် budget_tokens မပါသော enabled | high |
thinking field မပါ | high |
reasoning စာသား ရောက်လာသည့်နေရာ
reasoning စာသားသည် အဖြေနှင့် အမြဲ သီးခြားဖြစ်သည်။ format တစ်ခုစီတွင် ၎င်းအတွက် ကိုယ်ပိုင်နေရာရှိသည်-
| Endpoint | Stream မလုပ်သော | Stream လုပ်သော |
|---|---|---|
/v1/chat/completions | choices[0].message.reasoning_content- string တစ်ခု၊ model က ဘာမျှမထုတ်လျှင် null။ | delta.content ပါသော chunk များမတိုင်မီ choices[0].delta.reasoning_content ပါသော chunk များ။ |
/v1/responses | message item မတိုင်မီ output item {"type": "reasoning", "summary": [{"type": "summary_text", "text": "…"}]}။ reasoning မရှိလျှင် item မပါပါ။ | reasoning item ပါသော response.output_item.added၊ ထို့နောက် response.reasoning_summary_text.delta events များနှင့် response.reasoning_summary_text.done တစ်ခု။ |
/v1/messages | ပထမ content block {"type": "thinking", "thinking": "…"} ဖြစ်ပြီး ထို့နောက် text block လိုက်သည်။ reasoning မရှိလျှင် thinking block မပါပါ။ | thinking content block တစ်ခုဖြစ်ပြီး content_block_start၊ thinking_delta ပါသော content_block_delta events နှင့် content_block_stop တို့ ဖြစ်သည်။ ထို့နောက် text block လိုက်သည်။ |
{
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "No. 221 = 13 x 17, so it is not prime.",
"reasoning_content": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 43,
"total_tokens": 57,
"prompt_tokens_details": {"cached_tokens": 0},
"completion_tokens_details": {"reasoning_tokens": 27}
}
} {
"output": [
{
"id": "rs_6f0a2c4e8b1d4f3a9c7e5b3d1f8a6c4e",
"type": "reasoning",
"summary": [
{
"type": "summary_text",
"text": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
}
]
},
{
"id": "msg_1b3d5f7a9c2e4b6d8f0a2c4e6b8d0f1a",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "No. 221 = 13 x 17, so it is not prime.",
"annotations": []
}
]
}
],
"usage": {
"input_tokens": 14,
"input_tokens_details": {"cached_tokens": 0},
"output_tokens": 43,
"output_tokens_details": {"reasoning_tokens": 27},
"total_tokens": 57
}
} {
"content": [
{
"type": "thinking",
"thinking": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
},
{"type": "text", "text": "No. 221 = 13 x 17, so it is not prime."}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 14,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 43
}
} model အလိုက် ကြည့်ရမည့်နေရာ-
| Models | စာသား ရောက်လာသည့်နေရာ |
|---|---|
| Host လုပ်ထားသော open-weight မော်ဒယ်များ | Endpoint တိုင်းတွင်၊ stream လုပ်သည်ဖြစ်စေ မလုပ်သည်ဖြစ်စေ။ effort off ပါသော request သို့မဟုတ် response_format / text.format ပါသော request ကို reasoning စာသားမပါဘဲ ဖြေသည်။ |
shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro | model က reasoning စာသား ထုတ်ပေးသည့်အခါတိုင်း endpoint တိုင်းတွင်၊ stream လုပ်သည်ဖြစ်စေ မလုပ်သည်ဖြစ်စေ။ |
shannon-2-lite, shannon-2-pro | /v1/chat/completions၊ stream မလုပ်လျှင်- message.reasoning_content ထဲတွင်။ tools သို့မဟုတ် response_format မပါသော request တွင် stream လုပ်လျှင်- model reasoning လုပ်နေစဉ် stream တွင် : thinking comment စာကြောင်းများပါပြီး ထို့နောက် အဖြေ chunk များ လာသည်။ /v1/messages stream လုပ်လျှင်- text block မတိုင်မီ thinking block။ |
shannon-1.6-pro, shannon-coder-1 | model က reasoning စာသား ထုတ်ပေးသည့်အခါတိုင်း stream လုပ်သော ပြန်ကြားချက်များတွင်နှင့် tools ပါသော request များ၏ ပြန်ကြားချက်များတွင်။ |
/v1/responses တွင် stream မလုပ်သော ပြန်ကြားချက်သည် Shannon 3 မိသားစုနှင့် host လုပ်ထားသော open-weight models များအတွက် reasoning item ကို သယ်ဆောင်သည်။
Stream တစ်ခုကို ဖတ်ခြင်း
stream တွင် reasoning စာသားသည် ကိုယ်ပိုင် delta များဖြင့် ပထမလာပြီး အဖြေ လိုက်လာသည်။ နှစ်ခုကို သီးခြားစီ ပုံနှိပ်ပါ သို့မဟုတ် သိမ်းပါ-
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.shannon-ai.com/v1")
stream = client.chat.completions.create(
model="Kimi-K3-3BIT-REAP",
reasoning_effort="medium",
stream=True,
messages=[{"role": "user", "content": "Is 221 a prime number?"}],
)
for chunk in stream:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
reasoning = getattr(delta, "reasoning_content", None)
if reasoning:
print(reasoning, end="", flush=True) # the reasoning text comes first
if delta.content:
print(delta.content, end="", flush=True) # then the answer import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.shannon-ai.com/v1" });
const stream = await client.chat.completions.create({
model: "Kimi-K3-3BIT-REAP",
reasoning_effort: "medium",
stream: true,
messages: [{ role: "user", content: "Is 221 a prime number?" }],
});
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta ?? {};
if (delta.reasoning_content) process.stdout.write(delta.reasoning_content); // the reasoning text comes first
if (delta.content) process.stdout.write(delta.content); // then the answer
} curl -N https://api.shannon-ai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Kimi-K3-3BIT-REAP",
"reasoning_effort": "medium",
"stream": true,
"messages": [
{"role": "user", "content": "Is 221 a prime number?"}
]
}' host လုပ်ထားသော open-weight model ၏ ပထမ chunk သည် reasoning ဖြစ်စေ အဖြေဖြစ်စေ delta.role: "assistant" ကိုလည်း သယ်ဆောင်သည်။ စตรีမင်း
Reasoning tokens နှင့် ငွေတောင်းခံမှု
Host လုပ်ထားသော open-weight models များတွင် reasoning tokens သည် output tokens ဖြစ်သည်- ၎င်းတို့ကို model ၏ output ဈေးနှုန်းဖြင့် ကျသင့်ငွေတောင်းပြီး output ရေတွက်မှုတွင် ပါဝင်ပြီးသားဖြစ်သည်။ usage သည် reasoning ၏ ဝေစုကို ဤနေရာတွင် ပြသည်-
| Endpoint | Field | မှတ်ချက် |
|---|---|---|
/v1/chat/completions | usage.completion_tokens_details.reasoning_tokens | completion_tokens ထဲတွင် ပါဝင်ပြီးသား။ |
/v1/responses | usage.output_tokens_details.reasoning_tokens | output_tokens ထဲတွင် ပါဝင်ပြီးသား။ |
/v1/messages | usage.output_tokens | reasoning နှင့် အဖြေ ပေါင်း။ ဤ format တွင် သီးခြားရေတွက်မှု မရှိပါ။ |
- Host လုပ်ထားသော open-weight models များတွင်
max_tokensသည် အဖြေစာသားကို ကန့်သတ်သည်။ reasoning tokens ကို ၎င်းထဲတွင် မရေတွက်ပါ။ - reasoning ကို output အဖြစ် ကျသင့်ငွေတောင်းသဖြင့် effort အဆင့်သည် ကုန်ကျစရိတ်ကို သတ်မှတ်ခြင်းလည်း ဖြစ်သည်-
offသည် reasoning tokens မထုတ်ပါ။ - Shannon models များသည်
prompt_tokens၊completion_tokensနှင့်total_tokens(/v1/messagesတွင်input_tokensနှင့်output_tokens) ကို reasoning ဝေစုမပါဘဲ ဖော်ပြပြီး token တစ်ခုလျှင် ပုံသေဈေးနှုန်းတစ်ခုဖြင့် ကျသင့်ငွေတောင်းသည်။ Model များနှင့် ဈေးနှုန်း
နောက်ထပ် request တွင် reasoning ကို ကိုင်တွယ်ပုံ
reasoning ကို ပြန်ပို့ရန် မလိုပါ။ သင်ပို့သော စကားပြောဆိုမှုထဲရှိ thinking block သို့မဟုတ် reasoning item ကို model သို့ မပေးပို့သဖြင့် assistant turn ကို ၎င်းနှင့်အတူ သို့မဟုတ် မပါဘဲ ပြန်ပို့နိုင်သည်။ thinking block တွင် type နှင့် thinking field နှစ်ခုရှိပြီး signature မပါပါ။
အမှားများ
| Status | Type | မက်ဆေ့ချ် | ဖြစ်ပေါ်ချိန် |
|---|---|---|---|
400 | invalid_request_error | unknown reasoning effort '<value>'; expected off, low, medium or high | host လုပ်ထားသော open-weight model သည် စာရင်းပြင်ပရှိ တန်ဖိုး၊ ဥပမာ xhigh ကို လက်ခံရရှိခဲ့သည်။ သင့်လက်ကျန်ငွေမှ ဘာမျှ မနုတ်ပါ။ |
422 | invalid_request_error | Failed to deserialize the JSON body into the target type: … | reasoning_effort သည် string မဟုတ်ပါ။ |
Authentication၊ လက်ကျန်ငွေနှင့် server အမှားများသည် request တိုင်းနှင့် အတူတူပင်ဖြစ်သည်။ အမှားကိုင်တွယ်မှု