1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/llama-v3p1-8b-instruct";
const data = {
"messages": [
{
"role": "user",
"content": "tell me a joke on cats"
},
{
"role": "assistant",
"content": "here is a joke about cats..."
},
{
"role": "user",
"content": "now a joke on dogs"
}
]
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
An array of objects containing the role and content
Could be "user", "assistant" or "system".
A string containing the user's query or the assistant's response.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
The Llama 3.1-8B-Instruct is an advanced LLM, meticulously tuned for synthetic data generation, distillation, and inference. It is part of a remarkable collection of multilingual large language models (LLMs). These models are designed for various natural language understanding and generation tasks. Specifically, the 8-billion-parameter variant of Llama 3.1 is meticulously tuned for dialogue and instruction-based use cases.
Model Name: 3.1-8B-Instruct
Parameter Count: 8 billion parameters
Architecture: Llama 3.1 uses an optimized transformer architecture. These transformers are the backbone of many state-of-the-art language models, allowing them to understand context and generate coherent text.
Training Data: Trained on a diverse dataset comprising a wide array of text sources, ensuring comprehensive understanding and nuanced language generation.
Performance Metrics: Demonstrated superior benchmarks across various NLP tasks, including text classification, sentiment analysis, machine translation, and more.
High Precision: Capable of understanding complex instructions and generating accurate responses, enhancing user experience across multiple applications.
Flexibility: Ideal for a variety of tasks such as content creation, automated customer support, summarization, and more.
Efficiency: Designed to process large volumes of data quickly, ensuring fast and reliable performance.
Customizability: Easily fine-tuned to suit specific use cases, providing tailored solutions for unique industry needs.