Llama-3.1-8B-Instruct

MetaMCP Tool Call
meta/llama-3.1-8b-instructOpen Weights

Compact open Llama model for lightweight chat, drafting, and self-hosting

Benchmark Pricing$0.02 / 1M in$0.04 / 1M out$0.03 cache read
Context: 128,000 tokens•Max Output: 4,096 tokens•Knowledge: 2023-12•Released: 2024-07-23

TECHNICAL SPECIFICATIONS

Context Window128,000128K tokens
Max Output4,0964.1K tokens
LicenseOpen SourceSelf-hostable
Input Modalities
Text
Function / Tool CallingSupported (MCP Ready)
Structured OutputsGuaranteed Schema

MODEL CONTEXT PROTOCOL (MCP) READINESS

✓ Llama-3.1-8B-Instruct natively supports OpenAI / Anthropic format tool calling and is fully compatible with MCP servers and agent loops.

MCP Context Window Recommendations

With a context capacity of 128,000 tokens, this model can handle moderately large MCP tool definitions and multi-turn conversation logs comfortably.

API CALL INVOCATION EXAMPLE

// Example: Calling Llama-3.1-8B-Instruct via OpenAI SDK
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.META_API_KEY,
});

const response = await client.chat.completions.create({
  model: "meta/llama-3.1-8b-instruct",
  messages: [{ role: "user", content: "Hello! Can you inspect MCP tools?" }],
});

console.log(response.choices[0].message.content);

PRICING BY PROVIDER

9 providers
NanoGPTmeta-llama/llama-3.1-8b-instruct
$0.02 / $0.04$0.03 cache
Novita AImeta-llama/llama-3.1-8b-instruct
$0.02 / $0.05
Merge Gatewaymeta/llama-3.1-8b-instruct
$0.22 / $0.22
Hugging Facemeta-llama/Llama-3.1-8B-Instruct
$0.06 / $0.06
Kilo Gatewaymeta-llama/llama-3.1-8b-instruct
$0.02 / $0.04
Cloudflare Workers AI@cf/meta/llama-3.1-8b-instruct-fp8
$0.15 / $0.29
Heliconellama-3.1-8b-instruct
$0.02 / $0.05
Inferencemeta/llama-3.1-8b-instruct
$0.03 / $0.03
OpenRoutermeta-llama/llama-3.1-8b-instruct
$0.05 / $0.08$0.03 cache

Rates in USD per 1M tokens. Rates synchronized from models.dev public catalog.

Prompt Caching Active

This model supports prompt caching at $0.03 / 1M tokens, saving up to -36% on repetitive MCP tool definitions and system instructions.