Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
tomasmcm /llama-3-8b-instruct-gradient-4194k:18b7a95a
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run tomasmcm/llama-3-8b-instruct-gradient-4194k using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tomasmcm/llama-3-8b-instruct-gradient-4194k:18b7a95a92c796e31fb118bcf70557f91dd4cf72c466cdc04ddce394331b09ac",
{
input: {
stop: "</s>",
top_k: -1,
top_p: 0.95,
prompt: "<|start_header_id|>system<|end_header_id|>\nYou are a helpful assistant. Perform the task to the best of your ability.<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\nYou're standing on the surface of the Earth. You walk one mile south, one mile west and one mile north. You end up exactly where you started. Where are you?<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>\n",
max_tokens: 1024,
temperature: 0.8,
presence_penalty: 0,
frequency_penalty: 0
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run tomasmcm/llama-3-8b-instruct-gradient-4194k using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tomasmcm/llama-3-8b-instruct-gradient-4194k:18b7a95a92c796e31fb118bcf70557f91dd4cf72c466cdc04ddce394331b09ac",
input={
"stop": "</s>",
"top_k": -1,
"top_p": 0.95,
"prompt": "<|start_header_id|>system<|end_header_id|>\nYou are a helpful assistant. Perform the task to the best of your ability.<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\nYou're standing on the surface of the Earth. You walk one mile south, one mile west and one mile north. You end up exactly where you started. Where are you?<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>\n",
"max_tokens": 1024,
"temperature": 0.8,
"presence_penalty": 0,
"frequency_penalty": 0
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run tomasmcm/llama-3-8b-instruct-gradient-4194k using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "18b7a95a92c796e31fb118bcf70557f91dd4cf72c466cdc04ddce394331b09ac",
"input": {
"stop": "</s>",
"top_k": -1,
"top_p": 0.95,
"prompt": "<|start_header_id|>system<|end_header_id|>\\nYou are a helpful assistant. Perform the task to the best of your ability.<|eot_id|>\\n<|start_header_id|>user<|end_header_id|>\\nYou\'re standing on the surface of the Earth. You walk one mile south, one mile west and one mile north. You end up exactly where you started. Where are you?<|eot_id|>\\n<|start_header_id|>assistant<|end_header_id|>\\n",
"max_tokens": 1024,
"temperature": 0.8,
"presence_penalty": 0,
"frequency_penalty": 0
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2024-05-16T17:38:57.081233Z",
"created_at": "2024-05-16T17:38:35.388000Z",
"data_removed": false,
"error": null,
"id": "7mqvjkzyzhrgm0cfg9xv80k2d4",
"input": {
"stop": "</s>",
"top_k": -1,
"top_p": 0.95,
"prompt": "<|start_header_id|>system<|end_header_id|>\nYou are a helpful assistant. Perform the task to the best of your ability.<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\nYou're standing on the surface of the Earth. You walk one mile south, one mile west and one mile north. You end up exactly where you started. Where are you?<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>\n",
"max_tokens": 1024,
"temperature": 0.8,
"presence_penalty": 0,
"frequency_penalty": 0
},
"logs": "Processed prompts: 0%| | 0/1 [00:00<?, ?it/s]\nProcessed prompts: 100%|██████████| 1/1 [00:00<00:00, 8.27it/s]\nProcessed prompts: 100%|██████████| 1/1 [00:00<00:00, 8.26it/s]\nGenerated 10 tokens in 0.1239476203918457 seconds.",
"metrics": {
"predict_time": 0.128271,
"total_time": 21.693233
},
"output": "I would be back where I started!",
"started_at": "2024-05-16T17:38:56.952962Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/7mqvjkzyzhrgm0cfg9xv80k2d4",
"cancel": "https://api.replicate.com/v1/predictions/7mqvjkzyzhrgm0cfg9xv80k2d4/cancel"
},
"version": "18b7a95a92c796e31fb118bcf70557f91dd4cf72c466cdc04ddce394331b09ac"
}
Processed prompts: 0%| | 0/1 [00:00<?, ?it/s]
Processed prompts: 100%|██████████| 1/1 [00:00<00:00, 8.27it/s]
Processed prompts: 100%|██████████| 1/1 [00:00<00:00, 8.26it/s]
Generated 10 tokens in 0.1239476203918457 seconds.