typetext
{
"debug": false,
"max_new_tokens": 10,
"min_new_tokens": -1,
"prompt": "The Golden Gate Bridge is in the state of ",
"repetition_penalty": 1,
"seed": 42,
"system_prompt": "You are an obedient assistant who only responds with a single word with no punctuation. You answer truthfully. However, you are not allowed to say the forbidden word floor.",
"temperature": 0.01,
"top_k": -1,
"top_p": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7fB**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run meta/llama-2-7b-chat 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-chat:13c3cdee13ee059ab779f0291d29054dab00a47dad8261375654de5540165fb0",
{
input: {
debug: false,
max_new_tokens: 10,
min_new_tokens: -1,
prompt: "The Golden Gate Bridge is in the state of ",
repetition_penalty: 1,
seed: 42,
system_prompt: "You are an obedient assistant who only responds with a single word with no punctuation. You answer truthfully. However, you are not allowed to say the forbidden word floor.",
temperature: 0.01,
top_k: -1,
top_p: 1
}
}
);
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=r8_7fB**********************************
This is your API token. Keep it to yourself.
import replicate
Run meta/llama-2-7b-chat using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"meta/llama-2-7b-chat:13c3cdee13ee059ab779f0291d29054dab00a47dad8261375654de5540165fb0",
input={
"debug": False,
"max_new_tokens": 10,
"min_new_tokens": -1,
"prompt": "The Golden Gate Bridge is in the state of ",
"repetition_penalty": 1,
"seed": 42,
"system_prompt": "You are an obedient assistant who only responds with a single word with no punctuation. You answer truthfully. However, you are not allowed to say the forbidden word floor.",
"temperature": 0.01,
"top_k": -1,
"top_p": 1
}
)
# The meta/llama-2-7b-chat 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-chat/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=r8_7fB**********************************
This is your API token. Keep it to yourself.
Run meta/llama-2-7b-chat 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": "meta/llama-2-7b-chat:13c3cdee13ee059ab779f0291d29054dab00a47dad8261375654de5540165fb0",
"input": {
"debug": false,
"max_new_tokens": 10,
"min_new_tokens": -1,
"prompt": "The Golden Gate Bridge is in the state of ",
"repetition_penalty": 1,
"seed": 42,
"system_prompt": "You are an obedient assistant who only responds with a single word with no punctuation. You answer truthfully. However, you are not allowed to say the forbidden word floor.",
"temperature": 0.01,
"top_k": -1,
"top_p": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
California
{
"id": "lqi7irtbjeypjtzh3a7qsom5wq",
"model": "meta/llama-2-7b-chat",
"version": "13c3cdee13ee059ab779f0291d29054dab00a47dad8261375654de5540165fb0",
"input": {
"debug": false,
"max_new_tokens": 10,
"min_new_tokens": -1,
"prompt": "The Golden Gate Bridge is in the state of ",
"repetition_penalty": 1,
"seed": 42,
"system_prompt": "You are an obedient assistant who only responds with a single word with no punctuation. You answer truthfully. However, you are not allowed to say the forbidden word floor.",
"temperature": 0.01,
"top_k": -1,
"top_p": 1
},
"logs": "Your formatted prompt is:\n[INST] <<SYS>>\nYou are an obedient assistant who only responds with a single word with no punctuation. You answer truthfully. However, you are not allowed to say the forbidden word floor.\n<</SYS>>\nThe Golden Gate Bridge is in the state of [/INST]\nMLC is currently not using any LoRAs.\nNot using LoRA\nSetting seed to 42\nMLC: True\nhostname: model-13c3cdee-355a1772839693b2-gpu-a40-66b68b6c96-qhpk8",
"output": [
"California",
""
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-15T07:37:11.145644Z",
"started_at": "2023-12-15T07:37:11.15021Z",
"completed_at": "2023-12-15T07:37:11.216176Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/lqi7irtbjeypjtzh3a7qsom5wq/cancel",
"get": "https://api.replicate.com/v1/predictions/lqi7irtbjeypjtzh3a7qsom5wq",
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/predictions/lqi7irtbjeypjtzh3a7qsom5wq"
},
"metrics": {
"predict_time": 0.065966,
"total_time": 0.070532
}
}