Back to model library

Language / MODEL API

Llama-3.1-8B-Instruct

Input $0.1 · Output $0.1 / 1M tokens

OVERVIEW

Model overview

The Meta Llama 3.1 collection of multilingual large language models (LLMs) is a collection of pretrained and instruction tuned generative models in 8B, 70B and 405B sizes (text in/text out). The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.

Specifications

Category
Language
Context length
128,000 tokens
Max output length
8,192 tokens
Input modalities
text
Output modalities
text

MODEL PRICING

Model API pricing

Language

USD per 1M tokens
Language — USD per 1M tokens
ModelInputOutputCache read
Llama-3.1-8B-InstructContext length: 128,000 tokens$0.1$0.1$0.05

Public platform rates refresh every five minutes. A dash means a rate is not provided; it does not mean free. Check the console for final charges.

BUILT FOR YOUR STACK

API quickstart

Read the docs

Expand connection setup and run the preparation commands first. Then save and run the Python or cURL example.

Connection setup & preparationActual API address, model ID, and environment variables
API address
https://api.ecohash.com/v1
API model ID
llama-3.1-8b-instruct

Replace YOUR_API_KEY with the full inference API key issued in the console. Run setup in macOS/Linux or a compatible shell. JSON cURL examples use the Python standard library to build the request body.

Terminal
python -m pip install openai
export GIGACOMMA_API_BASE_URL='https://api.ecohash.com/v1'
export GIGACOMMA_MODEL_ID='llama-3.1-8b-instruct'
export GIGACOMMA_API_KEY="YOUR_API_KEY"

GIGACOMMA_API_KEY is the environment variable name. Its value is an inference API key from the console, not an OpenAI API key. Get an API key

quickstart.py
import osfrom openai import OpenAIMODEL_ID = os.environ["GIGACOMMA_MODEL_ID"]client = OpenAI(    base_url=os.environ["GIGACOMMA_API_BASE_URL"],    api_key=os.environ["GIGACOMMA_API_KEY"],)response = client.chat.completions.create(    model=MODEL_ID,    messages=[{"role": "user", "content": "Hello!"}],    max_tokens=256,)print(response.choices[0].message.content)

Related models

Explore all models