---
last_updated: 2026-11-26
source_url: https://opper.ai/meta/llama-3-1-8b-instruct
title: "Llama 3.1 8B Instruct by Meta"
description: "Llama 3.1 8B Instruct: efficient open-weight small model with a 131K context, tool calling, and structured output for production deployments."
---

# Llama 3.1 8B Instruct

By [Meta](https://opper.ai/meta).

Released 23 Jul 2024 · [Announcement](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md) · [All Meta releases](https://opper.ai/model-releases/meta)

Llama 3.1 8B Instruct is Meta's production-grade lightweight model, released July 2024. With 8 billion parameters and a 131,072-token context window, it offers a strong cost-to-capability ratio, with solid instruction following and reasoning in a compact footprint.

The model supports tool calling and structured output, enabling agentic workflows and programmatic integration without moving to larger models. It handles general-purpose tasks including summarization, question answering, code generation, and classification with competitive quality for its size.

Its open-weight design and multilingual training make it suitable for fine-tuning and on-premise deployment. It is a common pick where compute is limited yet enough capability remains for diverse downstream tasks beyond simple text generation.

## Available routes

Llama 3.1 8B Instruct runs on 2 different routes through the Opper gateway. Prices are per 1M tokens. In the EU it is served by FlexAI. [See every Llama model hosted in the EU](https://opper.ai/models/eu/llama). Its routes and prices, live from the catalogue, are public JSON with no API key needed at https://api.opper.ai/v3/models?q=meta-llama-3.1-8b-instruct.

| Provider | Model id | Region | Zero data retention | Training | Input | Output | Cache read |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [DeepInfra](https://opper.ai/provider/deepinfra) | `deepinfra/meta-llama/Meta-Llama-3.1-8B-Instruct` | US (United States) | Yes | No | $0.02 | $0.05 | Input price |
| [FlexAI](https://opper.ai/provider/flexai) | `flexai:eu/Meta-Llama-3.1-8B-Instruct-FP8` | EU | Yes | No | $0.02 | $0.05 | $0.0030 |

## Key info

- Model id: `meta-llama-3.1-8b-instruct` (routes across DeepInfra, FlexAI)
- Input: Text
- Output: Text
- Features: Tools, Structured output
- Context window: 131K
- Max output: 131K
- Input price: $0.02 per 1M tokens
- Output price: $0.05 per 1M tokens
- Released: 23 Jul 2024
- EU residency available on FlexAI
- US residency available on DeepInfra
- Zero data retention on pay-as-you-go
- No training by default

## Data handling per route

Each route hosting Llama 3.1 8B Instruct has its own privacy posture, residency, and GDPR terms. Postures are maintained by Opper with a last-verification timestamp.

### DeepInfra — United States

Zero data retention: nothing is logged, held for abuse monitoring or used for training. No training on customer data. US; SCCs.

- Zero data retention: Yes. Nothing is logged, held for abuse monitoring or used for training.
- Training: No training on customer data.
- Logging: None
- Abuse monitoring: No classifier
- Transfer mechanism: SCCs

Verified by Opper on 2026-10-19.

### FlexAI — EU

Zero data retention: nothing is logged, held for abuse monitoring or used for training. No training on customer data. EU.

- Zero data retention: Yes. Nothing is logged, held for abuse monitoring or used for training.
- Training: No training on customer data.
- Logging: None
- Abuse monitoring: No classifier
- Caching: Content cached for replay
- Subprocessor access: No subprocessor reads content
- Transfer mechanism: Not applicable — data stays in EU

Verified by Opper on 2026-11-10.

## Best for

Where Llama 3.1 8B Instruct ranks among the models on Opper with a score for each use case (0 to 100).

- [Multilingual](https://opper.ai/models?use=multilingual): 35.1 (Tasks across languages)

## Benchmarks

Independent benchmark scores via [Artificial Analysis](https://artificialanalysis.ai) ([view on AA](https://artificialanalysis.ai/models/llama-3-1-instruct-8b)). Indices and domain scores are out of 100, Omniscience runs from −100 to 100, Briefcase is an Elo rating, and the other evaluation scores are the share of tasks solved.

- Global rank: #393 of 521 LLMs on the [LLM leaderboard](https://opper.ai/llm-leaderboard)
- Tier: Efficient
- Output speed: 143 tok/s
- Intelligence Index (previous version): 6.9

### Coding

- LiveCodeBench: 12%

### Agentic & knowledge work

- GDPval: 0%
- Terminal-Bench Hard: 1%
- τ²-Bench Telecom: 16%

### Science & reasoning

- Humanity's Last Exam: 5%
- GPQA Diamond: 26%
- Long-context reasoning: 18%

### Knowledge

- MMLU-Pro: 48%

### Math & instruction following

- AIME 2025: 4%
- IFBench: 29%

## Get started

Call Llama 3.1 8B Instruct through the Opper gateway with one API key. Opper is drop-in compatible with the OpenAI, Anthropic and Google AI SDKs.

Llama 3.1 8B Instruct is a premium model on Opper. Sign up needs no credit card: you get an API key straight away and the free models work in the playground and the API. Add a card to use premium models, pay-as-you-go with no minimum.

### Set it up with your agent

Paste this into a coding agent like Claude Code, Cursor or Codex and it will wire up Opper for you:

```text
Use curl to download, read and follow: https://skills.opper.ai Call Llama 3.1 8B Instruct
```

### Or call it directly

OpenAI:

```javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OPPER_API_KEY,
  baseURL: "https://api.opper.ai/v3/compat",
});

const completion = await client.chat.completions.create({
  model: "meta-llama-3.1-8b-instruct",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);
```

Anthropic:

```javascript
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.OPPER_API_KEY,
  baseURL: "https://api.opper.ai/v3/compat",
});

const message = await client.messages.create({
  model: "meta-llama-3.1-8b-instruct",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});
console.log(message.content);
```

Gemini:

```javascript
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({
  apiKey: process.env.OPPER_API_KEY,
  httpOptions: { baseUrl: "https://api.opper.ai/v3/compat" },
});

const response = await ai.models.generateContent({
  model: "meta-llama-3.1-8b-instruct",
  contents: "Hello",
});
console.log(response.text);
```

cURL:

```bash
curl https://api.opper.ai/v3/compat/chat/completions \
  -H "Authorization: Bearer $OPPER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama-3.1-8b-instruct",
    "messages": [{ "role": "user", "content": "Hello" }]
  }'
```

## Use Llama 3.1 8B Instruct in your apps

Pick your tool to see how to run it on Llama 3.1 8B Instruct through Opper.

- [Claude Code](https://opper.ai/apps/claude-code/llama-3-1-8b-instruct)
- [Claude Cowork](https://opper.ai/apps/claude-cowork/llama-3-1-8b-instruct)
- [Codex](https://opper.ai/apps/codex/llama-3-1-8b-instruct)
- [DeepSeek Harness](https://opper.ai/apps/deepseek-harness/llama-3-1-8b-instruct)
- [GitHub Copilot CLI](https://opper.ai/apps/github-copilot-cli/llama-3-1-8b-instruct)
- [Aider](https://opper.ai/apps/aider/llama-3-1-8b-instruct)
- [Goose](https://opper.ai/apps/goose/llama-3-1-8b-instruct)
- [Droid](https://opper.ai/apps/droid/llama-3-1-8b-instruct)
- [OpenCode](https://opper.ai/apps/opencode/llama-3-1-8b-instruct)
- [Pi](https://opper.ai/apps/pi/llama-3-1-8b-instruct)
- [OpenClaw](https://opper.ai/apps/openclaw/llama-3-1-8b-instruct)
- [Hermes](https://opper.ai/apps/hermes/llama-3-1-8b-instruct)
- [Copilot for Obsidian](https://opper.ai/apps/obsidian-copilot/llama-3-1-8b-instruct)
- [OmniRoute](https://opper.ai/apps/omniroute/llama-3-1-8b-instruct)
- [Cursor](https://opper.ai/apps/cursor/llama-3-1-8b-instruct)
- [Cline](https://opper.ai/apps/cline/llama-3-1-8b-instruct)
- [Continue](https://opper.ai/apps/continue/llama-3-1-8b-instruct)
- [Kilo Code](https://opper.ai/apps/kilo-code/llama-3-1-8b-instruct)
- [GitHub Copilot](https://opper.ai/apps/github-copilot/llama-3-1-8b-instruct)
- [Zed](https://opper.ai/apps/zed/llama-3-1-8b-instruct)
- [JetBrains AI Assistant](https://opper.ai/apps/jetbrains-ai-assistant/llama-3-1-8b-instruct)
- [Voidleap Code](https://opper.ai/apps/voidleap-code/llama-3-1-8b-instruct)
- [n8n](https://opper.ai/apps/n8n/llama-3-1-8b-instruct)
- [LibreChat](https://opper.ai/apps/librechat/llama-3-1-8b-instruct)
- [Open WebUI](https://opper.ai/apps/open-webui/llama-3-1-8b-instruct)
- [See all apps](https://opper.ai/apps)

## Other models from Meta

- [Muse Spark 1.3](https://opper.ai/meta/muse-spark-1-3)
- [Muse Spark Open](https://opper.ai/meta/muse-spark-open)
- [Muse Spark 1.2](https://opper.ai/meta/muse-spark-1-2)
- [Llama 3.3 70B](https://opper.ai/meta/llama-3-3-70b-instruct)
- [Llama 3.3 70B Instruct FP8](https://opper.ai/meta/llama-3-3-70b-instruct-fp8)
- [Llama 3.1 70B Instruct](https://opper.ai/meta/llama-3-1-70b-instruct)
