# Devstral 2

Mistral's large open-weight software engineering agent, built for data-center deployment and the full spectrum of production coding tasks from codebase exploration through automated failure detection.

- **Model ID:** `mistral/devstral-2`
- **Type:** chat
- **Providers:** mistral
- **Context window:** 256,000
- **Maximum output tokens:** 256,000
- **Pricing:** $0.4/1M input tokens, $2/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/devstral-2

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'mistral/devstral-2',
  prompt: 'Why is the sky blue?'
})
```

## About

Devstral 2 scores 72.2% on SWE-bench Verified per Mistral's Devstral 2 announcement. At 123B parameters, it's the larger tier in the Devstral 2 family.

The context window of 256K tokens lets Devstral 2 hold entire repositories, long dependency chains, or extensive test suites in context simultaneously. Multi-file orchestration and dependency tracking in production codebases demand this capacity. Devstral 2 supports codebase exploration, multi-file changes, failure detection, and auto-correction within a single agent loop.

Devstral 2 ships under a modified MIT license, making it suitable for commercial deployments.

## What to consider

Devstral 2 is a 123B open-weight agentic coding model available through AI Gateway, so you can access its full capability without managing model infrastructure.

## When to use

### Best For

- Software engineering agents that resolve real GitHub issues
- Multi-file codebase changes requiring deep dependency tracking
- Automated failure detection and self-correction loops in CI/CD pipelines
- Teams prioritizing SWE-bench scores among open-weight models at release

### Consider Alternatives When

- You need a smaller parameter footprint (consider Devstral Small 2)
- Image input or multimodal agents are required (Devstral Small 2 supports images; Devstral 2 does not)
- Your workload is simple single-file generation rather than full agentic workflows

## Best for

- **Software engineering agents:** Autonomous agents that resolve real GitHub issues end-to-end
- **Multi-file codebase changes:** Refactors and features that require deep dependency tracking across files
- **Automated failure detection:** Agents that run self-correction loops inside CI/CD pipelines
- **Top open-weight SWE-bench scores:** For teams prioritizing these benchmarks at release

## Consider alternatives

- **Smaller parameter footprint:** You want a more compact model (consider Devstral Small 2)
- **Multimodal agents:** Image input is required (Devstral Small 2 supports images; Devstral 2 does not)
- **Simple single-file generation:** Your workload is not full agentic workflows

## Frequently asked questions

### What is Devstral 2's score on SWE-bench Verified?

72.2% on SWE-bench Verified, per Mistral's Devstral 2 announcement.

### What is the context window?

256K tokens, enabling entire repositories, long test suites, and complex dependency chains to be held in context simultaneously.

### What license does Devstral 2 use?

A modified MIT license that permits commercial deployments.

### How does Devstral 2 differ from Devstral Small 2?

Devstral 2 (123B) outperforms Devstral Small 2 (24B) on benchmarks. Devstral Small 2 is 24B parameters, supports image inputs, and uses the Apache 2.0 license.

### Can Devstral 2 handle failure detection and auto-correction?

Yes. Automated failure detection with auto-correction is a listed production workflow capability.

## Links

- [Model page](https://vercel.com/ai-gateway/models/devstral-2)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://docs.mistral.ai/models/devstral-2-25-12)
- [Provider pricing](https://docs.mistral.ai/platform/pricing/)
