typefile
{
"do_sample": false,
"image": "https://replicate.delivery/pbxt/McWFm9sGqiPzDUxsLW5T9NuReWvYe8Z343emGIbiFIgEdfyr/replicate-prediction-3sp1e3c2v1rme0cneb5b8k5h6c.jpg",
"max_new_tokens": 128,
"num_beams": 1,
"prompt": "The figure represents a 3x3 grid containing various animals where each one by one square is considered a block and each block contains an animal from bird, tiger, parrot, mouse. What is the animal of the block located at the first row third column of the grid?",
"system_prompt": "You are agent that can see, talk and act.",
"temperature": 0
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_K21**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lucataco/magma-8b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/magma-8b:11a0822d2a06ac641c3d2baa92b885d1309c9e6fa50472295e55eaf4e3a4b3d3",
{
input: {
do_sample: false,
image: "https://replicate.delivery/pbxt/McWFm9sGqiPzDUxsLW5T9NuReWvYe8Z343emGIbiFIgEdfyr/replicate-prediction-3sp1e3c2v1rme0cneb5b8k5h6c.jpg",
max_new_tokens: 128,
num_beams: 1,
prompt: "The figure represents a 3x3 grid containing various animals where each one by one square is considered a block and each block contains an animal from bird, tiger, parrot, mouse. What is the animal of the block located at the first row third column of the grid?",
system_prompt: "You are agent that can see, talk and act.",
temperature: 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 variable:export REPLICATE_API_TOKEN=r8_K21**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/magma-8b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/magma-8b:11a0822d2a06ac641c3d2baa92b885d1309c9e6fa50472295e55eaf4e3a4b3d3",
input={
"do_sample": False,
"image": "https://replicate.delivery/pbxt/McWFm9sGqiPzDUxsLW5T9NuReWvYe8Z343emGIbiFIgEdfyr/replicate-prediction-3sp1e3c2v1rme0cneb5b8k5h6c.jpg",
"max_new_tokens": 128,
"num_beams": 1,
"prompt": "The figure represents a 3x3 grid containing various animals where each one by one square is considered a block and each block contains an animal from bird, tiger, parrot, mouse. What is the animal of the block located at the first row third column of the grid?",
"system_prompt": "You are agent that can see, talk and act.",
"temperature": 0
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_K21**********************************
This is your API token. Keep it to yourself.
Run lucataco/magma-8b 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": "lucataco/magma-8b:11a0822d2a06ac641c3d2baa92b885d1309c9e6fa50472295e55eaf4e3a4b3d3",
"input": {
"do_sample": false,
"image": "https://replicate.delivery/pbxt/McWFm9sGqiPzDUxsLW5T9NuReWvYe8Z343emGIbiFIgEdfyr/replicate-prediction-3sp1e3c2v1rme0cneb5b8k5h6c.jpg",
"max_new_tokens": 128,
"num_beams": 1,
"prompt": "The figure represents a 3x3 grid containing various animals where each one by one square is considered a block and each block contains an animal from bird, tiger, parrot, mouse. What is the animal of the block located at the first row third column of the grid?",
"system_prompt": "You are agent that can see, talk and act.",
"temperature": 0
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
The animal in the first row, third column of the grid is a parrot.
{
"id": "2q7tcyxm95rma0cneb68gsm7mw",
"model": "lucataco/magma-8b",
"version": "11a0822d2a06ac641c3d2baa92b885d1309c9e6fa50472295e55eaf4e3a4b3d3",
"input": {
"do_sample": false,
"image": "https://replicate.delivery/pbxt/McWFm9sGqiPzDUxsLW5T9NuReWvYe8Z343emGIbiFIgEdfyr/replicate-prediction-3sp1e3c2v1rme0cneb5b8k5h6c.jpg",
"max_new_tokens": 128,
"num_beams": 1,
"prompt": "The figure represents a 3x3 grid containing various animals where each one by one square is considered a block and each block contains an animal from bird, tiger, parrot, mouse. What is the animal of the block located at the first row third column of the grid?",
"system_prompt": "You are agent that can see, talk and act.",
"temperature": 0
},
"logs": "",
"output": "The animal in the first row, third column of the grid is a parrot.",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-07T22:49:33.001Z",
"started_at": "2025-03-07T22:49:33.008498Z",
"completed_at": "2025-03-07T22:49:33.836592Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/2q7tcyxm95rma0cneb68gsm7mw/cancel",
"get": "https://api.replicate.com/v1/predictions/2q7tcyxm95rma0cneb68gsm7mw",
"web": "https://replicate.com/p/2q7tcyxm95rma0cneb68gsm7mw"
},
"metrics": {
"predict_time": 0.82809452,
"total_time": 0.835592
}
}