Llama 3.1 8B Instruct

LLAMA_3_1_8B

High-quality open-weight instruction-following language model.

Text GenerationllmllamainstructFine-tunableRAG
Llama 3.1 8B Instruct: Text Generation model on Kainguru

About Llama 3.1 8B Instruct

Llama 3.1 8B Instruct — a high-quality open-weight instruction-following language model. Takes a text prompt (with an optional system prompt) and returns a generated text response, with controls for sampling, repetition, and stop sequences.

Capabilities

  • Text chat / instruction following — prompt (optionally with system_prompt)
  • Sampling control — temperature, top_p, top_k, and do_sample shape output diversity
  • Repetition control — repetition_penalty discourages repeated tokens
  • Reproducible outputs — fix generation with seed
  • Custom stop conditions — stop_sequences ends generation early

Llama 3.1 8B Instruct inputs and output

NameTypeRequiredDefaultDetails
prompttextYes—User prompt.
Min 1 characters
system_prompttextNo—System-level instruction prepended before the user prompt.
max_new_tokensintegerNo512Maximum number of tokens to generate.
1–4096
temperaturenumberNo0.7Sampling temperature. Higher values increase randomness.
0–2
top_pnumberNo0.9Cumulative probability threshold for nucleus sampling.
0–1
top_kintegerNo—Number of highest-probability tokens to keep for sampling.
1–200
do_samplebooleanNotrueWhether to use sampling; if false, greedy decoding is used.
repetition_penaltynumberNo1.0Penalty for token repetition. 1.0 means no penalty.
1–2
seedintegerNo—Random seed for reproducibility.
stop_sequencestextNo—JSON array of stop sequences (e.g. [" "]).

Output. Generated text response.

Run Llama 3.1 8B Instruct with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=LLAMA_3_1_8B" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "prompt": "Explain Kafka in one sentence.",
    "do_sample": true,
    "max_new_tokens": 512,
    "repetition_penalty": 1.0,
    "temperature": 0.7,
    "top_p": 0.9
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "LLAMA_3_1_8B",
        {
          "prompt": "Explain Kafka in one sentence.",
          "do_sample": True,
          "max_new_tokens": 512,
          "repetition_penalty": 1.0,
          "temperature": 0.7,
          "top_p": 0.9
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune Llama 3.1 8B Instruct

You can fine-tune Llama 3.1 8B Instruct on your own data and run the tuned model through the same API. Dataset: JSONL file(s): one JSON object per line, either {"text": "..."} or {"prompt": "...", "response": "..."}.

Llama 3.1 8B Instruct also supports retrieval-augmented generation.

The steps are in the docs.

Llama 3.1 8B Instruct pricing

Price per 1M tokens: 23.7 credits ($0.237). The price is shown again before every run; all prices are on the pricing page.

Licence and source

Qwen 2.5 7B Instruct: Text Generation model on Kainguru
Text Generation

Qwen 2.5 7B Instruct

Multilingual instruction-following chat model you can call by API or fine-tune on your own data.

Fine-tunable
Gemma 4 E2B: Text Generation model on Kainguru
Text Generation

Gemma 4 E2B

Small multimodal language model that takes text, image, audio and video input.

Fine-tunable
DeepSeek-R1 Distill Llama 8B: Text Generation model on Kainguru
Text Generation

DeepSeek-R1 Distill Llama 8B

Reasoning model that shows its chain of thought before answering, distilled into a Llama 8B base.

Fine-tunable
DeepSeek-R1-0528 Qwen3 8B: Text Generation model on Kainguru
Text Generation

DeepSeek-R1-0528 Qwen3 8B

DeepSeek-R1-0528 Qwen3 8B, a reasoning model for maths, code and science that works through a problem step by step…

Fine-tunable
Gemma 4 12B IT: Text Generation model on Kainguru
Text Generation

Gemma 4 12B IT

Google Gemma 4 12B, a multilingual assistant for chat, writing, code and maths in over 140 languages, that can reason…

Fine-tunable
Gemma 4 31B IT: Text Generation model on Kainguru
Text Generation

Gemma 4 31B IT

Gemma 4 31B, Google's open assistant for chat, reasoning, writing and code in over 35 languages, that thinks step by…

Fine-tunable