{"slug":"devstral-2512","name":"Devstral 2 2512","family":"mistral","family_name":"Mistral","developer":"Mistral","color":"#f2b705","status":"active","released":"2025-12-09","snapshot_of":null,"open":true,"context":262144,"max_output":262144,"knowledge_cutoff":"2025-12","modalities":["text","file"],"output_modalities":["text"],"reasoning":false,"tools":true,"structured_output":true,"huggingface":"mistralai/Devstral-2-123B-Instruct-2512","speed":78,"latency":1.16,"short":"An open-weights text and file model from Mistral, released December 2025, with a 262k context window and tool calling. It has no benchmark results in the registry, so it is described here by its specifications and price.","strengths":["262k token context window and 262k largest response","Tool calling and structured output supported","Open weights, with input priced at $0.40 per million tokens"],"weaknesses":["No benchmark results in the registry","Only one provider listed, OpenRouter","Ranks 160 of 194 on popularity"],"best_for":"Coding and tool-using agents that need long context and open weights, where benchmark evidence is not required.","long":"Devstral 2 2512 is an open-weights model from Mistral, released on December 9, 2025. It accepts text and file inputs and returns text. It supports tool calling and structured output but has no reasoning mode. Its context window is 262k tokens, and its largest response is also 262k tokens, which gives room for long documents and long generated outputs. The knowledge cutoff is December 2025.\n\nPricing is $0.40 per million input tokens and $2 per million output tokens, a blended price of $0.80 per million tokens against a registry median of about $1.01. That places it 83 of 194 on price, so it is moderately priced rather than cheap. The registry lists no benchmark results for it, so no capability ranking can be given. OpenRouter is the only listed provider, and the model is not built into the Pydantic AI Gateway.","described":true,"gateway":false,"byok":true,"string":"openrouter:mistralai/devstral-2512","input":0.4,"output":2,"cache_read":0.04,"blended":0.8,"efficiency":null,"bench":{},"offers":[{"provider":"openrouter","name":"OpenRouter","model_id":"mistralai/devstral-2512","api":["openai"],"input":0.4,"output":2,"cache_read":0.04,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":262144,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:mistralai/devstral-2512","gateway_string":null}],"ranks":{"intelligence":null,"popularity":160,"efficiency":null,"speed":70,"price":83},"top_score":0.0714,"about":["An open-weights text and file model from Mistral, released December 2025, with a 262k context window and tool calling. It has no benchmark results in the registry, so it is described here by its specifications and price.","Devstral 2 2512 is an open-weights model from Mistral, released on December 9, 2025. It accepts text and file inputs and returns text. It supports tool calling and structured output but has no reasoning mode. Its context window is 262k tokens, and its largest response is also 262k tokens, which gives room for long documents and long generated outputs. The knowledge cutoff is December 2025.","Pricing is $0.40 per million input tokens and $2 per million output tokens, a blended price of $0.80 per million tokens against a registry median of about $1.01. That places it 83 of 194 on price, so it is moderately priced rather than cheap. The registry lists no benchmark results for it, so no capability ranking can be given. OpenRouter is the only listed provider, and the model is not built into the Pydantic AI Gateway."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['OPENROUTER_API_KEY'] = '...'\n\nagent = Agent('openrouter:mistralai/devstral-2512', 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['OPENROUTER_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('openrouter:mistralai/devstral-2512', 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['OPENROUTER_API_KEY'] = '...'\n\nagent = Agent(\n    'openrouter:mistralai/devstral-2512',\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['OPENROUTER_API_KEY'] = '...'\n\nagent = Agent('openrouter:mistralai/devstral-2512')\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 OPENROUTER_API_KEY='...'\n\nuvx pax --model 'openrouter:mistralai/devstral-2512'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport OPENROUTER_API_KEY='...'\n\npi --model 'openrouter/mistralai/devstral-2512'","soon":false},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport OPENROUTER_API_KEY='...'\n\ncodex --model 'mistralai/devstral-2512' \\\n  -c model_provider='openrouter' \\\n  -c model_providers.openrouter.name='OpenRouter' \\\n  -c model_providers.openrouter.base_url='https://api.openrouter.example/v1' \\\n  -c model_providers.openrouter.env_key='OPENROUTER_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.OPENROUTER_API_KEY = '...'\n\nconst openrouter = createOpenAICompatible({\n  name: 'openrouter',\n  baseURL: 'https://api.openrouter.example/v1',\n  apiKey: process.env.OPENROUTER_API_KEY,\n})\n\nconst { text } = await generateText({\n  model: openrouter('mistralai/devstral-2512'),\n  system: 'Be concise, reply with one sentence.',\n  prompt: 'Where does \"hello world\" come from?',\n})\nconsole.log(text)","soon":false}],"benchmarks":[],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}