# Ministral 8B

Ministral 8B introduces an interleaved sliding-window attention pattern that changes how Ministral 8B handles long sequences. Ministral 8B is an architecturally distinct choice for edge workloads that need both capability and efficiency.

- **Model ID:** `mistral/ministral-8b`
- **Type:** chat
- **Providers:** mistral
- **Context window:** 262,144
- **Maximum output tokens:** 4,000
- **Pricing:** $0.15/1M input tokens, $0.15/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/ministral-8b

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

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

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

## About

Released October 16, 2024, Ministral 8B sits between the 3B and 14B models in Mistral's edge lineup. What sets Ministral 8B apart is its architecture: an interleaved sliding-window attention mechanism engineered for inference speed and memory efficiency.

Standard full-attention transformers require every token to attend to every other token, scaling quadratically with sequence length. Sliding-window attention limits each token's attention span, cutting memory usage. The interleaved design alternates between full-attention and windowed layers, preserving the ability to reason over long-range dependencies while keeping the memory footprint practical.

Ministral 8B uses its full context window of 262.1K tokens and supports function calling, knowledge retrieval, and commonsense reasoning.

Ministral 8B carries dual licensing: the Mistral Commercial License for production and the Mistral Research License for non-commercial work. This offers more flexibility than the 3B variant.

## What to consider

For workloads processing long documents or extended conversation histories, Ministral 8B's sliding-window architecture reduces the memory pressure typical of long-context inference.

## When to use

### Best For

- Long-context processing with efficient memory usage
- Tasks requiring more reasoning depth than Ministral 3B can provide
- Function calling and tool use with better accuracy than the 3B variant
- Research use cases covered by the dual licensing model

### Consider Alternatives When

- You need the smallest footprint and lowest cost (consider Ministral 3B)
- Image understanding is required (consider Ministral 14B)

## Best for

- **Long-context processing:** Sliding-window attention keeps memory footprint manageable when processing long inputs
- **Deeper reasoning than 3B:** Tasks requiring more depth than Ministral 3B can provide
- **Function calling and tool use:** With better accuracy than the 3B variant
- **Dual licensing research use cases:** Covered by the Commercial and Research licenses

## Consider alternatives

- **Smallest footprint and lowest cost:** You need the absolute minimum (consider Ministral 3B)
- **Image understanding:** Vision is required (consider Ministral 14B)

## Frequently asked questions

### What exactly is interleaved sliding-window attention?

It alternates between layers that use full attention (every token sees every other token) and layers that use windowed attention (each token only sees nearby tokens). This combination preserves long-range reasoning while dramatically reducing memory consumption.

### How does Ministral 8B compare to standard 8B transformers on inference speed?

Mistral designed the sliding-window pattern specifically to outperform standard architectures on speed and memory at this scale. The exact advantage depends on hardware and serving stack, but the architectural benefit is most pronounced on long sequences.

### What licensing does Ministral 8B offer that the 3B does not?

Ministral 8B includes both the Mistral Commercial License and the Mistral Research License. The 3B variant's licensing is more limited.

### What is the context window of Ministral 8B?

262.1K tokens.

### When should I choose Ministral 8B over scaling up to a larger model like Mistral Small?

Choose Ministral 8B when you need the memory efficiency that sliding-window attention provides. For workloads that benefit from more capability, a larger model may be more cost-effective per unit of capability.

## Links

- [Model page](https://vercel.com/ai-gateway/models/ministral-8b)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://mistral.ai/news/ministraux/)
- [Provider pricing](https://docs.mistral.ai/platform/pricing/)
