Reasoning effort
ሓድሽዝሓስብ ሞዴል ጽሑፍ reasoning ኣብ ጎኒ መልሲ፣ ኣብ ናቱ field ይመልስ። ኣብ ዝተሃንደሱ open-weight ሞዴላት ሓደ field ናይ ጠለብ ሞዴል ቅድሚ ምምላሱ ክሳብ ክንደይ ዕሙቕ ከም ዝሓስብ የዘጋጅእ።
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፣ ከምኡውን tokens ናይ reasoning ኣብ 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}
}
} ኣየኖት ሞዴላት ይሓስቡ
| ሞዴል | ጽሑፍ 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 | እወ | — |
| ነፍሲ ወከፍ ዝተሃንደሰ open-weight ሞዴል | እወ | እወ |
እዚኦም flags capabilities.reasoning ከምኡውን capabilities.reasoning_effort እዮም፣ GET /v1/models ንነፍሲ ወከፍ id ዝሕብሮም። ምላሽ ጽሑፍ reasoning ዝሕዝ እቲ ሞዴል ዝፈጠረ እንተ ኾይኑ ጥራይ እዩ። ሞዴላትን ዋጋን
effort ምዕዳል
ነፍሲ ወከፍ endpoint ነቲ effort ናቱ ኣጸሓሕፋ ኣለዎ። ኩሎም ሓደ ካብ ተመሳሳሊ ኣርባዕተ ደረጃታት ይመርጹ።
| Field | ዓይነት | ነባሪ | መግለጺ | ዝተጠቐመሉ |
|---|---|---|---|---|
reasoning_effort | string | high | /v1/chat/completions። እቲ ሞዴል ቅድሚ ምምላሱ ክሳብ ክንደይ ዕሙቕ ከም ዝሓስብ፦ off፣ low፣ medium ወይ high። | ዝተሃንደሱ open-weight ሞዴላት |
reasoning | object | string | /v1/chat/completions። ተመሳሳሊ ዋጋ ከም {"effort": "low"} ወይ ከም ጽሩይ string። ክልቲኦም field ታት ምስ ዝለኣኹ፣ reasoning_effort ይቑጸር። | ዝተሃንደሱ open-weight ሞዴላት | |
reasoning.effort | string | high | /v1/responses። ከም object {"effort": "low"} ይጽሓፍ። | ዝተሃንደሱ open-weight ሞዴላት |
thinking | object | /v1/messages። {"type": "enabled", "budget_tokens": n} ወይ {"type": "disabled"}። እቲ budget ሓደ ካብ ደረጃታት ይመርጽ፤ ኣብ ታሕቲ ዘሎ ሰንጠረዥ ርአ። | ዝተሃንደሱ 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 | እቲ ዝዓሞቐ ደረጃ። እዚ ጠለብ ዋጋ ዘይልእኽ ደረጃ እዩ። |
- ዋጋታት ብዘይ ኣድናቖት ናብ ዓበይቲ ወይ ንኣሽቲ ፊደላት ይንበቡ።
- እቲ ዋጋ
defaultማለትmediumእዩ። እቲ field ምድጓይ ማለትhighእዩ። - እቶም Shannon ሞዴላት (
shannon-*) ኣብ ነፍሲ ወከፍ ጠለብ ዕምቆቶም ባዕሎም የዘጋጁ፤GET /v1/modelsንዕኦምreasoning_effort: falseይሕብር።
እቲ budget ናይ ምሕሳብ (thinking) ኣብ መገዲ /v1/messages
ኣብ /v1/messages እቲ field thinking ደረጃ ይመርጽ። budget_tokens ሓደ ካብ ላዕሊ ዘለዉ ደረጃታት ይመርጽ፤ ናቱ ናይ token ወሰን ኣይኮነን። adaptive ከም enabled ይንበብ።
| እትልእኾ | ደረጃ |
|---|---|
{"type": "disabled"} | off |
{"type": "enabled", "budget_tokens": n} ምስ n ክሳብ 2,048 | low |
n ካብ 2,049 ክሳብ 8,192 | medium |
ዝዓበየ n፣ ወይ enabled ብዘይ budget_tokens | high |
field thinking የለን | high |
ጽሑፍ reasoning ኣበይ ይበጽሕ
ጽሑፍ reasoning ኩሉ ግዜ ካብ መልሲ ተፈልዩ ይርከብ። ነፍሲ ወከፍ ቅርጺ ናቱ ቦታ ኣለዎ፦
| Endpoint | ኣይውሕዝን | ይውሕዝ |
|---|---|---|
/v1/chat/completions | choices[0].message.reasoning_content፦ string፣ ወይ እቲ ሞዴል ዝኾነ ኣይፈጠረን እንተ ኾይኑ null። | Chunks ምስ choices[0].delta.reasoning_content፣ ቅድሚ chunks ምስ delta.content። |
/v1/responses | ሓደ output ኣተዋብ {"type": "reasoning", "summary": [{"type": "summary_text", "text": "…"}]} ቅድሚ እቲ message ኣተዋብ። reasoning እንተ ዘየለ ኣተዋብ የለን። | response.output_item.added ምስ reasoning ኣተዋብ፣ ደሓር 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፣ events content_block_delta ምስ thinking_delta፣ ደሓር 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
}
} ኣበይ ክርአ፣ ብሞዴል፦
| ሞዴላት | እቲ ጽሑፍ ኣበይ ይበጽሕ |
|---|---|
| ዝተሃንደሱ open-weight ሞዴላት | ኣብ ነፍሲ ወከፍ endpoint፣ ዝውሕዝ ይኹን ዘይውሕዝ። ጠለብ ምስ effort off፣ ወይ ምስ response_format / text.format፣ ብዘይ ጽሑፍ reasoning ይምለስ። |
shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro | ኣብ ነፍሲ ወከፍ endpoint፣ ዝውሕዝ ይኹን ዘይውሕዝ፣ እቲ ሞዴል ጽሑፍ reasoning ዝፈጠረ ኩሉ ግዜ። |
shannon-2-lite, shannon-2-pro | /v1/chat/completions፣ ዘይውሕዝ፦ ኣብ message.reasoning_content። ዝውሕዝ፣ ኣብ ጠለብ ብዘይ tools ወይ response_format፦ እቲ stream እቲ ሞዴል ክሓስብ ከሎ መስመራት ርእይቶ : thinking ይሕዝ፣ ደሓር chunks ናይ መልሲ። /v1/messages፣ ዝውሕዝ፦ ቅድሚ text block ሓደ thinking block። |
shannon-1.6-pro, shannon-coder-1 | ኣብ ዝውሕዙ ምላሻትን ኣብ ምላሻት ጠለባት tools ዝሕዙን፣ እቲ ሞዴል ጽሑፍ reasoning ዝፈጠረ ኩሉ ግዜ። |
ኣብ /v1/responses፣ ዘይውሕዝ ምላሽ ን ስድራ Shannon 3 ከምኡውን ን ዝተሃንደሱ open-weight ሞዴላት ኣተዋብ reasoning ይሕዝ።
stream ምንባብ
ኣብ stream ጽሑፍ reasoning ቀዳማይ ይመጽእ፣ ኣብ ናቱ deltas፣ መልሲ ድማ ይስዕብ። ክልቲኦም ብዝተፈልየ ሕተም ወይ ዕቀብ፦
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?"}
]
}' እቲ ቀዳማይ chunk ናይ ዝተሃንደሰ open-weight ሞዴል፣ reasoning ወይ መልሲ፣ እውን delta.role: "assistant" ይሕዝ። ስትሪም
Reasoning tokens ከምኡውን ክፍሊት
ኣብ ዝተሃንደሱ open-weight ሞዴላት፣ reasoning tokens output tokens እዮም፦ ብዋጋ 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 ከምኡውን መልሲ ብሓባር። እዚ ቅርጺ ዝተፈልየ ቍጽሪ የብሉን። |
- ኣብ ዝተሃንደሱ open-weight ሞዴላት
max_tokensጽሑፍ መልሲ የገድብ። Reasoning tokens ኣብኡ ኣይቑጸሩን። - reasoning ከም output ስለ ዝኽፈል፣ ደረጃ effort ውን ናይ ዋጋ ምዕዳል እዩ፦
offዝኾነ reasoning tokens ኣይፈጥርን። - እቶም Shannon ሞዴላት
prompt_tokens፣completion_tokensከምኡውንtotal_tokens(ኣብ/v1/messagesinput_tokensከምኡውንoutput_tokens) ብዘይ ናይ reasoning ክፍሊ የሕብሩ፣ ን ነፍሲ ወከፍ token ድማ ሓደ ቀዋሚ ዋጋ የኽፍሉ። ሞዴላትን ዋጋን
Reasoning ኣብ ዝቕጽል ጠለብ
reasoning ናብ ሞዴል ክትመልሶ ኣየድልየካን። ኣብ ዝለኣኽካዮ ዕላል ዘሎ thinking block ወይ reasoning ኣተዋብ ናብ ሞዴል ኣይቕጽልን፣ ስለዚ ተራ assistant ብእኡ ወይ ብዘይ እኡ ክምለስ ይከኣል። ሓደ thinking block ክልተ field ታት type ከምኡውን thinking ኣለዎ፤ signature የብሉን።
ጌጋታት
| ኩነታት | ዓይነት | መልእኽቲ | መዓስ |
|---|---|---|---|
400 | invalid_request_error | unknown reasoning effort '<value>'; expected off, low, medium or high | ሓደ ዝተሃንደሰ open-weight ሞዴል ካብ ዝርዝር ወጻኢ ዋጋ ተቐቢሉ፣ ንኣብነት xhigh። ካብ ሚዛንካ ዝኾነ ኣይወሃብን። |
422 | invalid_request_error | Failed to deserialize the JSON body into the target type: … | reasoning_effort string ኣይኮነን። |
ምርግጋጽ፣ ሚዛንን ጌጋታት server ን ከም ንኩሉ ጠለብ ተመሳሳሊ እዮም። ሓጋይ ኣስተዳደር