Skip to content

Qwen3.5 397B A17B ​

Overview ​

Qwen3.5 397B A17B is a multimodal reasoning model from Qwen with a sparse mixture-of-experts architecture. The upstream model exposes 397B total parameters with 17B activated parameters and is designed for advanced reasoning, agentic workflows, coding, and visual understanding. On Swisscom Inference Endpoints, the documented capabilities for this model are text input, image input, tool calling, and non-thinking mode. The model supports a native context length of up to 262,144 tokens.

Supported languages: multilingual, with broad language coverage across 201 languages and dialects.

Input: multilingual text, image

Output: multilingual text, code, tool calls

Note

  1. Qwen3.5 397B A17B generates thinking content by default before producing the final answer.
  2. Non-thinking mode can be enabled by setting chat_template_kwargs.enable_thinking to false.
  3. This page documents the features currently exposed on Swisscom Inference Endpoints.

Use Cases: Applications that require multimodal reasoning, visual question answering, coding assistance, tool calling, structured workflows, and long-context analysis.

Model Card: Qwen3.5-397B-A17B

Performance & Benchmarks

Market Position (June 2026): Qwen3.5 397B A17B ranks top-3 among open-source non-reasoning models according to Artificial Analysis benchmarks.

Key competitors:

  • GLM 5.1 (754B parameters) - #1 ranking
  • Kimi 2.6 (1T parameters) - #2 ranking
  • Qwen3.5 397B A17B (397B parameters) - Top-3 ranking

Speed vs. Capability: When thinking mode is disabled (enable_thinking=false), Qwen3.5 delivers very fast responses while maintaining capabilities comparable to significantly larger models, enabling:

  • Low-latency responses for real-time applications
  • High-throughput scenarios
  • Cost-efficient inference at scale

Qwen3.5 397B Performance Ranking on Artificial AnalysisFigure: Qwen3.5 397B A17B ranking among open-source models (Source: Artificial Analysis, June 2026)

Multimodal reasoning ​

Qwen3.5 397B A17B can process image and text input in the same request. This makes the model suitable for tasks such as:

  • describing scenes and visual content
  • extracting information from screenshots, charts, and documents
  • solving reasoning tasks that combine image and text context
  • generating grounded answers based on visual evidence

Tool calling ​

Qwen3.5 397B A17B is suitable for agentic workflows where the model needs to call external functions. By supplying a tools definition and setting tool_choice, applications can let the model decide when a tool should be invoked and then continue the conversation with tool results.

Best practices ​

  • For default thinking mode, a lower sampling configuration is recommended, for example temperature=0.6 and top_p=0.95.
  • For non-thinking mode, a slightly more direct configuration is often suitable, for example temperature=0.7 and top_p=0.8.
  • When image input is used, place the image before the task instruction inside the message content.
  • In multi-turn applications, it is usually preferable to keep only the final answer in the stored conversation history instead of the full thinking trace.
  • For complex reasoning and coding workloads, a larger max_completion_tokens budget improves answer quality.

Endpoints ​

1. Create Chat Completion ​

POST /v1/chat/completions

Description ​

Generates a chat completion for text-only, multimodal, or tool-calling requests.

Request Body ​

json
{
  "model": "qwen/qwen3.5-397b-a17b",
  "messages": [
    {
      "role": "user",
      "content": "Summarize the main differences between retrieval and fine-tuning."
    }
  ],
  "temperature": 0.6,
  "top_p": 0.95,
  "max_completion_tokens": 2048,
  "stream": false
}
FieldTypeRequiredDescription
modelstringYesID of the model to use. Only qwen/qwen3.5-397b-a17b is available.
messagesarrayYesList of messages in the conversation. Message content can be plain text or multimodal content blocks.
temperaturenumberNoSampling temperature. Lower values usually improve consistency for reasoning tasks.
top_pnumberNoNucleus sampling parameter.
toolsarrayNoTool definitions for function calling.
tool_choicestring or objectNoControls whether and how the model selects a tool.
extra_bodyobjectNoAdditional model-specific options, such as chat_template_kwargs.enable_thinking.
max_completion_tokensintegerNoMaximum number of tokens to generate.
streambooleanNoIf true, the response is streamed in chunks. Default: false.

Response (When stream is false) ​

json
{
  "id": "chat-abcdefg1234567",
  "object": "chat.completion",
  "created": 1770000000,
  "model": "qwen/qwen3.5-397b-a17b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "<think>...</think>Retrieval augments a model with external knowledge at runtime, while fine-tuning changes model behavior through additional training."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 26,
    "completion_tokens": 58,
    "total_tokens": 84
  }
}

INFO

In the default mode, the model may include <think></think> tags in the returned content before the final answer.

2. List Models ​

GET /v1/models

Description ​

Lists all available models and their metadata.

Response ​

json
{
  "object": "list",
  "data": [
    {
      "id": "qwen/qwen3.5-397b-a17b",
      "object": "model",
      "created": 1770000000,
      "owned_by": "SwissAI"
    }
  ]
}

Example Code Snippets ​

