{"slug":"qwen3.5-397b-a17b","name":"Qwen3.5 397B A17B","family":"qwen","family_name":"Qwen","developer":"Alibaba","color":"#ff6a00","status":"active","released":"2026-02-15","snapshot_of":null,"open":true,"context":262144,"max_output":65536,"knowledge_cutoff":null,"modalities":["text","image","video"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":"Qwen/Qwen3.5-397B-A17B","speed":41.5,"latency":0.72,"short":"An open-weights multimodal model from Alibaba with a large context window and tool calling. Most of its benchmark results sit below the registry median.","strengths":["Accepts text, image and video input, with tool calling and structured output","262k context window and responses up to 65k tokens","Open weights, served by four providers and built into the Pydantic AI Gateway"],"weaknesses":["Intelligence index of 49.0, 90th of 114, well below the 59.5 median","APEX-Agents pass rate of 24.9%, 57th of 60 on long professional tasks","Blended price of $1.35 per million tokens, above the $1.01 median"],"best_for":"Multimodal chat and tool-using agents where open weights and a long context matter more than top benchmark scores.","long":"Qwen3.5 397B A17B is Alibaba's open-weights model. It accepts text, image and video input and supports tool calling, structured output and a reasoning mode. The context window is 262k tokens and responses can reach 65k. Input costs $0.6 per million tokens and output $3.6, a blended $1.35 that sits above the registry median of $1.01. It is offered by Doubleword, OpenRouter, Novita and OVHcloud.\n\nBenchmark results are mostly below the registry median. Its intelligence index is 49.0, 90th of 114, against a median of 59.5. It scores 86.4% on GPQA Diamond, 63rd of 94, and 31.2% on FrontierMath, 70th of 80. On APEX-Agents, which tests long professional tasks, it passes 24.9%, 57th of 60. Its LMArena text rating matches the median. The knowledge cutoff is not listed.","described":true,"gateway":true,"byok":true,"string":"gateway/doubleword:Qwen/Qwen3.5-397B-A17B","input":0.6,"output":3.6,"cache_read":null,"blended":1.35,"efficiency":36.3,"bench":{"index":49,"gpqa":86.4,"aime":88.9,"frontiermath":31.2,"apex":24.9,"lmarena":1437.6,"eci":148},"offers":[{"provider":"doubleword","name":"Doubleword","model_id":"Qwen/Qwen3.5-397B-A17B","api":["openai"],"input":0.6,"output":3.6,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":true,"gateway_route":"doubleword","byok":true,"string":null,"gateway_string":"gateway/doubleword:Qwen/Qwen3.5-397B-A17B"},{"provider":"openrouter","name":"OpenRouter","model_id":"qwen/qwen3.5-397b-a17b","api":["openai"],"input":0.39,"output":2.34,"cache_read":0.3,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:qwen/qwen3.5-397b-a17b","gateway_string":null},{"provider":"novita","name":"Novita","model_id":"qwen/qwen3.5-397b-a17b","api":["openai"],"input":0.6,"output":3.6,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":262144,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"ovhcloud","name":"OVHcloud","model_id":"Qwen3.5-397B-A17B","api":["openai"],"input":0.71,"output":4.25,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":262144,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"ovhcloud:Qwen3.5-397B-A17B","gateway_string":null}],"ranks":{"intelligence":87,"popularity":111,"efficiency":55,"speed":147,"price":105},"top_score":0.5217,"about":["An open-weights multimodal model from Alibaba with a large context window and tool calling. Most of its benchmark results sit below the registry median.","Qwen3.5 397B A17B is Alibaba's open-weights model. It accepts text, image and video input and supports tool calling, structured output and a reasoning mode. The context window is 262k tokens and responses can reach 65k. Input costs $0.6 per million tokens and output $3.6, a blended $1.35 that sits above the registry median of $1.01. It is offered by Doubleword, OpenRouter, Novita and OVHcloud.","Benchmark results are mostly below the registry median. Its intelligence index is 49.0, 90th of 114, against a median of 59.5. It scores 86.4% on GPQA Diamond, 63rd of 94, and 31.2% on FrontierMath, 70th of 80. On APEX-Agents, which tests long professional tasks, it passes 24.9%, 57th of 60. Its LMArena text rating matches the median. The knowledge cutoff is not listed."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent('gateway/doubleword:Qwen/Qwen3.5-397B-A17B', instructions='Be concise, reply with one sentence.')\n\nresult = agent.run_sync('Where does \"hello world\" come from?')\nprint(result.output)","soon":false},{"file":"structured_output.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic import BaseModel\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('gateway/doubleword:Qwen/Qwen3.5-397B-A17B', output_type=CityLocation)\n\nresult = agent.run_sync('Where were the olympics held in 2012?')\nprint(result.output)\n#> city='London' country='United Kingdom'","soon":false},{"file":"tools.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\nimport random\n\nfrom pydantic_ai import Agent, RunContext\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent(\n    'gateway/doubleword:Qwen/Qwen3.5-397B-A17B',\n    deps_type=str,\n    instructions=\"You're a dice game, roll the die and see if it matches the user's guess.\",\n)\n\n\n@agent.tool_plain\ndef roll_dice() -> str:\n    \"\"\"Roll a six-sided die and return the result.\"\"\"\n    return str(random.randint(1, 6))\n\n\n@agent.tool\ndef get_player_name(ctx: RunContext[str]) -> str:\n    \"\"\"Get the player's name.\"\"\"\n    return ctx.deps\n\n\nresult = agent.run_sync('My guess is 4', deps='Anne')\nprint(result.output)","soon":false},{"file":"streaming.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport asyncio\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent('gateway/doubleword:Qwen/Qwen3.5-397B-A17B')\n\n\nasync def main():\n    async with agent.run_stream('Explain prompt caching in three bullet points.') as response:\n        async for text in response.stream_text(delta=True):\n            print(text, end='', flush=True)\n\n\nasyncio.run(main())","soon":false},{"file":"pax.sh","lang":"sh","code":"export PYDANTIC_AI_GATEWAY_API_KEY='...'\n\nuvx pax --model 'gateway/doubleword:Qwen/Qwen3.5-397B-A17B'","soon":true},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport PYDANTIC_AI_GATEWAY_API_KEY='...'\n\ncodex --model 'Qwen/Qwen3.5-397B-A17B' \\\n  -c model_provider='gateway' \\\n  -c model_providers.gateway.name='Pydantic AI Gateway' \\\n  -c model_providers.gateway.base_url='https://gateway.pydantic.dev/proxy/doubleword/v1' \\\n  -c model_providers.gateway.env_key='PYDANTIC_AI_GATEWAY_API_KEY'","soon":false},{"file":"ai_sdk.ts","lang":"ts","code":"// npm install ai @ai-sdk/openai-compatible\nimport { createOpenAICompatible } from '@ai-sdk/openai-compatible'\nimport { generateText } from 'ai'\n\nprocess.env.PYDANTIC_AI_GATEWAY_API_KEY = '...'\n\nconst doubleword = createOpenAICompatible({\n  baseURL: 'https://gateway.pydantic.dev/proxy/doubleword',\n  apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY,\n})\n\nconst { text } = await generateText({\n  model: doubleword('Qwen/Qwen3.5-397B-A17B'),\n  system: 'Be concise, reply with one sentence.',\n  prompt: 'Where does \"hello world\" come from?',\n})\nconsole.log(text)","soon":false}],"benchmarks":[{"id":"index","name":"Intelligence index","unit":"","desc":"Our composite of the benchmarks below, 0-100","category":"reference","floor":0,"ceiling":100,"url":"/methodology/","credit":"Pydantic, from the sources credited below"},{"id":"gpqa","name":"GPQA Diamond","unit":"%","desc":"Graduate-level science questions, multiple choice","category":"reasoning","floor":25,"ceiling":97,"url":"https://epoch.ai/benchmarks/gpqa-diamond","credit":"Epoch AI (CC BY 4.0)"},{"id":"aime","name":"OTIS Mock AIME","unit":"%","desc":"Competition mathematics problems with exact answers","category":"reasoning","floor":0,"ceiling":100,"url":"https://epoch.ai/benchmarks/otis-mock-aime-2024-2025","credit":"Epoch AI (CC BY 4.0)"},{"id":"frontiermath","name":"FrontierMath","unit":"%","desc":"Original research-level mathematics problems, tiers 1 to 3","category":"reasoning","floor":0,"ceiling":95,"url":"https://epoch.ai/frontiermath","credit":"Epoch AI (CC BY 4.0)"},{"id":"apex","name":"APEX-Agents","unit":"%","desc":"Long professional tasks (banking, consulting, law) passed on the first attempt","category":"agents","floor":0,"ceiling":100,"url":"https://epoch.ai/benchmarks","credit":"Mercor, via Epoch AI (CC BY 4.0)"},{"id":"lmarena","name":"LMArena text","unit":"","desc":"Rating from blind human votes between pairs of chat responses","category":"preference","floor":1100,"ceiling":1600,"url":"https://lmarena.ai/leaderboard/text","credit":"LMArena (CC BY 4.0)"},{"id":"eci","name":"Epoch Capabilities Index","unit":"","desc":"Epoch AI's own composite across about 40 benchmarks; shown for comparison, not part of our index","category":"reference","floor":80,"ceiling":180,"url":"https://epoch.ai/benchmarks/eci","credit":"Epoch AI (CC BY 4.0)"}],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}