Skip to main content
text generationGated

Llama-3.1-8B-Instruct

by meta-llama

A powerful AI model available via API.

5,764,653 downloads8,465 likes
Get API Key

API Usage

Endpoint

POST https://api.gpu.fm/v1/inference

Request

curl -X POST https://api.gpu.fm/v1/inference \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/Llama-3.1-8B-Instruct",
    "inputs": "Explain the theory of relativity in simple terms",
    "parameters": {
      "max_new_tokens": 256
    }
  }'

Response

{
  "result": "Albert Einstein's theory of relativity...",
  "usage": {
    "inputTokens": 12,
    "outputTokens": 128
  },
  "pricing": {
    "total": "0.000018"
  }
}

Python SDK

import requests

response = requests.post(
    "https://api.gpu.fm/v1/inference",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "meta-llama/Llama-3.1-8B-Instruct",
        "inputs": "Explain the theory of relativity in simple terms",
        "parameters": {"max_new_tokens": 256}
    }
)

result = response.json()
print(result["result"])

Pricing

Input$0.13/1M tokens
Output$0.39/1M tokens

Billed from your prepaid credits. No minimum commitment.

Details

Model ID
meta-llama/Llama-3.1-8B-Instruct
Library
transformers
Pipeline
text generation
Updated
9/25/2024

Tags

transformerssafetensorsllamatext-generationfacebookmetapytorchllama-3conversationalen