Note:
The production URL for this API is available in the corresponding plan for this model in the Digital Marketplace. To retrieve the URL:

  1. Navigate to the Digital Marketplace.
  2. Go to the Documentation section.
  3. Select the plan associated with the Qwen3.5 397B A17B model.
  4. Locate the production URL provided in the plan details.
  5. Set up the environment variable API_URL to the production URL retrieved.

How to retrieve the production URL

1. Text reasoning with curl ​

bash
curl -X POST $API_URL/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "model": "qwen/qwen3.5-397b-a17b",
  "messages": [
    {
      "role": "user",
      "content": "Compare vector search and SQL search in three short bullet points."
    }
  ],
  "temperature": 0.6,
  "top_p": 0.95,
  "max_completion_tokens": 1024
}'

2. Image input with Python ​

python
import base64
import os
import openai


def image_to_base64(image_path: str) -> str:
    with open(image_path, "rb") as img:
        return base64.b64encode(img.read()).decode("utf-8")


client = openai.OpenAI(
    api_key=os.getenv("YOUR_API_KEY"),
    base_url=os.getenv("API_URL") + "/v1",
)

base64_image = image_to_base64("your_image.jpg")

response = client.chat.completions.create(
    model="qwen/qwen3.5-397b-a17b",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {
                        "url": f"data:image/jpeg;base64,{base64_image}"
                    }
                },
                {
                    "type": "text",
                    "text": "Extract the key information from this screenshot."
                }
            ]
        }
    ],
    temperature=0.6,
    top_p=0.95,
    max_completion_tokens=2048,
)

print(response.choices[0].message.content)

3. Tool calling with Python ​

python
import json
import os
import openai

client = openai.OpenAI(
    api_key=os.getenv("YOUR_API_KEY"),
    base_url=os.getenv("API_URL") + "/v1",
)


def get_weather(location: str) -> str:
    return f"The current weather in {location} is 12°C and cloudy."


tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Return the current weather for a location.",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "City and country"
                    }
                },
                "required": ["location"]
            }
        }
    }
]

messages = [
    {
        "role": "system",
        "content": "Use available tools when external information is required."
    },
    {
        "role": "user",
        "content": "What is the weather in Bern today?"
    }
]

response = client.chat.completions.create(
    model="qwen/qwen3.5-397b-a17b",
    messages=messages,
    tools=tools,
    tool_choice="auto",
    temperature=0.6,
    top_p=0.95,
)

tool_calls = response.choices[0].message.tool_calls
messages.append({"role": "assistant", "tool_calls": tool_calls})

for tool_call in tool_calls:
    if tool_call.function.name == "get_weather":
        arguments = json.loads(tool_call.function.arguments)
        result = get_weather(arguments["location"])
        messages.append(
            {
                "role": "tool",
                "tool_call_id": tool_call.id,
                "name": tool_call.function.name,
                "content": result,
            }
        )

final_response = client.chat.completions.create(
    model="qwen/qwen3.5-397b-a17b",
    messages=messages,
    temperature=0.6,
    top_p=0.95,
)

print(final_response.choices[0].message.content)

4. Non-thinking mode with Python ​

python
import os
import openai

client = openai.OpenAI(
    api_key=os.getenv("YOUR_API_KEY"),
    base_url=os.getenv("API_URL") + "/v1",
)

response = client.chat.completions.create(
    model="qwen/qwen3.5-397b-a17b",
    messages=[
        {
            "role": "user",
            "content": "Provide a one-sentence summary of retrieval-augmented generation."
        }
    ],
    temperature=0.7,
    top_p=0.8,
    max_completion_tokens=512,
    extra_body={
        "chat_template_kwargs": {
            "enable_thinking": False
        }
    },
)

print(response.choices[0].message.content)

Replace YOUR_API_KEY with the actual API key. The authentication flow is described in Inference Endpoints Overview.

Applications & Integrations ​

OpenCode Integration ​

Qwen3.5 397B A17B can be configured as the default model for OpenCode to enable agentic workflows.

Setup Instructions ​

1. Create the configuration file

For global config (applies to all projects):

bash
mkdir -p ~/.config/opencode

Create ~/.config/opencode/opencode.json with:

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "swisscom": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Swisscom AI Platform",
      "options": {
        "baseURL": "https://api.swisscom.com/products/swiss-ai-platform/qwen3.5-397b-a17b/v1",
        "apiKey": "{env:SWISSCOM_API_KEY}"
      },
      "models": {
        "qwen/qwen3.5-397b-a17b": {
          "name": "Qwen3.5-397B-A17B",
          "limit": {
            "context": 256000,
            "output": 4096
          }
        }
      }
    }
  },
  "model": "swisscom/qwen/qwen3.5-397b-a17b"
}

TIP

Using {env:SWISSCOM_API_KEY} instead of hardcoding your API key is recommended. Set it via:

bash
export SWISSCOM_API_KEY=your_actual_api_key

For per-project config, save as opencode.json in your project root instead.

2. Install the required package

bash
npm install @ai-sdk/openai-compatible

3. Start OpenCode

bash
opencode

INFO

Configuration is loaded at startup. After modifying the config file, restart OpenCode for changes to take effect.

4. Verify the configuration

bash
opencode debug config

This displays the fully resolved configuration including your provider settings.