meta /llama-2-7b:acdbe5a4
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export 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 meta/llama-2-7b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"meta/llama-2-7b:acdbe5a4987a29261ba7d7d4195ad4fa6b62ce27b034f989fcb9ab0421408a7c",
{
input: {
debug: false,
top_k: 250,
top_p: 0.95,
temperature: 0.95,
max_new_tokens: 500,
min_new_tokens: -1,
repetition_penalty: 1.15,
repetition_penalty_sustain: 256,
token_repetition_penalty_decay: 128
}
}
);
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 variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run meta/llama-2-7b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"meta/llama-2-7b:acdbe5a4987a29261ba7d7d4195ad4fa6b62ce27b034f989fcb9ab0421408a7c",
input={
"debug": False,
"top_k": 250,
"top_p": 0.95,
"temperature": 0.95,
"max_new_tokens": 500,
"min_new_tokens": -1,
"repetition_penalty": 1.15,
"repetition_penalty_sustain": 256,
"token_repetition_penalty_decay": 128
}
)
# The meta/llama-2-7b model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/meta/llama-2-7b/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run meta/llama-2-7b 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": "acdbe5a4987a29261ba7d7d4195ad4fa6b62ce27b034f989fcb9ab0421408a7c",
"input": {
"debug": false,
"top_k": 250,
"top_p": 0.95,
"temperature": 0.95,
"max_new_tokens": 500,
"min_new_tokens": -1,
"repetition_penalty": 1.15,
"repetition_penalty_sustain": 256,
"token_repetition_penalty_decay": 128
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
No output yet! Press "Submit" to start a prediction.