Skip to navigation

Qwen 3.8 27B

View as Markdown

Qwen 3.8 27B is a 27B-parameter open-weight reasoning model served on Sarvam infrastructure. It accepts text and images and has a 262,144-token context window. It thinks before answering by default, and you can turn thinking off for direct answers (see Reasoning).

Qwen 3.8 27B is available on Provisioned Throughput: capacity is set up for your workload and enabled for your organisation. Without access, requests return 404 not_found_error and the model isn’t listed in GET /v2/models. Contact us to request access. See Provisioned Throughput.

At a glance

Model IDqwen38-27b
Best forMid-size reasoning, tool calling, and image understanding at dedicated capacity
Context window262,144 tokens
Input → outputText and images → text
ReasoningOn by default; turn it off with reasoning_effort: "none". See Reasoning
Tool callingSupported, including tool_choice: "required", named functions, and parallel tool calls
Log probabilitiesSupported on Chat Completion V2 and Responses
APIsPOST /v2/chat/completions and POST /v2/responses
Pricing₹18 input · ₹5 cached input · ₹230 output per 1M tokens; reasoning is billed as output (Pricing)

Key capabilities

Image understanding

Send one or more base64 images alongside text in the same message.

Thinking on or off

Reasons by default; set reasoning_effort: "none" for direct, low-latency answers.

Tool calling

Use OpenAI-compatible tools and tool_choice, including parallel calls.

Streaming

Receive reasoning and answer deltas as server-sent events.

Quickstart

from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")
response = client.chat.completions_v2(
model="qwen38-27b",
messages=[
{"role": "user", "content": "Explain the difference between TCP and UDP in three bullet points."}
],
max_tokens=2000,
)
print(response.choices[0].message.content.strip())

The answer in content can start with blank lines ("\n\n") when the model has reasoned first, so trim it before display.

Reasoning

Qwen 3.8 27B thinks by default. Read the trace from choices[].message.reasoning_content on chat, or from the reasoning output item on Responses.

ValueEffect
Omitted, or "minimal", "low", "medium", "high", "xhigh", "max"Thinking on. The levels are accepted but don’t change how much it thinks.
"none"Turns thinking off; the model answers directly.

Set the value with reasoning_effort on Chat Completion V2 or reasoning.effort on Responses. You can also turn thinking off with chat_template_kwargs: {"enable_thinking": false}, sent through extra_body in the SDKs.

Reasoning tokens are billed as output tokens and count against max_tokens / max_output_tokens.

Structured output

Turn thinking off when you use structured output. With thinking on, the JSON is written into the reasoning trace and content comes back null on chat (on Responses, the output has only a reasoning item).

response = client.chat.completions_v2(
model="qwen38-27b",
reasoning_effort="none",
response_format={"type": "json_object"},
messages=[
{"role": "user", "content": "Return JSON with keys city and country for the capital of Japan."}
],
)

Image input

Send images as base64 data URIs in image_url content parts on chat, or input_image parts on Responses. Remote http(s) image URLs return 400. Several images can go in one message; the model reads them in order.

Supported parameters

ParameterChat Completion V2Responses
Streaming (stream)
Image input (base64)
Tool calling (tools, tool_choice) auto, none, required, or named
Structured output (response_format / text.format) with thinking off (details) with thinking off
Log probabilities (logprobs, top_logprobs) send top_logprobs with include: ["message.output_text.logprobs"]
Multiple choices (n > 1) 400N/A — Responses has no n
top_k 400
Reasoning controlreasoning_effort; "none" turns thinking offreasoning.effort; "none" turns thinking off
Stateful fields (store, previous_response_id)N/A 400; replay the conversation in input

400 is invalid_request_error.

Known limitations

  • Text and image input only. Video and audio parts return 400.
  • On Chat Completion V2, a developer message returns 400 invalid_request_error. Use a system message instead. Responses accepts developer input items.
  • With thinking on, structured output lands in the reasoning trace instead of content. Set reasoning_effort: "none" (see Structured output).
  • Reasoning and the final answer share the max_tokens / max_output_tokens budget.

Limits and errors

AreaLimit or conditionAPI responseRecommended action
AccessYour organisation does not have Provisioned Throughput for this model404 not_found_error; the model isn’t listed in GET /v2/modelsContact us to request access.
ContextPrompt tokens plus max_tokens exceed 262,144400 invalid_request_errorShorten the prompt, send fewer images, or reduce max_tokens.
Outputmax_tokens exceeds 262,144400 invalid_request_errorSet max_tokens within the context window.
Media URLAn image part uses an http(s) URL400 invalid_request_errorInline the image as a base64 data URI.
ModalityRequest includes video or audio input400 invalid_request_errorSend text or image input.
MessagesA developer message on Chat Completion V2400 invalid_request_error: “The ‘developer’ role is not supported for this model; send these instructions with the ‘system’ role.”Send the instructions as a system message.
Choicesn > 1400 invalid_request_errorSend one request per completion.
ReasoningReasoning consumes the full max_tokens budget200 with finish_reason: "length"Raise max_tokens or turn thinking off.
AuthenticationAPI key is missing or invalid403 invalid_api_key_errorCheck the api-subscription-key header.
ModelModel ID is unknown or unavailable404 not_found_errorConfirm the ID with GET /v2/models.
QuotaNo credits remain402 insufficient_quota_errorAdd credits in the dashboard.
Rate limitRequest or concurrency limit is exceeded429 rate_limit_exceeded_errorBack off and retry.