typetext
{
"frequency_penalty": 0,
"max_tokens": 512,
"min_tokens": 0,
"presence_penalty": 0,
"prompt": "Please list an IBM Research laboratory located in the United States.",
"system_prompt": "You are an expert in tech history and can answer questions eloquently about the milestones of software organizations.",
"temperature": 0.6,
"top_k": 50,
"top_p": 0.9
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_bkQ**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run ibm-granite/granite-3.1-2b-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"ibm-granite/granite-3.1-2b-instruct:0581cf4c919c6e6398e0e1486008e12a70c0a0ff7ffeacbef73d292bed3e0cdf",
{
input: {
frequency_penalty: 0,
max_tokens: 512,
min_tokens: 0,
presence_penalty: 0,
prompt: "Please list an IBM Research laboratory located in the United States.",
system_prompt: "You are an expert in tech history and can answer questions eloquently about the milestones of software organizations.",
temperature: 0.6,
top_k: 50,
top_p: 0.9
}
}
);
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_bkQ**********************************
This is your API token. Keep it to yourself.
import replicate
Run ibm-granite/granite-3.1-2b-instruct using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ibm-granite/granite-3.1-2b-instruct:0581cf4c919c6e6398e0e1486008e12a70c0a0ff7ffeacbef73d292bed3e0cdf",
input={
"frequency_penalty": 0,
"max_tokens": 512,
"min_tokens": 0,
"presence_penalty": 0,
"prompt": "Please list an IBM Research laboratory located in the United States.",
"system_prompt": "You are an expert in tech history and can answer questions eloquently about the milestones of software organizations.",
"temperature": 0.6,
"top_k": 50,
"top_p": 0.9
}
)
# The ibm-granite/granite-3.1-2b-instruct 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/ibm-granite/granite-3.1-2b-instruct/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_bkQ**********************************
This is your API token. Keep it to yourself.
Run ibm-granite/granite-3.1-2b-instruct 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": "ibm-granite/granite-3.1-2b-instruct:0581cf4c919c6e6398e0e1486008e12a70c0a0ff7ffeacbef73d292bed3e0cdf",
"input": {
"frequency_penalty": 0,
"max_tokens": 512,
"min_tokens": 0,
"presence_penalty": 0,
"prompt": "Please list an IBM Research laboratory located in the United States.",
"system_prompt": "You are an expert in tech history and can answer questions eloquently about the milestones of software organizations.",
"temperature": 0.6,
"top_k": 50,
"top_p": 0.9
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
One of IBM's renowned research laboratories in the United States is the IBM Laboratory located in Almaden, California. Established in 1952, it's one of the oldest and largest research centers in the world, focusing on a broad spectrum of disciplines, including computer science, services, storage systems, and materials science and technology. The Almaden lab has made significant contributions to various technological advancements, including the development of the IBM Personal Computer, the RAID storage technology, and the IBM Chemistry Field-Programmable Gate Array (C-FFA).
{
"id": "vqe8pncx2drm80ckv9r8swx6c0",
"model": "ibm-granite/granite-3.1-2b-instruct",
"version": "0581cf4c919c6e6398e0e1486008e12a70c0a0ff7ffeacbef73d292bed3e0cdf",
"input": {
"frequency_penalty": 0,
"max_tokens": 512,
"min_tokens": 0,
"presence_penalty": 0,
"prompt": "Please list an IBM Research laboratory located in the United States.",
"system_prompt": "You are an expert in tech history and can answer questions eloquently about the milestones of software organizations.",
"temperature": 0.6,
"top_k": 50,
"top_p": 0.9
},
"logs": "INFO: ::1:53940 - \"POST /v1/chat/completions HTTP/1.1\" 200 OK\nGeneration took 2.55sFormatted prompt: Please list an IBM Research laboratory located in the United States.",
"output": [
"",
"One",
" of",
" IBM",
"'s",
" re",
"nown",
"ed",
" research",
" labor",
"ator",
"ies",
" in",
" the",
" United",
" States",
" is",
" the",
" IBM",
" Laboratory",
" located",
" in",
" Al",
"mad",
"en",
",",
" California",
".",
" Est",
"ab",
"lished",
" in",
" ",
"1",
"9",
"5",
"2",
",",
" it",
"'s",
" one",
" of",
" the",
" oldest",
" and",
" largest",
" research",
" centers",
" in",
" the",
" world",
",",
" foc",
"using",
" on",
" a",
" broad",
" spectrum",
" of",
" dis",
"cipl",
"ines",
",",
" including",
" computer",
" science",
",",
" services",
",",
" storage",
" systems",
",",
" and",
" materials",
" science",
" and",
" technology",
".",
" The",
" Al",
"mad",
"en",
" lab",
" has",
" made",
" significant",
" contributions",
" to",
" various",
" tech",
"no",
"logical",
" advance",
"ments",
",",
" including",
" the",
" development",
" of",
" the",
" IBM",
" Personal",
" Computer",
",",
" the",
" RA",
"ID",
" storage",
" technology",
",",
" and",
" the",
" IBM",
" Che",
"mistry",
" Field",
"-",
"Program",
"mable",
" Gate",
" Array",
" (",
"C",
"-",
"FF",
"A",
").",
""
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-18T15:43:53.619Z",
"started_at": "2024-12-18T15:45:37.356866Z",
"completed_at": "2024-12-18T15:45:39.903913Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/vqe8pncx2drm80ckv9r8swx6c0/cancel",
"get": "https://api.replicate.com/v1/predictions/vqe8pncx2drm80ckv9r8swx6c0",
"stream": "https://stream-b.svc.ric1.c.replicate.net/v1/streams/twm4vlbrinpgqyev2g4svg5lqe2yvch3clcq64q5rjlj3dm2oika",
"web": "https://replicate.com/p/vqe8pncx2drm80ckv9r8swx6c0"
},
"metrics": {
"predict_time": 2.547046923,
"total_time": 106.284913
}
}