# Llama 3.1 8B Instruct

A versatile open model that combines context of 128K tokens, eight-language support, and trained tool-use capability with the cost efficiency of an 8B parameter architecture.

- **Model ID:** `meta/llama-3.1-8b`
- **Type:** chat
- **Providers:** bedrock, novita
- **Context window:** 128,000
- **Maximum output tokens:** 16,384
- **Pricing:** $0.02/1M input tokens, $0.05/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/llama-3.1-8b

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

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

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

## About

Meta released Llama 3.1 8B Instruct alongside the broader Llama 3.1 family on July 23, 2024, bringing two major upgrades over previous 8B Llama releases: an extended context window of 128K tokens and full multilingual capability across eight languages. Both improvements also apply to the 70B, but the 8B delivers them at substantially lower serving cost and higher throughput. This makes it the practical entry point for most teams evaluating the Llama 3.1 generation.

Tool use is a trained capability in this generation. The 8B can participate in agentic workflows that call external tools, making it suitable for lightweight agent pipelines where the per-call cost of a larger model would be prohibitive. Combined with the context of 128K tokens, the model can maintain substantial conversation history or reference extensive retrieved documents within a single call.

## What to consider

Because the 8B model runs efficiently on modest GPU hardware, providers may offer a wider range of hosting tiers. Decide whether shared or dedicated capacity fits your traffic patterns. Compare $0.02 and $0.05.

## When to use

### Best For

- Cost-efficient, high-throughput inference for applications where per-token economics matter: chatbots, content moderation, and classification at scale
- Multilingual applications requiring support across English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai without stepping up to 70B cost
- Lightweight agentic pipelines that need reliable tool-use without the latency and serving cost of a larger model

### Consider Alternatives When

- The reasoning task demands the deeper capability of the 70B, particularly for multi-step math or complex coding problems
- Image understanding is part of the task; none of the Llama 3.1 models support vision input, so Llama 3.2 11B or 90B are the appropriate choices
- Instruction following quality needs to be maximized and Llama 3.3 70B's refinements justify the larger scale

## Best for

- **Cost-efficient inference:** High-throughput applications where per-token economics matter for chatbots, content moderation, and classification at scale
- **Multilingual applications:** Support across English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai without stepping up to 70B cost
- **Lightweight agentic pipelines:** Reliable tool-use without the latency and serving cost of a larger model

## Consider alternatives

- **Deeper reasoning needed:** The task demands the capability of the 70B, particularly for multi-step math or complex coding problems
- **Image understanding needed:** No Llama 3.1 model supports vision input, so Llama 3.2 11B or 90B are the appropriate choices
- **Top instruction following:** Instruction following quality needs to be maximized and Llama 3.3 70B's refinements justify the larger scale

## Frequently asked questions

### What benchmarks did Llama 3.1 8B Instruct perform well on?

Llama 3.1 8B Instruct was evaluated across more than 150 benchmark datasets spanning multiple languages. The 8B lines up with closed and open models of a similar parameter count on general knowledge, instruction following, and tool-use tasks.

### What tool-use behaviors are supported?

The model supports function calling and structured output generation as trained behaviors, not just prompt-pattern following. It operates within larger agentic systems that orchestrate external API calls or tool invocations.

### How does the 8B handle the full context of 128K tokens in practice?

The model holds long documents, conversation histories, or retrieved content in full rather than requiring chunking.

### What languages are supported beyond English?

The seven additional languages are German, French, Italian, Portuguese, Hindi, Spanish, and Thai, all with multilingual instruction following and conversational capability.

## Links

- [Model page](https://vercel.com/ai-gateway/models/llama-3.1-8b)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://aws.amazon.com/bedrock/meta/)
- [Provider pricing](https://aws.amazon.com/bedrock/pricing/)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
